lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1914633f-4e81-dede-7d28-813928927b37@huawei.com>
Date:   Fri, 19 May 2023 09:19:43 +0800
From:   Yang Jihong <yangjihong1@...wei.com>
To:     Adrian Hunter <adrian.hunter@...el.com>, <peterz@...radead.org>,
        <mingo@...hat.com>, <acme@...nel.org>, <mark.rutland@....com>,
        <alexander.shishkin@...ux.intel.com>, <jolsa@...nel.org>,
        <namhyung@...nel.org>, <irogers@...gle.com>,
        <anshuman.khandual@....com>, <jesussanp@...gle.com>,
        <linux-perf-users@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 0/4] perf tools: Add printing perf_event_attr `config`
 and `id` symbol in perf_event_attr__fprintf()

Hello,

On 2023/5/16 17:49, Adrian Hunter wrote:
> On 16/05/23 09:55, Yang Jihong wrote:
>> Add printing perf_event_attr `config` and `id` symbol to improve the readability of debugging information.
>>
>> Before:
>>
>>    # perf --debug verbose=2 record -e cycles,cpu-clock,sched:sched_switch,branch-load-misses,r101,mem:0x0 -C 0 true
>>    <SNIP>
>>    ------------------------------------------------------------
>>    perf_event_attr:
>>      size                             136
>>      { sample_period, sample_freq }   4000
>>      sample_type                      IP|TID|TIME|CPU|PERIOD|IDENTIFIER
>>      read_format                      ID
>>      disabled                         1
>>      inherit                          1
>>      freq                             1
>>      sample_id_all                    1
>>      exclude_guest                    1
>>    ------------------------------------------------------------
>>    sys_perf_event_open: pid -1  cpu 0  group_fd -1  flags 0x8 = 5
>>    ------------------------------------------------------------
>>    perf_event_attr:
>>      type                             1
>>      size                             136
>>      { sample_period, sample_freq }   4000
>>      sample_type                      IP|TID|TIME|CPU|PERIOD|IDENTIFIER
>>      read_format                      ID
>>      disabled                         1
>>      inherit                          1
>>      freq                             1
>>      sample_id_all                    1
>>      exclude_guest                    1
>>    ------------------------------------------------------------
>>    sys_perf_event_open: pid -1  cpu 0  group_fd -1  flags 0x8 = 6
>>    ------------------------------------------------------------
>>    perf_event_attr:
>>      type                             2
>>      size                             136
>>      config                           0x143
>>      { sample_period, sample_freq }   1
>>      sample_type                      IP|TID|TIME|CPU|PERIOD|RAW|IDENTIFIER
>>      read_format                      ID
>>      disabled                         1
>>      inherit                          1
>>      sample_id_all                    1
>>      exclude_guest                    1
>>    ------------------------------------------------------------
>>    sys_perf_event_open: pid -1  cpu 0  group_fd -1  flags 0x8 = 7
>>    ------------------------------------------------------------
>>    perf_event_attr:
>>      type                             3
>>      size                             136
>>      config                           0x10005
>>      { sample_period, sample_freq }   4000
>>      sample_type                      IP|TID|TIME|CPU|PERIOD|IDENTIFIER
>>      read_format                      ID
>>      disabled                         1
>>      inherit                          1
>>      freq                             1
>>      sample_id_all                    1
>>      exclude_guest                    1
>>    ------------------------------------------------------------
>>    sys_perf_event_open: pid -1  cpu 0  group_fd -1  flags 0x8 = 9
>>    ------------------------------------------------------------
>>    perf_event_attr:
>>      type                             4
>>      size                             136
>>      config                           0x101
>>      { sample_period, sample_freq }   4000
>>      sample_type                      IP|TID|TIME|CPU|PERIOD|IDENTIFIER
>>      read_format                      ID
>>      disabled                         1
>>      inherit                          1
>>      freq                             1
>>      sample_id_all                    1
>>      exclude_guest                    1
>>    ------------------------------------------------------------
>>    sys_perf_event_open: pid -1  cpu 0  group_fd -1  flags 0x8 = 10
>>    ------------------------------------------------------------
>>    perf_event_attr:
>>      type                             5
>>      size                             136
>>      { sample_period, sample_freq }   1
>>      sample_type                      IP|TID|TIME|CPU|IDENTIFIER
>>      read_format                      ID
>>      disabled                         1
>>      inherit                          1
>>      sample_id_all                    1
>>      exclude_guest                    1
>>      bp_type                          3
>>      { bp_len, config2 }              0x4
>>    ------------------------------------------------------------
>>    <SNIP>
>>
>> After:
>>
>>    # perf --debug verbose=2 record -e cycles,cpu-clock,sched:sched_switch,branch-load-misses,r101,mem:0x0 -C 0 true
>>    <SNIP>
>>    ------------------------------------------------------------
>>    perf_event_attr:
>>      type                             0 (PERF_TYPE_HARDWARE)
>>      size                             136
>>      config                           0 (PERF_COUNT_HW_CPU_CYCLES)
>>      { sample_period, sample_freq }   4000
>>      sample_type                      IP|TID|TIME|CPU|PERIOD|IDENTIFIER
>>      read_format                      ID
>>      disabled                         1
>>      inherit                          1
>>      freq                             1
>>      sample_id_all                    1
>>      exclude_guest                    1
>>    ------------------------------------------------------------
>>    sys_perf_event_open: pid -1  cpu 0  group_fd -1  flags 0x8 = 5
>>    ------------------------------------------------------------
>>    perf_event_attr:
>>      type                             1 (PERF_TYPE_SOFTWARE)
>>      size                             136
>>      config                           0 (PERF_COUNT_SW_CPU_CLOCK)
>>      { sample_period, sample_freq }   4000
>>      sample_type                      IP|TID|TIME|CPU|PERIOD|IDENTIFIER
>>      read_format                      ID
>>      disabled                         1
>>      inherit                          1
>>      freq                             1
>>      sample_id_all                    1
>>      exclude_guest                    1
>>    ------------------------------------------------------------
>>    sys_perf_event_open: pid -1  cpu 0  group_fd -1  flags 0x8 = 6
>>    ------------------------------------------------------------
>>    perf_event_attr:
>>      type                             2 (PERF_TYPE_TRACEPOINT)
>>      size                             136
>>      config                           0x143 (sched:sched_switch)
>>      { sample_period, sample_freq }   1
>>      sample_type                      IP|TID|TIME|CPU|PERIOD|RAW|IDENTIFIER
>>      read_format                      ID
>>      disabled                         1
>>      inherit                          1
>>      sample_id_all                    1
>>      exclude_guest                    1
>>    ------------------------------------------------------------
>>    sys_perf_event_open: pid -1  cpu 0  group_fd -1  flags 0x8 = 7
>>    ------------------------------------------------------------
>>    perf_event_attr:
>>      type                             3 (PERF_TYPE_HW_CACHE)
>>      size                             136
>>      config                           0x10005 (PERF_COUNT_HW_CACHE_RESULT_MISS | PERF_COUNT_HW_CACHE_OP_READ | PERF_COUNT_HW_CACHE_BPU)
>>      { sample_period, sample_freq }   4000
>>      sample_type                      IP|TID|TIME|CPU|PERIOD|IDENTIFIER
>>      read_format                      ID
>>      disabled                         1
>>      inherit                          1
>>      freq                             1
>>      sample_id_all                    1
>>      exclude_guest                    1
>>    ------------------------------------------------------------
>>    sys_perf_event_open: pid -1  cpu 0  group_fd -1  flags 0x8 = 9
>>    ------------------------------------------------------------
>>    perf_event_attr:
>>      type                             4 (PERF_TYPE_RAW)
>>      size                             136
>>      config                           0x101
>>      { sample_period, sample_freq }   4000
>>      sample_type                      IP|TID|TIME|CPU|PERIOD|IDENTIFIER
>>      read_format                      ID
>>      disabled                         1
>>      inherit                          1
>>      freq                             1
>>      sample_id_all                    1
>>      exclude_guest                    1
>>    ------------------------------------------------------------
>>    sys_perf_event_open: pid -1  cpu 0  group_fd -1  flags 0x8 = 10
>>    ------------------------------------------------------------
>>    perf_event_attr:
>>      type                             5 (PERF_TYPE_BREAKPOINT)
>>      size                             136
>>      config                           0
>>      { sample_period, sample_freq }   1
>>      sample_type                      IP|TID|TIME|CPU|IDENTIFIER
>>      read_format                      ID
>>      disabled                         1
>>      inherit                          1
>>      sample_id_all                    1
>>      exclude_guest                    1
>>      bp_type                          3
>>      { bp_len, config2 }              0x4
>>    ------------------------------------------------------------
>>    sys_perf_event_open: pid -1  cpu 0  group_fd -1  flags 0x8 = 11
>>    ------------------------------------------------------------
>>    perf_event_attr:
>>      type                             1 (PERF_TYPE_SOFTWARE)
>>      size                             136
>>      config                           0x9 (PERF_COUNT_SW_DUMMY)
>>      { sample_period, sample_freq }   4000
>>      sample_type                      IP|TID|TIME|CPU|PERIOD|IDENTIFIER
>>      read_format                      ID
>>      inherit                          1
>>      mmap                             1
>>      comm                             1
>>      freq                             1
>>      task                             1
>>      sample_id_all                    1
>>      mmap2                            1
>>      comm_exec                        1
>>      ksymbol                          1
>>      bpf_event                        1
>>    ------------------------------------------------------------
>>    sys_perf_event_open: pid -1  cpu 0  group_fd -1  flags 0x8 = 12
>>    <SNIP>
>>
>> Yang Jihong (4):
>>    perf trace-event-info: Add tracepoint_id_to_name() helper
>>    perf tools: Extend PRINT_ATTRf to support printing of members with a
>>      value of 0
>>    perf tools: Add printing perf_event_attr type symbol in
>>      perf_event_attr__fprintf()
>>    perf tools: Add printing perf_event_attr config symbol in
>>      perf_event_attr__fprintf()
>>
>>   tools/perf/util/perf_event_attr_fprintf.c | 186 ++++++++++++++++++++--
>>   tools/perf/util/trace-event-info.c        |  11 ++
>>   tools/perf/util/trace-event.h             |   6 +
>>   3 files changed, 194 insertions(+), 9 deletions(-)
>>
> 
> Acked-by: Adrian Hunter <adrian.hunter@...el.com>
> 
Thanks for review!

Thanks,
Yang
> .
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ