[PATCH 04/15] perf annotate: Do not overwrite perf_sample->weight
From: Arnaldo Carvalho de Melo
Date: Fri Jul 28 2017 - 16:04:11 EST
From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
When we parse an event we may get a value from the kernel in response to
PERF_SAMPLE_WEIGHT being set in perf_event_attr->sample_type, and if it
is not set, then perf_sample->weight will be set to zero, which should
be ok according to a discussion with Andi Kleen [1]:
1: https://lkml.kernel.org/r/20170724174637.GS3044@xxxxxxxxxxxxxxxxxx
Acked-by: Andi Kleen <andi@xxxxxxxxxxxxxx>
Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Milian Wolff <milian.wolff@xxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Taeung Song <treeze.taeung@xxxxxxxxx>
Cc: Wang Nan <wangnan0@xxxxxxxxxx>
Link: http://lkml.kernel.org/n/tip-8ev8ufk3lzmvgz37yg9nv3qz@xxxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/builtin-annotate.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 6db782dfce96..658c920d74b9 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -177,8 +177,6 @@ static int perf_evsel__add_sample(struct perf_evsel *evsel,
*/
process_branch_stack(sample->branch_stack, al, sample);
- sample->weight = 1;
-
he = hists__add_entry(hists, al, NULL, NULL, NULL, sample, true);
if (he == NULL)
return -ENOMEM;
--
2.9.4