|
|
1910f2 |
From 0206fc4e3568eab6cacfc1d5916258a9ba764f5d Mon Sep 17 00:00:00 2001
|
|
|
1910f2 |
From: Jerome Marchand <jmarchan@redhat.com>
|
|
|
1910f2 |
Date: Mon, 5 Aug 2019 15:29:22 +0200
|
|
|
1910f2 |
Subject: [PATCH] tools: fix vfscount output when no duration is specified
|
|
|
1910f2 |
|
|
|
1910f2 |
Since commit a2e71a9eb71a ("vfscount.py: add args time (#2344)"),
|
|
|
1910f2 |
vfscount does not show any output when it is interrupted by a key
|
|
|
1910f2 |
press, which is the only way out when no time limit is specified. I
|
|
|
1910f2 |
assume the exit() that has been added in the keyboard interrupt
|
|
|
1910f2 |
handler is there so that no output is displayed when the program has
|
|
|
1910f2 |
been interrupted early when a time limit has been specified. But since
|
|
|
1910f2 |
the tool still invite the user to use Ctrl-C to end the tracing in
|
|
|
1910f2 |
that case, it seems more consistent to show an output in that case
|
|
|
1910f2 |
too.
|
|
|
1910f2 |
|
|
|
1910f2 |
This patch removes the exit() and the tools always show a result at
|
|
|
1910f2 |
the end. It also adds the duration argument to the synopsis and the
|
|
|
1910f2 |
option section in the man page.
|
|
|
1910f2 |
---
|
|
|
1910f2 |
man/man8/vfscount.8 | 6 +++++-
|
|
|
1910f2 |
tools/vfscount.py | 1 -
|
|
|
1910f2 |
2 files changed, 5 insertions(+), 2 deletions(-)
|
|
|
1910f2 |
|
|
|
1910f2 |
diff --git a/man/man8/vfscount.8 b/man/man8/vfscount.8
|
|
|
1910f2 |
index fbf0e89e..febbc9e6 100644
|
|
|
1910f2 |
--- a/man/man8/vfscount.8
|
|
|
1910f2 |
+++ b/man/man8/vfscount.8
|
|
|
1910f2 |
@@ -2,7 +2,7 @@
|
|
|
1910f2 |
.SH NAME
|
|
|
1910f2 |
vfscount \- Count VFS calls ("vfs_*"). Uses Linux eBPF/bcc.
|
|
|
1910f2 |
.SH SYNOPSIS
|
|
|
1910f2 |
-.B vfscount
|
|
|
1910f2 |
+.B vfscount [duration]
|
|
|
1910f2 |
.SH DESCRIPTION
|
|
|
1910f2 |
This counts VFS calls. This can be useful for general workload
|
|
|
1910f2 |
characterization of these operations.
|
|
|
1910f2 |
@@ -14,6 +14,10 @@ Edit the script to customize which functions to trace.
|
|
|
1910f2 |
Since this uses BPF, only the root user can use this tool.
|
|
|
1910f2 |
.SH REQUIREMENTS
|
|
|
1910f2 |
CONFIG_BPF and bcc.
|
|
|
1910f2 |
+.SH OPTIONS
|
|
|
1910f2 |
+.TP
|
|
|
1910f2 |
+duration
|
|
|
1910f2 |
+duration of the trace in seconds.
|
|
|
1910f2 |
.SH EXAMPLES
|
|
|
1910f2 |
.TP
|
|
|
1910f2 |
Count some VFS calls until Ctrl-C is hit:
|
|
|
1910f2 |
diff --git a/tools/vfscount.py b/tools/vfscount.py
|
|
|
1910f2 |
index b7c18efd..303d3fde 100755
|
|
|
1910f2 |
--- a/tools/vfscount.py
|
|
|
1910f2 |
+++ b/tools/vfscount.py
|
|
|
1910f2 |
@@ -54,7 +54,6 @@ print("Tracing... Ctrl-C to end.")
|
|
|
1910f2 |
sleep(interval)
|
|
|
1910f2 |
except KeyboardInterrupt:
|
|
|
1910f2 |
pass
|
|
|
1910f2 |
- exit()
|
|
|
1910f2 |
|
|
|
1910f2 |
print("\n%-16s %-26s %8s" % ("ADDR", "FUNC", "COUNT"))
|
|
|
1910f2 |
counts = b.get_table("counts")
|
|
|
1910f2 |
--
|
|
|
1910f2 |
2.20.1
|
|
|
1910f2 |
|