From: Adrian Hunter Date: Fri, 6 Sep 2013 19:40:12 +0000 (+0300) Subject: perf kvm: Fix sample_type manipulation X-Git-Tag: firefly_0821_release~176^2~5036^2~52^2~2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e71aa28312b208a14cd87fa61e941ac8c85072f4;p=firefly-linux-kernel-4.4.55.git 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 Tested-by: David Ahern Acked-by: David Ahern Cc: David Ahern Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Mike Galbraith Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/1378496412-2424-3-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c index 47b35407c2f2..935d52216c89 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools/perf/builtin-kvm.c @@ -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;