lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-9mgosbqa977h39j4i9ys8t75@git.kernel.org>
Date:   Thu, 7 Jun 2018 01:07:12 -0700
From:   tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     jolsa@...nel.org, hpa@...or.com, linux-kernel@...r.kernel.org,
        acme@...hat.com, namhyung@...nel.org, dsahern@...il.com,
        tglx@...utronix.de, adrian.hunter@...el.com, wangnan0@...wei.com,
        mingo@...nel.org
Subject: [tip:perf/urgent] perf annotate: Stop using symbol_conf.nr_events
 global in symbol__hists()

Commit-ID:  0693f7588a2f2e016e0774102c52ab2494938348
Gitweb:     https://git.kernel.org/tip/0693f7588a2f2e016e0774102c52ab2494938348
Author:     Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Thu, 24 May 2018 17:20:53 -0300
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Mon, 4 Jun 2018 10:28:52 -0300

perf annotate: Stop using symbol_conf.nr_events global in symbol__hists()

Since now we have evsel->evlist->nr_entries in the single place calling
this function, use it.

Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Wang Nan <wangnan0@...wei.com>
Link: https://lkml.kernel.org/n/tip-9mgosbqa977h39j4i9ys8t75@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/util/annotate.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index f11199f0be27..7c194b04a2da 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -21,6 +21,7 @@
 #include "debug.h"
 #include "annotate.h"
 #include "evsel.h"
+#include "evlist.h"
 #include "block-range.h"
 #include "string2.h"
 #include "arch/common.h"
@@ -867,7 +868,7 @@ alloc_cycles_hist:
 	return notes->src->cycles_hist;
 }
 
-static struct annotated_source *symbol__hists(struct symbol *sym)
+static struct annotated_source *symbol__hists(struct symbol *sym, int nr_hists)
 {
 	struct annotation *notes = symbol__annotation(sym);
 
@@ -881,7 +882,7 @@ static struct annotated_source *symbol__hists(struct symbol *sym)
 	if (notes->src->histograms == NULL) {
 alloc_histograms:
 		annotated_source__alloc_histograms(notes->src, symbol__size(sym),
-						   symbol_conf.nr_events);
+						   nr_hists);
 	}
 
 	return notes->src;
@@ -895,7 +896,7 @@ static int symbol__inc_addr_samples(struct symbol *sym, struct map *map,
 
 	if (sym == NULL)
 		return 0;
-	src = symbol__hists(sym);
+	src = symbol__hists(sym, evsel->evlist->nr_entries);
 	if (src == NULL)
 		return -ENOMEM;
 	return __symbol__inc_addr_samples(sym, map, src, evsel->idx, addr, sample);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ