From: Arnaldo Carvalho de Melo Date: Wed, 26 Jul 2017 19:52:25 +0000 (-0300) Subject: perf annotate: Do not overwrite perf_sample->weight X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c6c13be76c1fc8a3169dbd29cd1d42af1d64773f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git perf annotate: Do not overwrite perf_sample->weight 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@two.firstfloor.org Acked-by: Andi Kleen Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Milian Wolff Cc: Namhyung Kim Cc: Taeung Song Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-8ev8ufk3lzmvgz37yg9nv3qz@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- 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;