diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-09-13 11:44:29 +0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-09-13 12:22:51 +0400 |
commit | 1fc35b29b4098aa3bf9fc9acb4c1615d0b5dd95d (patch) | |
tree | f4646be85f1f52c5f239ca47930958e85ed119ff /tools/perf/util/parse-events.c | |
parent | b5fae128e41021889777f8ead810cbd2a8b249fc (diff) | |
download | linux-1fc35b29b4098aa3bf9fc9acb4c1615d0b5dd95d.tar.xz |
perf sched: Implement the 'perf sched record' subcommand
Implement the 'perf sched record' subcommand that adds a
default list of events, turns on raw sampling and system-wide
tracing and passes off the rest of the command to perf record.
This is more convenient than having to specify the events all
the time.
Before:
$ perf record -a -R -e sched:sched_switch:r -e sched:sched_stat_wait:r -e sched:sched_stat_sleep:r -e sched:sched_stat_iowait:r -e sched:sched_process_exit:r -e sched:sched_process_fork:r -e sched:sched_wakeup:r -e sched:sched_migrate_task:r -c 1 sleep 1
After:
$ perf sched record -f sleep 1
Also fix an assumption in the event string parser that assumed
that strings passed in can be modified. (In this case they wont
be as they come from a readonly constant section.)
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/parse-events.c')
-rw-r--r-- | tools/perf/util/parse-events.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index d06c66cd358b..034245e46817 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -525,7 +525,8 @@ static enum event_result parse_tracepoint_event(const char **strp, flags = strchr(evt_name, ':'); if (flags) { - *flags = '\0'; + /* split it out: */ + evt_name = strndup(evt_name, flags - evt_name); flags++; } |