Re: [PATCH v4 06/16] perf tools: Support perf event alias name

pi3orama
2015-12-11T12:13:12Z

发自我的 iPhone

> 在 2015年12月11日，下午8:03，Arnaldo Carvalho de Melo <acme@kernel.org> 写道：
>
> Em Tue, Dec 08, 2015 at 02:25:34AM +0000, Wang Nan escreveu:
>> From: He Kuang <hekuang@huawei.com>
>>
>> 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:
>
> Please add Jiri Olsa to any changes that touches the parser changes.
>
> Can you reword the above phrase? Does it mean something like:
>
> ----
> This patches adds new bison rules for specifying an alias to a perf
> event, which allows referring to this previously defined perf event
> through this alias."
> ----
>
> But then, why would I want this aliasing? The provided examples shows a
> way to obfuscate 'cycles', a perfectly good name, why would one want to
> call it "mypmu"?
>

Sorry. I should put this patch after 7/16 so you won't get confused. Without event
aliasing it is hard to select an event and insert it into a BPF map.

Patch 7/16 would use alias like:

# perf record -e evt=cycles/no-inherit/ -e BPF.c/maps.pmu.event=evt/ ...
So it put cycles/no-inherit/ into that map.

Thank you.