[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160224131427.GB24505@kernel.org>
Date: Wed, 24 Feb 2016 10:14:27 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Jiri Olsa <jolsa@...nel.org>
Cc: lkml <linux-kernel@...r.kernel.org>,
David Ahern <dsahern@...il.com>,
Ingo Molnar <mingo@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Stephane Eranian <eranian@...gle.com>,
Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH 03/15] perf mem: Add -l/--ldlat option
Em Wed, Feb 24, 2016 at 09:46:44AM +0100, Jiri Olsa escreveu:
> Adding -l/--ldlat option to specify desired latency
> for loads event.
>
> Specify 50 as loads event latency:
>
> $ perf mem record -e ldlat-loads -v -l 50 true
> calling: record -W -d -e cpu/mem-loads,ldlat=50/P true
Please update the docs, also I think it is ok to leave it just as
--ldlat, not using the one letter -l, we can do that if this becomes
that frequently used.
- Arnaldo
> Link: http://lkml.kernel.org/n/tip-ec2m0cvivkfs8uhtiv411hfc@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@...nel.org>
> ---
> tools/perf/builtin-mem.c | 1 +
> tools/perf/util/mem-events.c | 17 ++++++++++++++++-
> tools/perf/util/mem-events.h | 1 +
> 3 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c
> index 88aeac9aa1da..9da09e058f4b 100644
> --- a/tools/perf/builtin-mem.c
> +++ b/tools/perf/builtin-mem.c
> @@ -66,6 +66,7 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem)
> OPT_CALLBACK('e', "event", &mem, "event",
> "event selector. use 'perf mem record -e list' to list available events",
> parse_record_events),
> + OPT_UINTEGER('l', "ldlat", &perf_mem_events__loads_ldlat, "mem-loads latency"),
> OPT_INCR('v', "verbose", &verbose,
> "be more verbose (show counter open errors, etc)"),
> OPT_END()
> diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c
> index 0f62e930de13..3772a3a8a6ee 100644
> --- a/tools/perf/util/mem-events.c
> +++ b/tools/perf/util/mem-events.c
> @@ -9,18 +9,33 @@
> #include "mem-events.h"
> #include "debug.h"
>
> +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=30/P", "mem-loads"),
> + E("ldlat-loads", "cpu/mem-loads,ldlat=%u/P", "mem-loads"),
> E("ldlat-stores", "cpu/mem-stores/P", "mem-stores"),
> };
> #undef E
>
> #undef E
>
> +static char mem_loads_name[100];
> +static bool mem_loads_name__init;
> +
> char *perf_mem_events__name(int i)
> {
> + if (i == PERF_MEM_EVENTS__LOAD) {
> + if (!mem_loads_name__init) {
> + mem_loads_name__init = true;
> + scnprintf(mem_loads_name, sizeof(mem_loads_name),
> + perf_mem_events[i].name,
> + perf_mem_events__loads_ldlat);
> + }
> + return mem_loads_name;
> + }
> +
> return (char *) perf_mem_events[i].name;
> }
>
> diff --git a/tools/perf/util/mem-events.h b/tools/perf/util/mem-events.h
> index 2a91b959de62..4ab437291589 100644
> --- a/tools/perf/util/mem-events.h
> +++ b/tools/perf/util/mem-events.h
> @@ -18,6 +18,7 @@ enum {
> };
>
> extern struct perf_mem_event perf_mem_events[PERF_MEM_EVENTS__MAX];
> +extern unsigned int perf_mem_events__loads_ldlat;
>
> int perf_mem_events__parse(const char *str);
> int perf_mem_events__init(void);
> --
> 2.4.3
Powered by blists - more mailing lists