mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Howard Cochran <hcochran@kernelspring.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Howard Cochran <hcochran@kernelspring.com>,
	linux-kernel@vger.kernel.org,
	Howard Cochran <cochran@lexmark.com>
Subject: [PATCH v3 5/5] trace-cmd stat: Support -a for all buffers. Update docs.
Date: Wed, 22 Apr 2015 00:55:14 -0400	[thread overview]
Message-ID: <7fb5912927dbe9dbeca92937538201306a57c685.1429677461.git.hcochran@kernelspring.com> (raw)
In-Reply-To: <cover.1429677461.git.hcochran@kernelspring.com>
In-Reply-To: <cover.1429677461.git.hcochran@kernelspring.com>

As for stop, restart, reset, extract, -a means show status of
all buffer instances except the top one. Use -t to get the top
one too.

Also added documentation for the existing -B and -t options.

Signed-off-by: Howard Cochran <hcochran@kernelspring.com>
---
 Documentation/trace-cmd-stat.1.txt | 19 +++++++++++++++++++
 trace-stat.c                       | 15 +++++++++++----
 trace-usage.c                      |  6 +++++-
 3 files changed, 35 insertions(+), 5 deletions(-)

diff --git a/Documentation/trace-cmd-stat.1.txt b/Documentation/trace-cmd-stat.1.txt
index 7e4263e..62c2e18 100644
--- a/Documentation/trace-cmd-stat.1.txt
+++ b/Documentation/trace-cmd-stat.1.txt
@@ -41,6 +41,25 @@ system. The status that it shows is:
 
 *Uprobes:* Shows any uprobes that are defined for tracing.
 
+OPTIONS
+-------
+*-B* 'buffer-name'::
+    If the kernel supports multiple buffers, this will display the status of
+    of the given buffer instance. This may be used multiple times to
+    specify different buffers. When this option is used, the status of the
+    top level instance will not be shown unless *-t* is given.
+
+*-a*::
+    Display the status of all existing buffer instances. When this option
+    is used, the status of the top level instance will not be displayed
+    unless *-t* is given.
+
+*-t*::
+    Display the status of the top level instance buffer. Without the *-B*
+    or *-a* option, this is the same as the default.  But if *-B* or *-a*
+    is used, this is required if the top level instance buffer should also
+    be displayed.
+
 SEE ALSO
 --------
 trace-cmd(1), trace-cmd-record(1), trace-cmd-report(1), trace-cmd-start(1),
diff --git a/trace-stat.c b/trace-stat.c
index 6c38719..9bd773e 100644
--- a/trace-stat.c
+++ b/trace-stat.c
@@ -865,6 +865,12 @@ static void report_traceon(struct buffer_instance *instance)
 
 static void stat_instance(struct buffer_instance *instance)
 {
+	if (instance->name) {
+		/* Lack of trailing newline is intentional */
+		printf("\nInstance: %s\n====================",
+			instance->name);
+	}
+
 	report_plugin(instance);
 	report_events(instance);
 	report_event_filters(instance);
@@ -887,7 +893,7 @@ void trace_stat (int argc, char **argv)
 	int c;
 
 	for (;;) {
-		c = getopt(argc-1, argv+1, "tB:");
+		c = getopt(argc-1, argv+1, "hatB:");
 		if (c == -1)
 			break;
 		switch (c) {
@@ -897,9 +903,9 @@ void trace_stat (int argc, char **argv)
 		case 'B':
 			instance = create_instance(optarg);
 			add_instance(instance);
-			/* top instance requires direct access */
-			if (!topt && is_top_instance(first_instance))
-				first_instance = instance;
+			break;
+		case 'a':
+			add_all_instances();
 			break;
 		case 't':
 			/* Force to use top instance */
@@ -911,6 +917,7 @@ void trace_stat (int argc, char **argv)
 			usage(argv);
 		}
 	}
+	update_first_instance(topt);
 
 	for_all_instances(instance) {
 		stat_instance(instance);
diff --git a/trace-usage.c b/trace-usage.c
index 56c68b4..6e85fdf 100644
--- a/trace-usage.c
+++ b/trace-usage.c
@@ -182,7 +182,11 @@ static struct usage_help usage_help[] = {
 	{
 		"stat",
 		"show the status of the running tracing (ftrace) system",
-		" %s stat"
+		" %s stat [-B buf][-a][-t]\n"
+		"          Shows the status of the tracing system"
+		"          -B status for a given buffer (more than one may be specified)\n"
+		"          -a status for all buffers (except top one)\n"
+		"          -t status the top level buffer (useful with -B or -a)\n"
 	},
 	{
 		"split",
-- 
1.9.1


      parent reply	other threads:[~2015-04-22  4:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-22  4:55 [PATCH v3 0/5] trace-cmd: Improve multi-instance support Howard Cochran
2015-04-22  4:55 ` [PATCH v3 1/5] trace-cmd extract: Add -B and -t for multiple instances Howard Cochran
2015-04-22  4:55 ` [PATCH v3 2/5] trace-cmd extract: Add -a option for all instances Howard Cochran
2015-04-22  4:55 ` [PATCH v3 3/5] trace-cmd stop, reset, restart: Add -a " Howard Cochran
2015-04-22  4:55 ` [PATCH v3 4/5] trace-cmd snapshot: Fully support multiple instances Howard Cochran
2015-04-22  4:55 ` Howard Cochran [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7fb5912927dbe9dbeca92937538201306a57c685.1429677461.git.hcochran@kernelspring.com \
    --to=hcochran@kernelspring.com \
    --cc=cochran@lexmark.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®