public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: gregkh@linuxfoundation•org (gregkh at linuxfoundation.org)
To: linux-arm-kernel@lists•infradead.org
Subject: Patch "perf evsel: Store ids for events with their own cpus perf_event__synthesize_event_update_cpus" has been added to the 4.18-stable tree
Date: Sat, 10 Nov 2018 10:49:48 -0800	[thread overview]
Message-ID: <1541875788165243@kroah.com> (raw)


This is a note to let you know that I've just added the patch titled

    perf evsel: Store ids for events with their own cpus perf_event__synthesize_event_update_cpus

to the 4.18-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     perf-evsel-store-ids-for-events-with-their-own-cpus-perf_event__synthesize_event_update_cpus.patch
and it can be found in the queue-4.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger•kernel.org> know about it.


>From foo at baz Sat Nov 10 10:48:43 PST 2018
From: Jiri Olsa <jolsa@redhat•com>
Date: Wed, 3 Oct 2018 23:20:52 +0200
Subject: perf evsel: Store ids for events with their own cpus perf_event__synthesize_event_update_cpus

From: Jiri Olsa <jolsa@redhat•com>

[ Upstream commit 4ab8455f8bd83298bf7f67ab9357e3b1cc765c7d ]

John reported crash when recording on an event under PMU with cpumask defined:

  root at localhost:~# ./perf_debug_ record -e armv8_pmuv3_0/br_mis_pred/ sleep 1
  perf: Segmentation fault
  Obtained 9 stack frames.
  ./perf_debug_() [0x4c5ef8]
  [0xffff82ba267c]
  ./perf_debug_() [0x4bc5a8]
  ./perf_debug_() [0x419550]
  ./perf_debug_() [0x41a928]
  ./perf_debug_() [0x472f58]
  ./perf_debug_() [0x473210]
  ./perf_debug_() [0x4070f4]
  /lib/aarch64-linux-gnu/libc.so.6(__libc_start_main+0xe0) [0xffff8294c8a0]
  Segmentation fault (core dumped)

We synthesize an update event that needs to touch the evsel id array, which is
not defined at that time. Fixing this by forcing the id allocation for events
with their own cpus.

Reported-by: John Garry <john.garry@huawei•com>
Signed-off-by: Jiri Olsa <jolsa@kernel•org>
Tested-by: John Garry <john.garry@huawei•com>
Cc: Alexander Shishkin <alexander.shishkin@linux•intel.com>
Cc: Andi Kleen <ak@linux•intel.com>
Cc: Mark Rutland <mark.rutland@arm•com>
Cc: Namhyung Kim <namhyung@kernel•org>
Cc: Peter Zijlstra <peterz@infradead•org>
Cc: Will Deacon <will.deacon@arm•com>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linuxarm at huawei.com
Fixes: bfd8f72c2778 ("perf record: Synthesize unit/scale/... in event update")
Link: http://lkml.kernel.org/r/20181003212052.GA32371 at krava
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat•com>
Signed-off-by: Sasha Levin <sashal@kernel•org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation•org>
---
 tools/perf/builtin-report.c |    1 +
 tools/perf/util/evsel.c     |    3 +++
 2 files changed, 4 insertions(+)

--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -981,6 +981,7 @@ int cmd_report(int argc, const char **ar
 			.id_index	 = perf_event__process_id_index,
 			.auxtrace_info	 = perf_event__process_auxtrace_info,
 			.auxtrace	 = perf_event__process_auxtrace,
+			.event_update	 = perf_event__process_event_update,
 			.feature	 = process_feature_event,
 			.ordered_events	 = true,
 			.ordering_requires_timestamps = true,
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -1078,6 +1078,9 @@ void perf_evsel__config(struct perf_evse
 		attr->exclude_user   = 1;
 	}
 
+	if (evsel->own_cpus)
+		evsel->attr.read_format |= PERF_FORMAT_ID;
+
 	/*
 	 * Apply event specific term settings,
 	 * it overloads any global configuration.


Patches currently in stable-queue which might be from jolsa at redhat.com are

queue-4.18/perf-vendor-events-intel-fix-wrong-filter_band-values-for-uncore-events.patch
queue-4.18/perf-tools-fix-use-of-alternatives-to-find-jdir.patch
queue-4.18/perf-evsel-store-ids-for-events-with-their-own-cpus-perf_event__synthesize_event_update_cpus.patch

                 reply	other threads:[~2018-11-10 18:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1541875788165243@kroah.com \
    --to=gregkh@linuxfoundation$(echo .)org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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