[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200903135044.GC713364@krava>
Date: Thu, 3 Sep 2020 15:50:44 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Leo Yan <leo.yan@...aro.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Namhyung Kim <namhyung@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Andi Kleen <ak@...ux.intel.com>,
Ian Rogers <irogers@...gle.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
"Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com>,
Kemeng Shi <shikemeng@...wei.com>,
James Clark <james.clark@....com>,
Wei Li <liwei391@...wei.com>, Al Grant <Al.Grant@....com>,
Will Deacon <will@...nel.org>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
Mike Leach <mike.leach@...aro.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 01/14] perf mem: Search event name with more flexible
path
On Tue, Sep 01, 2020 at 09:38:02AM +0100, Leo Yan wrote:
> Perf tool searches memory event name under the folder
> '/sys/devices/cpu/events/', this leads to the limitation for selection
> memory profiling event which must be under this folder. Thus it's
> impossible to use any other event as memory event which is not under
> this specific folder, e.g. Arm SPE hardware event is not located in
> '/sys/devices/cpu/events/' so it cannot be enabled for memory profiling.
>
> This patch changes to search folder from '/sys/devices/cpu/events/' to
> '/sys/devices', so it give flexibility to find events which can be used
> for memory profiling.
>
> Signed-off-by: Leo Yan <leo.yan@...aro.org>
Acked-by: Jiri Olsa <jolsa@...hat.com>
thanks,
jirka
> ---
> tools/perf/util/mem-events.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c
> index ea0af0bc4314..35c8d175a9d2 100644
> --- a/tools/perf/util/mem-events.c
> +++ b/tools/perf/util/mem-events.c
> @@ -18,8 +18,8 @@ unsigned int perf_mem_events__loads_ldlat = 30;
> #define E(t, n, s) { .tag = t, .name = n, .sysfs_name = s }
>
> struct perf_mem_event perf_mem_events[PERF_MEM_EVENTS__MAX] = {
> - E("ldlat-loads", "cpu/mem-loads,ldlat=%u/P", "mem-loads"),
> - E("ldlat-stores", "cpu/mem-stores/P", "mem-stores"),
> + E("ldlat-loads", "cpu/mem-loads,ldlat=%u/P", "cpu/events/mem-loads"),
> + E("ldlat-stores", "cpu/mem-stores/P", "cpu/events/mem-stores"),
> };
> #undef E
>
> @@ -93,7 +93,7 @@ int perf_mem_events__init(void)
> struct perf_mem_event *e = &perf_mem_events[j];
> struct stat st;
>
> - scnprintf(path, PATH_MAX, "%s/devices/cpu/events/%s",
> + scnprintf(path, PATH_MAX, "%s/devices/%s",
> mnt, e->sysfs_name);
>
> if (!stat(path, &st))
> --
> 2.20.1
>
Powered by blists - more mailing lists