Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1292171

Re: [PATCH v5 08/14] perf tools: Support perf event alias name

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 08/14] perf tools: Support perf event alias name
Date 2015-12-15 14:20 +0100
Message-ID <qFXGi-4AF-19@gated-at.bofh.it> (permalink)
References <qFyRz-4Xv-7@gated-at.bofh.it> <qFyRA-4Xv-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Dec 14, 2015 at 10:39:17AM +0000, Wang Nan wrote:
> From: He Kuang <hekuang@huawei.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.

we already have 'name=' term, but it's only for pmu events,
so I think your solution is better

> 
> 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 /
> 

so this alias should only help as a quick pointer
to setup the record session, right?

I'm not sure we want to see it as a part of name being stored
to perf.data and displayed by perf report and stat

  $ ./perf stat -e cyc=cycles ls

    Performance counter stats for 'ls':

         2,638,646      cyc=cycles                                                  

       0.001111614 seconds time elapsed

but I guess when you probably have a reason to use that
you want to see it in your report..  just a thought ;-)

anyway acking the change

Acked-by: Jiri Olsa <jolsa@kernel.org>

thanks,
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5 00/14] perf tools: BPF related update and other improvements Wang Nan <wangnan0@huawei.com> - 2015-12-14 11:50 +0100
  [PATCH v5 08/14] perf tools: Support perf event alias name Wang Nan <wangnan0@huawei.com> - 2015-12-14 11:50 +0100
    Re: [PATCH v5 08/14] perf tools: Support perf event alias name Jiri Olsa <jolsa@redhat.com> - 2015-12-15 14:20 +0100
      Re: [PATCH v5 08/14] perf tools: Support perf event alias name "Wangnan (F)" <wangnan0@huawei.com> - 2015-12-16 03:00 +0100
  [PATCH v5 10/14] perf tools: Enable indices setting syntax for BPF maps Wang Nan <wangnan0@huawei.com> - 2015-12-14 11:50 +0100
    Re: [PATCH v5 10/14] perf tools: Enable indices setting syntax for  BPF maps Jiri Olsa <jolsa@redhat.com> - 2015-12-15 14:50 +0100
      Re: [PATCH v5 10/14] perf tools: Enable indices setting syntax for  BPF maps "Wangnan (F)" <wangnan0@huawei.com> - 2015-12-16 03:10 +0100
        Re: [PATCH v5 10/14] perf tools: Enable indices setting syntax for  BPF maps Jiri Olsa <jolsa@redhat.com> - 2015-12-16 09:00 +0100
    Re: [PATCH v5 10/14] perf tools: Enable indices setting syntax for  BPF maps Jiri Olsa <jolsa@redhat.com> - 2015-12-16 12:30 +0100
  [PATCH v5 05/14] perf tools: Enable BPF object configure syntax Wang Nan <wangnan0@huawei.com> - 2015-12-14 11:50 +0100
    Re: [PATCH v5 05/14] perf tools: Enable BPF object configure syntax Jiri Olsa <jolsa@redhat.com> - 2015-12-15 14:20 +0100
  [PATCH v5 01/14] perf tests: Fix incorrect free and false TEST_OK result Wang Nan <wangnan0@huawei.com> - 2015-12-14 11:50 +0100
  [PATCH v5 09/14] perf tools: Support setting different slots in a BPF map separately Wang Nan <wangnan0@huawei.com> - 2015-12-14 11:50 +0100
  [PATCH v5 13/14] perf tools: Always give options even it not compiled Wang Nan <wangnan0@huawei.com> - 2015-12-14 11:50 +0100
    Re: [PATCH v5 13/14] perf tools: Always give options even it not  compiled Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-14 17:10 +0100
    [tip:perf/core] perf tools: Make options always available,   even if required libs not linked tip-bot for Wang Nan <tipbot@zytor.com> - 2015-12-18 10:00 +0100

csiph-web