Skip to contentSkip to conversation

perf_counter tools: add --input=file option to builtin-sched.c

patchlet Mike Galbraith 2 participants 3 messages Sep 18, 2009 perf events

lore
Share & tools
lore
#0 lore raw

perf_counter tools: add --input=file option to builtin-sched.c.

perf sched record passes unparsed args on to perf record, so specifying an output file via perf sched record -o FILE (cmd) just works. Ergo, provide an option to specify input file as well.

Also add the missing 'map' command to help.

Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>

LKML-Reference: <new-submission>

tools/perf/builtin-sched.c +3 -1
index 9e04827..275d79c 100644
@@ -1859,11 +1859,13 @@ static void __cmd_replay(void)
 
 
 static const char * const sched_usage[] = {
-	"perf sched [<options>] {record|latency|replay|trace}",
+	"perf sched [<options>] {record|latency|map|replay|trace}",
 	NULL
 };
 
 static const struct option sched_options[] = {
+	OPT_STRING('i', "input", &input_name, "file",
+		    "input file name"),
 	OPT_BOOLEAN('v', "verbose", &verbose,
 		    "be more verbose (show symbol address, etc)"),
 	OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
#1 lore raw
Quoted 5 lines · Mike Galbraith

perf_counter tools: add --input=file option to builtin-sched.c.

perf sched record passes unparsed args on to perf record, so specifying an output file via perf sched record -o FILE (cmd) just works. Ergo, provide an option to specify input file as well.

Indeed, that's very useful when one keeps older (or different) traces around, renamed from perf.data to something else. It basically pushes the file based 'perf session' concept to perf sched as well.

Quoted 1 line

Also add the missing 'map' command to help.

Applied your fixes/enhancements to tip:perfcounters/core, thanks Mike!

Ingo

#2 lore raw

[tip:perfcounters/core] perf sched: Add --input=file option to builtin-sched.c

In reply to Mike Galbraith
Commit-ID:  4b77a7297795229eca96c41e1709a3c87909fabe
Gitweb:     http://git.kernel.org/tip/4b77a7297795229eca96c41e1709a3c87909fabe
Author:     Mike Galbraith <[email protected]>
AuthorDate: Fri, 18 Sep 2009 08:22:24 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Fri, 18 Sep 2009 08:36:06 +0200

perf sched: Add --input=file option to builtin-sched.c

perf sched record passes unparsed args on to perf record, so specifying an output file via perf sched record -o FILE (cmd) just works. Ergo, provide an option to specify input file as well.

Also add the missing 'map' command to help.

LKML-Reference: <[email protected]>

---
 tools/perf/builtin-sched.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
tools/perf/builtin-sched.c +3 -1
index 9e04827..275d79c 100644
@@ -1859,11 +1859,13 @@ static void __cmd_replay(void)
 
 
 static const char * const sched_usage[] = {
-	"perf sched [<options>] {record|latency|replay|trace}",
+	"perf sched [<options>] {record|latency|map|replay|trace}",
 	NULL
 };
 
 static const struct option sched_options[] = {
+	OPT_STRING('i', "input", &input_name, "file",
+		    "input file name"),
 	OPT_BOOLEAN('v', "verbose", &verbose,
 		    "be more verbose (show symbol address, etc)"),
 	OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,