Skip to contentSkip to conversation

perf/urgent fix

GIT PULL New Arnaldo Carvalho de Melo 2 participants 3 messages Oct 22, 2014 – Oct 24, 2014 perf events

lore
Share & tools
lore

Arnaldo Carvalho de Melo

author maintainer
#0 lore raw

Hi Ingo,

Please consider pulling,

- Arnaldo

The following changes since commit 3b10ea7f922b538ba5dcb3d979a6b6b4d07daae2:

Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2014-10-18 09:04:02 +0200)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo

for you to fetch changes up to 9ab1f50876dbb8b962db058259be7aae920d4c25:

perf diff: Add missing hists__init() call at tool start (2014-10-22 16:31:06 -0300)

----------------------------------------------------------------
perf/urgent fix:

* Fix 'perf diff' initialization, calling the recently added hists__init() function so that extra space is allocated per perf_evsel for the hists storage that it also uses, just like report and top. (Kan Liang)

----------------------------------------------------------------
Kan Liang (1):
perf diff: Add missing hists__init() call at tool start

 tools/perf/builtin-diff.c | 5 +++++
 1 file changed, 5 insertions(+)
author maintainer
#1 lore raw

PATCH 1/1 perf diff: Add missing hists__init() call at tool start

From: Kan Liang <[email protected]>

It also uses hists/hist_entries, hists__init() should be called before creating any evsels.

Otherwise no extra space will be allocated per perf_evsel nor this space will be initialized when allocating a new perf_evsel instance, resulting in reads/writes to non allocated space, oops. Fix it.

---
 tools/perf/builtin-diff.c | 5 +++++
 1 file changed, 5 insertions(+)
tools/perf/builtin-diff.c +5 -0
index 8c5c11ca8c53..25114c9a6801 100644
@@ -1142,6 +1142,11 @@ static int data_init(int argc, const char **argv)
 
 int cmd_diff(int argc, const char **argv, const char *prefix __maybe_unused)
 {
+	int ret = hists__init();
+
+	if (ret < 0)
+		return ret;
+
 	perf_config(perf_default_config, NULL);
 
 	argc = parse_options(argc, argv, options, diff_usage, 0);
Signature · 1 line
1.9.3
#2 lore raw
In reply to Arnaldo Carvalho de Melo
Quoted 26 lines · Arnaldo Carvalho de Melo

Hi Ingo,

Please consider pulling,

- Arnaldo

The following changes since commit 3b10ea7f922b538ba5dcb3d979a6b6b4d07daae2:

Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2014-10-18 09:04:02 +0200)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo

for you to fetch changes up to 9ab1f50876dbb8b962db058259be7aae920d4c25:

perf diff: Add missing hists__init() call at tool start (2014-10-22 16:31:06 -0300)

----------------------------------------------------------------
perf/urgent fix:

* Fix 'perf diff' initialization, calling the recently added hists__init() function so that extra space is allocated per perf_evsel for the hists storage that it also uses, just like report and top. (Kan Liang)

Quoted 8 lines

----------------------------------------------------------------
Kan Liang (1):
perf diff: Add missing hists__init() call at tool start

 tools/perf/builtin-diff.c | 5 +++++
 1 file changed, 5 insertions(+)

Pulled, thanks a lot Arnaldo!

Ingo