[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160203233555.GC12194@redhat.com>
Date: Wed, 3 Feb 2016 21:35:55 -0200
From: Arnaldo Carvalho de Melo <acme@...hat.com>
To: Wang Nan <wangnan0@...wei.com>, Jiri Olsa <jolsa@...hat.com>
Cc: Alexei Starovoitov <ast@...nel.org>,
Brendan Gregg <brendan.d.gregg@...il.com>,
Daniel Borkmann <daniel@...earbox.net>,
"David S. Miller" <davem@...emloft.net>,
He Kuang <hekuang@...wei.com>, Jiri Olsa <jolsa@...nel.org>,
Li Zefan <lizefan@...wei.com>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
Namhyung Kim <namhyung@...nel.org>,
Peter Zijlstra <peterz@...radead.org>, pi3orama@....com,
Will Deacon <will.deacon@....com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 13/54] perf tools: Support perf event alias name
Em Mon, Jan 25, 2016 at 09:56:00AM +0000, Wang Nan escreveu:
> From: He Kuang <hekuang@...wei.com>
>
> This patch is useful when trying to pass a perf event to BPF map.
> Before this patch we are unable to pass an event with config term to
> BPF maps. For example:
>
> # perf record -a -e cycles/no-inherit,period=0x7fffffffffffffff/ \
> -e './test_bpf_map_2.c/maps:pmu_map.event=cycles/no-inherit,period=0x7fffffffffffffff//' ls /
> event syntax error: '..ps:pmu_map.event=cycles/'
> \___ Event not found for map setting
>
> Because those '/' and ',' embarrass parser.
>
> This patch adds new bison rules for specifying an alias name to a perf
> event, which allows cmdline refer to previous defined perf event through
> its name. With this patch user can give alias name to a perf event using
> following cmdline. The above goal can be achieved using:
>
> # perf record -a -e cyc=cycles/no-inherit,period=0x7fffffffffffffff/ \
> -e './test_bpf_map_2.c/maps:pmu_map.event=cyc/' ls /
In another thread Jiri suggested this as a way to get an alias
associated with some event:
-----------------------------------------------------------------
On Tue, Feb 02, 2016 at 05:24:16PM +0100, Andreas Hollmann wrote:
> Jiri, how do you handle raw counters with this python stat__*
> callback? What is the name of the callback?
you can use 'name' term like:
perf stat -e cycles,"cpu/config=0x6530160,name=krava/"
and use following callback in your script:
def stat__krava(cpu, thread, time, val, ena, run):
-----------------------------------------------------------------
Can't we go with that existing syntax? Jiri?
That would be:
# perf record -a -e cycles/no-inherit,period=0x7fffffffffffffff,name=cyc/ \
-e './test_bpf_map_2.c/maps:pmu_map.event=cyc/' ls /
Your way is shorter, but we already have this name=foo method :-\
- Arnaldo
Powered by blists - more mailing lists