perf kvm: Fix sample_type manipulation

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 <adrian.hunter@intel.com>
Tested-by: David Ahern <dsahern@gmail.com>
Acked-by: David Ahern <dsahern@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1378496412-2424-3-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Adrian Hunter 2013-09-06 22:40:12 +03:00 committed by Arnaldo Carvalho de Melo
parent 733cd2fe19
commit e71aa28312
1 changed files with 9 additions and 9 deletions

View File

@ -1165,16 +1165,16 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm)
struct perf_event_attr *attr = &pos->attr; struct perf_event_attr *attr = &pos->attr;
/* make sure these *are* set */ /* make sure these *are* set */
attr->sample_type |= PERF_SAMPLE_TID; perf_evsel__set_sample_bit(pos, TID);
attr->sample_type |= PERF_SAMPLE_TIME; perf_evsel__set_sample_bit(pos, TIME);
attr->sample_type |= PERF_SAMPLE_CPU; perf_evsel__set_sample_bit(pos, CPU);
attr->sample_type |= PERF_SAMPLE_RAW; perf_evsel__set_sample_bit(pos, RAW);
/* make sure these are *not*; want as small a sample as possible */ /* make sure these are *not*; want as small a sample as possible */
attr->sample_type &= ~PERF_SAMPLE_PERIOD; perf_evsel__reset_sample_bit(pos, PERIOD);
attr->sample_type &= ~PERF_SAMPLE_IP; perf_evsel__reset_sample_bit(pos, IP);
attr->sample_type &= ~PERF_SAMPLE_CALLCHAIN; perf_evsel__reset_sample_bit(pos, CALLCHAIN);
attr->sample_type &= ~PERF_SAMPLE_ADDR; perf_evsel__reset_sample_bit(pos, ADDR);
attr->sample_type &= ~PERF_SAMPLE_READ; perf_evsel__reset_sample_bit(pos, READ);
attr->mmap = 0; attr->mmap = 0;
attr->comm = 0; attr->comm = 0;
attr->task = 0; attr->task = 0;