Skip to content

Commit

Permalink
perf kvm: Fix sample_type manipulation
Browse files Browse the repository at this point in the history
Manipulating the sample_type of an evsel requires the use of:

	perf_evsel__set_sample_bit()
and	perf_evsel__reset_sample_bit()

Signed-off-by: Adrian Hunter <[email protected]>
Tested-by: David Ahern <[email protected]>
Acked-by: David Ahern <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
ahunter6 authored and acmel committed Sep 9, 2013
1 parent 733cd2f commit e71aa28
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tools/perf/builtin-kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1165,16 +1165,16 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm)
struct perf_event_attr *attr = &pos->attr;

/* make sure these *are* set */
attr->sample_type |= PERF_SAMPLE_TID;
attr->sample_type |= PERF_SAMPLE_TIME;
attr->sample_type |= PERF_SAMPLE_CPU;
attr->sample_type |= PERF_SAMPLE_RAW;
perf_evsel__set_sample_bit(pos, TID);
perf_evsel__set_sample_bit(pos, TIME);
perf_evsel__set_sample_bit(pos, CPU);
perf_evsel__set_sample_bit(pos, RAW);
/* make sure these are *not*; want as small a sample as possible */
attr->sample_type &= ~PERF_SAMPLE_PERIOD;
attr->sample_type &= ~PERF_SAMPLE_IP;
attr->sample_type &= ~PERF_SAMPLE_CALLCHAIN;
attr->sample_type &= ~PERF_SAMPLE_ADDR;
attr->sample_type &= ~PERF_SAMPLE_READ;
perf_evsel__reset_sample_bit(pos, PERIOD);
perf_evsel__reset_sample_bit(pos, IP);
perf_evsel__reset_sample_bit(pos, CALLCHAIN);
perf_evsel__reset_sample_bit(pos, ADDR);
perf_evsel__reset_sample_bit(pos, READ);
attr->mmap = 0;
attr->comm = 0;
attr->task = 0;
Expand Down

0 comments on commit e71aa28

Please sign in to comment.