mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matt Fleming <matt@console-pimps.org>
To: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>, Jiri Olsa <jolsa@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Andi Kleen <andi@firstfloor.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Matt Fleming <matt.fleming@intel.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 01/11] perf stat: Fix AGGR_CORE segfault on multi-socket system
Date: Wed,  1 Oct 2014 15:36:22 +0100	[thread overview]
Message-ID: <1412174192-7010-2-git-send-email-matt@console-pimps.org> (raw)
In-Reply-To: <1412174192-7010-1-git-send-email-matt@console-pimps.org>

From: Matt Fleming <matt.fleming@intel.com>

When printing the stats associated with a counter in AGGR_MODE mode, the
'cpu' argument represents an encoded socket and core_id, not a 'cpu'.
Using it as an index into the any of the *_stats[MAX_NR_CPUS] arrays
generates a SIGSEGV if the encoded socket id is non-zero.

Follow the AGGR_GLOBAL case and reset the cpu index to 0.

Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
---
 tools/perf/builtin-stat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index b22c62f80078..53bd6b729498 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -965,7 +965,7 @@ static void abs_printout(int id, int nr, struct perf_evsel *evsel, double avg)
 
 	aggr_printout(evsel, id, nr);
 
-	if (aggr_mode == AGGR_GLOBAL)
+	if (aggr_mode == AGGR_GLOBAL || aggr_mode == AGGR_CORE)
 		cpu = 0;
 
 	fprintf(output, fmt, avg, csv_sep);
-- 
1.9.3


  reply	other threads:[~2014-10-01 14:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-01 14:36 [PATCH v2 00/11] perf: Intel Cache QoS Monitoring support Matt Fleming
2014-10-01 14:36 ` Matt Fleming [this message]
2014-10-01 17:08   ` [PATCH 01/11] perf stat: Fix AGGR_CORE segfault on multi-socket system Arnaldo Carvalho de Melo
2014-10-01 20:37     ` Matt Fleming
2014-10-01 14:36 ` [PATCH v2 02/11] perf tools: Refactor unit and scale function parameters Matt Fleming
2014-10-01 17:09   ` Arnaldo Carvalho de Melo
2014-10-01 14:36 ` [PATCH 03/11] perf tools: Parse event per-package info files Matt Fleming
2014-10-01 14:36 ` [PATCH 04/11] perf: Make perf_cgroup_from_task() global Matt Fleming
2014-10-01 14:36 ` [PATCH 05/11] perf: Add ->count() function to read per-package counters Matt Fleming
2014-10-01 14:36 ` [PATCH 06/11] perf: Move cgroup init before PMU ->event_init() Matt Fleming
2014-10-01 14:36 ` [PATCH 07/11] x86: Add support for Intel Cache QoS Monitoring (CQM) detection Matt Fleming
2014-10-01 14:36 ` [PATCH v2 08/11] perf/x86/intel: Add Intel Cache QoS Monitoring support Matt Fleming
2014-10-01 14:36 ` [PATCH 09/11] perf/x86/intel: Implement LRU monitoring ID allocation for CQM Matt Fleming
2014-10-01 14:36 ` [PATCH v2 10/11] perf/x86/intel: Support task events with Intel CQM Matt Fleming
2014-10-01 14:36 ` [PATCH 11/11] perf/x86/intel: Perform rotation on Intel CQM RMIDs Matt Fleming
2014-10-01 21:42 ` [PATCH v2 00/11] perf: Intel Cache QoS Monitoring support Andi Kleen
2014-10-02  6:51   ` Matt Fleming
2014-10-02  8:41     ` Peter Zijlstra
2014-10-02 15:04     ` Andi Kleen
2014-10-02 17:49       ` Matt Fleming
  -- strict thread matches above, loose matches on Subject: below --
2014-09-24 14:04 [PATCH " Matt Fleming
2014-09-24 14:04 ` [PATCH 01/11] perf stat: Fix AGGR_CORE segfault on multi-socket system Matt Fleming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1412174192-7010-2-git-send-email-matt@console-pimps.org \
    --to=matt@console-pimps.org \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=andi@firstfloor.org \
    --cc=hpa@zytor.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt.fleming@intel.com \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®