OSDN Git Service

simpleperf: allow recording events in different speed.
authorYabin Cui <yabinc@google.com>
Thu, 3 Aug 2017 22:54:43 +0000 (15:54 -0700)
committerYabin Cui <yabinc@google.com>
Mon, 7 Aug 2017 17:26:22 +0000 (10:26 -0700)
commit20b49f8991b55eda3309a0bbe3c18153376065da
treefeb15dfcdd33637db0ccc06c8cea0299e71bc91a
parentb3734fda74ff55298be8849a9ef91ee8fef17d0d
simpleperf: allow recording events in different speed.

Currently record command interface only allows one sample freq or sample period
for all events. This is not convenient when recording both non tracepoint events
and tracepoint events. This CL allows setting different sample speed for
different events. For example, for "-f 1000 -e cpu-cycles -c 1 sched:sched_switch",
"-f 1000" applies to cpu-cycles, and "-c 1" applies to sched:sched_switch.

It also fixes a bug about trace-offcpu: if "-f 1000 --trace-offcpu" is used,
the sched:sched_switch is be samples with "-f 1000". But we want to sample it
with "-c 1".

Also change the order of options in the help msg of record cmd to make it more
readable. Remove -F option. Because adding it seems not useful.

Bug: http://b/37572306
Test: run simpleperf_unit_test.

Change-Id: Ifdbd27c8f9fec49aade0e0e6ce624d8114042020
simpleperf/cmd_record.cpp
simpleperf/cmd_record_test.cpp
simpleperf/event_selection_set.cpp
simpleperf/event_selection_set.h