Skip to contentSkip to conversation

perf trace: Make command line arguments consistent with perf-record

PATCH In review David Ahern 2 participants 5 messages Aug 20, 2013 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf trace: Make command line arguments consistent with perf-record

Common arguments like thread id, CPU list, mmap pages, etc should be consistent across perf commands.

---
 tools/perf/builtin-trace.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
tools/perf/builtin-trace.c +6 -6
index 4235316..9891d8c 100644
@@ -693,17 +693,17 @@ int cmd_trace(int argc, const char **argv, const char *prefix __maybe_unused)
 	OPT_STRING('o', "output", &output_name, "file", "output file name"),
 	OPT_STRING('p', "pid", &trace.opts.target.pid, "pid",
 		    "trace events on existing process id"),
-	OPT_STRING(0, "tid", &trace.opts.target.tid, "tid",
+	OPT_STRING('t', "tid", &trace.opts.target.tid, "tid",
 		    "trace events on existing thread id"),
-	OPT_BOOLEAN(0, "all-cpus", &trace.opts.target.system_wide,
+	OPT_BOOLEAN('a', "all-cpus", &trace.opts.target.system_wide,
 		    "system-wide collection from all CPUs"),
-	OPT_STRING(0, "cpu", &trace.opts.target.cpu_list, "cpu",
+	OPT_STRING('C', "cpu", &trace.opts.target.cpu_list, "cpu",
 		    "list of cpus to monitor"),
-	OPT_BOOLEAN(0, "no-inherit", &trace.opts.no_inherit,
+	OPT_BOOLEAN('i', "no-inherit", &trace.opts.no_inherit,
 		    "child tasks do not inherit counters"),
-	OPT_UINTEGER(0, "mmap-pages", &trace.opts.mmap_pages,
+	OPT_UINTEGER('m', "mmap-pages", &trace.opts.mmap_pages,
 		     "number of mmap data pages"),
-	OPT_STRING(0, "uid", &trace.opts.target.uid_str, "user",
+	OPT_STRING('u', "uid", &trace.opts.target.uid_str, "user",
 		   "user to profile"),
 	OPT_CALLBACK(0, "duration", &trace, "float",
 		     "show only events with duration > N.M ms",
Signature · 1 line
1.7.10.1
#1 lore raw

Em Tue, Aug 20, 2013 at 08:47:56AM -0600, David Ahern escreveu:

Quoted 8 lines

Common arguments like thread id, CPU list, mmap pages, etc should be consistent across perf commands.

---
 tools/perf/builtin-trace.c |   12 ++++++------

tools/perf/Documentation/perf-trace.txt part missing :-)

Quoted 32 lines
 1 file changed, 6 insertions(+), 6 deletions(-)
tools/perf/builtin-trace.c +6 -6
index 4235316..9891d8c 100644
@@ -693,17 +693,17 @@ int cmd_trace(int argc, const char **argv, const char *prefix __maybe_unused)
 	OPT_STRING('o', "output", &output_name, "file", "output file name"),
 	OPT_STRING('p', "pid", &trace.opts.target.pid, "pid",
 		    "trace events on existing process id"),
-	OPT_STRING(0, "tid", &trace.opts.target.tid, "tid",
+	OPT_STRING('t', "tid", &trace.opts.target.tid, "tid",
 		    "trace events on existing thread id"),
-	OPT_BOOLEAN(0, "all-cpus", &trace.opts.target.system_wide,
+	OPT_BOOLEAN('a', "all-cpus", &trace.opts.target.system_wide,
 		    "system-wide collection from all CPUs"),
-	OPT_STRING(0, "cpu", &trace.opts.target.cpu_list, "cpu",
+	OPT_STRING('C', "cpu", &trace.opts.target.cpu_list, "cpu",
 		    "list of cpus to monitor"),
-	OPT_BOOLEAN(0, "no-inherit", &trace.opts.no_inherit,
+	OPT_BOOLEAN('i', "no-inherit", &trace.opts.no_inherit,
 		    "child tasks do not inherit counters"),
-	OPT_UINTEGER(0, "mmap-pages", &trace.opts.mmap_pages,
+	OPT_UINTEGER('m', "mmap-pages", &trace.opts.mmap_pages,
 		     "number of mmap data pages"),
-	OPT_STRING(0, "uid", &trace.opts.target.uid_str, "user",
+	OPT_STRING('u', "uid", &trace.opts.target.uid_str, "user",
 		   "user to profile"),
 	OPT_CALLBACK(0, "duration", &trace, "float",
 		     "show only events with duration > N.M ms",
Signature · 1 line
1.7.10.1
#2 lore raw
Quoted 11 lines · Arnaldo Carvalho de Melo

Em Tue, Aug 20, 2013 at 08:47:56AM -0600, David Ahern escreveu:

Quoted 8 lines

Common arguments like thread id, CPU list, mmap pages, etc should be consistent across perf commands.

---
  tools/perf/builtin-trace.c |   12 ++++++------

tools/perf/Documentation/perf-trace.txt part missing :-)

grrrr... Added a check in the git pre-commit hook to remind me:

$ git commit -a
changing command line arguments. Did you update the man page?

Will resend later today.
David

#3 lore raw

Em Tue, Aug 20, 2013 at 10:22:54AM -0600, David Ahern escreveu:

Quoted 8 lines · Arnaldo Carvalho de Melo
Quoted 6 lines

Em Tue, Aug 20, 2013 at 08:47:56AM -0600, David Ahern escreveu:

Quoted 5 lines

Common arguments like thread id, CPU list, mmap pages, etc should be consistent across perf commands.

 tools/perf/builtin-trace.c |   12 ++++++------
Quoted 6 lines
Quoted 1 line

tools/perf/Documentation/perf-trace.txt part missing :-)

grrrr... Added a check in the git pre-commit hook to remind me:

$ git commit -a
changing command line arguments. Did you update the man page?

Hey, post it somewhere, please! I'd like to use it too. :-)

Quoted 2 lines

Will resend later today.
David

#4 lore raw
Quoted 6 lines · Arnaldo Carvalho de Melo
Quoted 4 lines

grrrr... Added a check in the git pre-commit hook to remind me:

$ git commit -a
changing command line arguments. Did you update the man page?

Hey, post it somewhere, please! I'd like to use it too. :-)

$ cat .git/hooks/pre-commit
#!/bin/bash

git diff --cached | egrep -q 'OPT_'
if [ $? -eq 0 ]
then

	git diff --cached | egrep -q '^diff.*tools/perf/Documentation'
	if [ $? -ne 0 ]
	then
		echo "changing command line arguments. Did you update the man page?"
		exit 1
	fi

fi
exec git diff --cached | scripts/checkpatch.pl --no-signoff -q -