Blame SOURCES/bcc-0.10.0-tools-fix-vfscount-output-when-no-duration-is-specif.patch

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