1. 26 3月, 2022 6 次提交
  2. 25 3月, 2022 4 次提交
    • A
      tools headers cpufeatures: Sync with the kernel sources · d16d30f4
      Arnaldo Carvalho de Melo 提交于
      To pick the changes from:
      
        fa31a4d6 ("x86/cpufeatures: Put the AMX macros in the word 18 block")
        7b8f40b3 ("x86/cpu: Add definitions for the Intel Hardware Feedback Interface")
      
      This only causes these perf files to be rebuilt:
      
        CC       /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o
        CC       /tmp/build/perf/bench/mem-memset-x86-64-asm.o
      
      And addresses this perf build warning:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h'
        diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
      
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Jim Mattson <jmattson@google.com>
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
      Link: https://lore.kernel.org/lkml/YjzZPxdyLjf76gM+@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d16d30f4
    • A
      tools headers cpufeatures: Sync with the kernel sources · 1efe4cbd
      Arnaldo Carvalho de Melo 提交于
      To pick the changes in:
      
        7c1ef591 ("x86/cpufeatures: Re-enable ENQCMD")
      
      That causes only these 'perf bench' objects to rebuild:
      
        CC       /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o
        CC       /tmp/build/perf/bench/mem-memset-x86-64-asm.o
      
      And addresses these perf build warnings:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/disabled-features.h' differs from latest version at 'arch/x86/include/asm/disabled-features.h'
        diff -u tools/arch/x86/include/asm/disabled-features.h arch/x86/include/asm/disabled-features.h
      
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Link: https://lore.kernel.org/lkml/YjzX+PknzGoKaGMX@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1efe4cbd
    • T
      perf stat: Fix forked applications enablement of counters · d0a0a511
      Thomas Richter 提交于
      I have run into the following issue:
      
       # perf stat -a -e new_pmu/INSTRUCTION_7/ --  mytest -c1 7
      
       Performance counter stats for 'system wide':
      
                       0      new_pmu/INSTRUCTION_7/
      
             0.000366428 seconds time elapsed
       #
      
      The new PMU for s390 counts the execution of certain CPU instructions.
      The root cause is the extremely small run time of the mytest program. It
      just executes some assembly instructions and then exits.
      
      In above invocation the instruction is executed exactly one time (-c1
      option). The PMU is expected to report this one time execution by a
      counter value of one, but fails to do so in some cases, not all.
      
      Debugging reveals the invocation of the child process is done
      *before* the counter events are installed and enabled.
      
      Tracing reveals that sometimes the child process starts and exits before
      the event is installed on all CPUs. The more CPUs the machine has, the
      more often this miscount happens.
      
      Fix this by reversing the start of the work load after the events have
      been installed on the specified CPUs. Now the comment also matches the
      code.
      
      Output after:
      
       # perf stat -a -e new_pmu/INSTRUCTION_7/ --  mytest -c1 7
      
       Performance counter stats for 'system wide':
      
                       1      new_pmu/INSTRUCTION_7/
      
             0.000366428 seconds time elapsed
       #
      
      Now the correct result is reported rock solid all the time regardless
      how many CPUs are online.
      
      Reviewers notes:
      
      Jiri:
      
      Right, without -a the event has enable_on_exec so the race does not
      matter, but it's a problem for system wide with fork.
      
      Namhyung:
      
      Agreed. Also we may move the enable_counters() and the clock code out of
      the if block to be shared with the else block.
      
      Fixes: acf28922 ("perf stat: Use perf_evlist__prepare/start_workload()")
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NSumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Sven Schnelle <svens@linux.ibm.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Link: https://lore.kernel.org/r/20220317155346.577384-1-tmricht@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d0a0a511
    • A
      tools arch x86: Sync the msr-index.h copy with the kernel sources · 61726144
      Arnaldo Carvalho de Melo 提交于
      To pick up the changes from these csets:
      
        7b8f40b3 ("x86/cpu: Add definitions for the Intel Hardware Feedback Interface")
      
      That cause no changes to tooling:
      
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > before
        $ cp arch/x86/include/asm/msr-index.h tools/arch/x86/include/asm/msr-index.h
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > after
        $ diff -u before after
        $
      
      Just silences this perf build warning:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/msr-index.h' differs from latest version at 'arch/x86/include/asm/msr-index.h'
        diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h
      
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
      Link: https://lore.kernel.org/lkml/YjzVt8CjAORAsTCo@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      61726144
  3. 23 3月, 2022 8 次提交
    • K
      perf evsel: Make evsel__env() always return a valid env · 7b830875
      Kim Phillips 提交于
      It's possible to have an evsel and evsel->evlist populated without
      an evsel->evlist->env, when, e.g., cmd_record is in its error path.
      
      Future patches will add support for evsel__open_strerror to be able
      to customize error messaging based on perf_env__{arch,cpuid}, so
      let's have evsel__env return &perf_env instead of NULL in that case.
      Reviewed-by: NKajol Jain <kjain@linux.ibm.com>
      Signed-off-by: NKim Phillips <kim.phillips@amd.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Joao Martins <joao.m.martins@oracle.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Link: https://lore.kernel.org/r/20211004214114.188477-1-kim.phillips@amd.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7b830875
    • C
      perf build-id: Fix spelling mistake "Cant" -> "Can't" · 011899cc
      Colin Ian King 提交于
      There is a spelling mistake in a pr_err message. Fix it.
      Signed-off-by: NColin Ian King <colin.i.king@gmail.com>
      Acked-by: NIan Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: kernel-janitors@vger.kernel.org
      Link: https://lore.kernel.org/r/20220316232452.53062-1-colin.i.king@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      011899cc
    • C
      perf header: Fix spelling mistake "could't" -> "couldn't" · ccbc9df9
      Colin Ian King 提交于
      There is a spelling mistake in a pr_debug2 message. Fix it.
      Signed-off-by: NColin Ian King <colin.i.king@gmail.com>
      Acked-by: NIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: kernel-janitors@vger.kernel.org
      Link: https://lore.kernel.org/r/20220316232212.52820-1-colin.i.king@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ccbc9df9
    • K
      perf script: Add 'brstackinsnlen' for branch stacks · 6f680c6a
      Kan Liang 提交于
      When analyzing with 'perf script', it's useful to understand the
      captured instruction and the next sequential instruction.
      
      To calculate the address of the next sequential instruction, the length
      of the captured instruction is required.
      
      For example, you can’t know the next sequential instruction after an
      unconditional branch unless you calculate that based on its length.
      
      For branch stacks, 'perf script' only prints the instruction bytes with
      'brstackinsn', but lacks the instruction length.
      
      Add 'brstackinsnlen' to print the instruction length.
      
        $ perf script -F ip,brstackinsn,brstackinsnlen --xed
           7fa555be8f75
              _start:
              00007fa555be8090    mov %rsp, %rdi              ilen: 3
              00007fa555be8093    callq  0x7fa555be8ea0       ilen: 5 # PRED 102 cycles [102] 0.02 IPC
              _dl_start+38:
              00007fa555be8ec6    movq  %rdx,0x227853(%rip)   ilen: 7
              00007fa555be8ecd    leaq  0x227f94(%rip),%rdx   ilen: 7
      Signed-off-by: NKan Liang <kan.liang@linux.intel.com>
      Cc: Ahmad Yasin <ahmad.yasin@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/1647871212-184070-1-git-send-email-kan.liang@linux.intel.com
      [ Added the new field to tools/perf/Documentation/perf-script.txt ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6f680c6a
    • I
      perf parse-events: Move slots only with topdown · bc355822
      Ian Rogers 提交于
      If slots isn't with a topdown event then moving it is unnecessary. For
      example {instructions, slots} is re-ordered:
      
        $ perf stat -e '{instructions,slots}' -a sleep 1
      
         Performance counter stats for 'system wide':
      
               936,600,825      slots
               144,440,968      instructions
      
               1.006061423 seconds time elapsed
      
      Which can break tools expecting the command line order to match the
      printed order. It is necessary to move the slots event first when it
      appears with topdown events. Add extra checking so that the slots event
      is only moved in the case of there being a topdown event like:
      
        $ perf stat -e '{instructions,slots,topdown-fe-bound}' -a sleep 1
      
         Performance counter stats for 'system wide':
      
                2427568570      slots
                 300927614      instructions
                 551021649      topdown-fe-bound
      
               1.001771803 seconds time elapsed
      
      Fixes: 94dbfd67 ("perf parse-events: Architecture specific leader override")
      Reported-by: NKan Liang <kan.liang@linux.intel.com>
      Signed-off-by: NIan Rogers <irogers@google.com>
      Tested-by: NKan Liang <kan.liang@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20220321223344.1034479-1-irogers@google.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      bc355822
    • N
      perf ftrace latency: Update documentation · feff0839
      Namhyung Kim 提交于
      Add description of 'perf ftrace latency' subcommand.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Changbin Du <changbin.du@gmail.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: https://lore.kernel.org/r/20220321234609.90455-2-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      feff0839
    • N
      perf ftrace latency: Add -n/--use-nsec option · 84005bb6
      Namhyung Kim 提交于
      Sometimes we want to see nano-second granularity.
      
        $ sudo perf ftrace latency -T dput -a sleep 1
        #   DURATION     |      COUNT | GRAPH                          |
             0 - 1    us |    2098375 | #############################  |
             1 - 2    us |         61 |                                |
             2 - 4    us |         33 |                                |
             4 - 8    us |         13 |                                |
             8 - 16   us |        124 |                                |
            16 - 32   us |        123 |                                |
            32 - 64   us |          1 |                                |
            64 - 128  us |          0 |                                |
           128 - 256  us |          1 |                                |
           256 - 512  us |          0 |                                |
           512 - 1024 us |          0 |                                |
             1 - 2    ms |          0 |                                |
             2 - 4    ms |          0 |                                |
             4 - 8    ms |          0 |                                |
             8 - 16   ms |          0 |                                |
            16 - 32   ms |          0 |                                |
            32 - 64   ms |          0 |                                |
            64 - 128  ms |          0 |                                |
           128 - 256  ms |          0 |                                |
           256 - 512  ms |          0 |                                |
           512 - 1024 ms |          0 |                                |
             1 - ...   s |          0 |                                |
      
        $ sudo perf ftrace latency -T dput -a -n sleep 1
        #   DURATION     |      COUNT | GRAPH                          |
             0 - 1    us |          0 |                                |
             1 - 2    ns |          0 |                                |
             2 - 4    ns |          0 |                                |
             4 - 8    ns |          0 |                                |
             8 - 16   ns |          0 |                                |
            16 - 32   ns |          0 |                                |
            32 - 64   ns |          0 |                                |
            64 - 128  ns |    1163434 | ##############                 |
           128 - 256  ns |     914102 | #############                  |
           256 - 512  ns |        884 |                                |
           512 - 1024 ns |        613 |                                |
             1 - 2    us |         31 |                                |
             2 - 4    us |         17 |                                |
             4 - 8    us |          7 |                                |
             8 - 16   us |        123 |                                |
            16 - 32   us |         83 |                                |
            32 - 64   us |          0 |                                |
            64 - 128  us |          0 |                                |
           128 - 256  us |          0 |                                |
           256 - 512  us |          0 |                                |
           512 - 1024 us |          0 |                                |
             1 - ...  ms |          0 |                                |
      
      Committer testing:
      
      Testing it with BPF:
      
        # perf ftrace latency -b -n -T dput -a sleep 1
        #   DURATION     |      COUNT | GRAPH                                          |
             0 - 1    us |          0 |                                                |
             1 - 2    ns |          0 |                                                |
             2 - 4    ns |          0 |                                                |
             4 - 8    ns |          0 |                                                |
             8 - 16   ns |          0 |                                                |
            16 - 32   ns |          0 |                                                |
            32 - 64   ns |          0 |                                                |
            64 - 128  ns |          0 |                                                |
           128 - 256  ns |     823489 | #############################################  |
           256 - 512  ns |       3232 |                                                |
           512 - 1024 ns |         51 |                                                |
             1 - 2    us |        172 |                                                |
             2 - 4    us |          9 |                                                |
             4 - 8    us |          0 |                                                |
             8 - 16   us |          2 |                                                |
            16 - 32   us |          0 |                                                |
            32 - 64   us |          0 |                                                |
            64 - 128  us |          0 |                                                |
           128 - 256  us |          0 |                                                |
           256 - 512  us |          0 |                                                |
           512 - 1024 us |          0 |                                                |
             1 - ...  ms |          0 |                                                |
        [root@quaco ~]# strace -e bpf perf ftrace latency -b -n -T dput -a sleep 1
        bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_SOCKET_FILTER, insn_cnt=2, insns=0x7ffe2bd574f0, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=0, func_info_rec_size=0, func_info=NULL, func_info_cnt=0, line_info_rec_size=0, line_info=NULL, line_info_cnt=0, attach_btf_id=0, attach_prog_fd=0, fd_array=NULL}, 144) = 3
        bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0\20\0\0\0\20\0\0\0\5\0\0\0\1\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=45, btf_log_size=0, btf_log_level=0}, 28) = 3
        bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0000\0\0\0000\0\0\0\t\0\0\0\1\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=81, btf_log_size=0, btf_log_level=0}, 28) = 3
        bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\08\0\0\08\0\0\0\t\0\0\0\0\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=89, btf_log_size=0, btf_log_level=0}, 28) = 3
        bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0\f\0\0\0\f\0\0\0\7\0\0\0\1\0\0\0\0\0\0\20"..., btf_log_buf=NULL, btf_size=43, btf_log_size=0, btf_log_level=0}, 28) = 3
        bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0000\0\0\0000\0\0\0\t\0\0\0\1\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=81, btf_log_size=0, btf_log_level=0}, 28) = 3
        bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0000\0\0\0000\0\0\0\5\0\0\0\0\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=77, btf_log_size=0, btf_log_level=0}, 28) = 3
        bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0(\0\0\0(\0\0\0\5\0\0\0\0\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=69, btf_log_size=0, btf_log_level=0}, 28) = -1 EINVAL (Invalid argument)
        bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0<\3\0\0<\3\0\0\362\3\0\0\0\0\0\0\0\0\0\2"..., btf_log_buf=NULL, btf_size=1862, btf_log_size=0, btf_log_level=0}, 28) = 3
        bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_ARRAY, key_size=4, value_size=4, max_entries=1, map_flags=BPF_F_MMAPABLE, inner_map_fd=0, map_name="", map_ifindex=0, btf_fd=0, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0, map_extra=0}, 72) = 4
        bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_SOCKET_FILTER, insn_cnt=2, insns=0x7ffe2bd571c0, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="test", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=0, func_info_rec_size=0, func_info=NULL, func_info_cnt=0, line_info_rec_size=0, line_info=NULL, line_info_cnt=0, attach_btf_id=0, attach_prog_fd=0, fd_array=NULL}, 144) = 4
        bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_HASH, key_size=8, value_size=8, max_entries=10000, map_flags=0, inner_map_fd=0, map_name="functime", map_ifindex=0, btf_fd=3, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0, map_extra=0}, 72) = 4
        bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_HASH, key_size=4, value_size=1, max_entries=1, map_flags=0, inner_map_fd=0, map_name="cpu_filter", map_ifindex=0, btf_fd=3, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0, map_extra=0}, 72) = 5
        bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_HASH, key_size=4, value_size=1, max_entries=1, map_flags=0, inner_map_fd=0, map_name="task_filter", map_ifindex=0, btf_fd=3, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0, map_extra=0}, 72) = 7
        bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_PERCPU_ARRAY, key_size=4, value_size=8, max_entries=22, map_flags=0, inner_map_fd=0, map_name="latency", map_ifindex=0, btf_fd=3, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0, map_extra=0}, 72) = 8
        bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_ARRAY, key_size=4, value_size=32, max_entries=1, map_flags=0, inner_map_fd=0, map_name="", map_ifindex=0, btf_fd=0, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0, map_extra=0}, 72) = 9
        bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_SOCKET_FILTER, insn_cnt=5, insns=0x7ffe2bd57220, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=0, func_info_rec_size=0, func_info=NULL, func_info_cnt=0, line_info_rec_size=0, line_info=NULL, line_info_cnt=0, attach_btf_id=0, attach_prog_fd=0, fd_array=NULL}, 144) = 10
        bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_ARRAY, key_size=4, value_size=16, max_entries=1, map_flags=BPF_F_MMAPABLE, inner_map_fd=0, map_name="func_lat.bss", map_ifindex=0, btf_fd=3, btf_key_type_id=0, btf_value_type_id=33, btf_vmlinux_value_type_id=0, map_extra=0}, 72) = 9
        bpf(BPF_MAP_UPDATE_ELEM, {map_fd=9, key=0x7ffe2bd57330, value=0x7f9a5fc39000, flags=BPF_ANY}, 144) = 0
        bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_KPROBE, insn_cnt=42, insns=0x113daf0, license="", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(5, 16, 13), prog_flags=0, prog_name="func_begin", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=3, func_info_rec_size=8, func_info=0x113fb70, func_info_cnt=1, line_info_rec_size=16, line_info=0x113fb90, line_info_cnt=21, attach_btf_id=0, attach_prog_fd=0, fd_array=NULL}, 144) = 10
        bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_KPROBE, insn_cnt=124, insns=0x113d360, license="", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(5, 16, 13), prog_flags=0, prog_name="func_end", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=3, func_info_rec_size=8, func_info=0x113fcf0, func_info_cnt=1, line_info_rec_size=16, line_info=0x1139770, line_info_cnt=60, attach_btf_id=0, attach_prog_fd=0, fd_array=NULL}, 144) = 11
        bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_TRACEPOINT, insn_cnt=2, insns=0x7ffe2bd57150, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=0, func_info_rec_size=0, func_info=NULL, func_info_cnt=0, line_info_rec_size=0, line_info=NULL, line_info_cnt=0, attach_btf_id=0, attach_prog_fd=0, fd_array=NULL}, 144) = 13
        bpf(BPF_LINK_CREATE, {link_create={prog_fd=13, target_fd=-1, attach_type=BPF_PERF_EVENT, flags=0}}, 144) = -1 EBADF (Bad file descriptor)
        bpf(BPF_LINK_CREATE, {link_create={prog_fd=10, target_fd=12, attach_type=BPF_PERF_EVENT, flags=0}}, 144) = 13
        bpf(BPF_LINK_CREATE, {link_create={prog_fd=11, target_fd=14, attach_type=BPF_PERF_EVENT, flags=0}}, 144) = 15
        --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=130075, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0
        #   DURATION     |      COUNT | GRAPH                                          |
             0 - 1    us |          0 |                                                |
             1 - 2    ns |          0 |                                                |
             2 - 4    ns |          0 |                                                |
             4 - 8    ns |          0 |                                                |
             8 - 16   ns |          0 |                                                |
            16 - 32   ns |          0 |                                                |
            32 - 64   ns |          0 |                                                |
            64 - 128  ns |          0 |                                                |
           128 - 256  ns |      42519 | ###########################################    |
           256 - 512  ns |       2140 | ##                                             |
           512 - 1024 ns |         54 |                                                |
             1 - 2    us |         16 |                                                |
             2 - 4    us |         10 |                                                |
             4 - 8    us |          0 |                                                |
             8 - 16   us |          0 |                                                |
            16 - 32   us |          0 |                                                |
            32 - 64   us |          0 |                                                |
            64 - 128  us |          0 |                                                |
           128 - 256  us |          0 |                                                |
           256 - 512  us |          0 |                                                |
           512 - 1024 us |          0 |                                                |
             1 - ...  ms |          0 |                                                |
        +++ exited with 0 +++
        #
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Changbin Du <changbin.du@gmail.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: https://lore.kernel.org/r/20220321234609.90455-1-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      84005bb6
    • J
      perf tools: Fix version kernel tag · 7572733b
      John Garry 提交于
      Generating the version kernel tag relies on "git describe" command to
      get the latest Linus kernel tag.
      
      However, when working from clones of Linus' git we may not have the latest
      tag. For example, when working on Arnaldo's acme.git, we can have this:
      
        $ git branch
        perf/core
        $ head -n 5 ../../Makefile  | tail -n 4
        VERSION = 5
        PATCHLEVEL = 17
        SUBLEVEL = 0
        EXTRAVERSION = -rc3
        $ git describe --abbrev=0 --match "v[0-9].[0-9]*"
        v4.13-rc5
      
      Indeed using tags is a problem as it relies on tags being pulled from
      Linus' git (and pushed to the clone).
      
      In commit a4147f0f ("perf tools: Fix perf version generation")
      Robert introduced a change to use the kernelversion rule to generate the
      kernel tag when no git tags are available.
      
      However, as mentioned above, the tag we generate may be incorrect, so
      just always use kernelversion to get the tag (apart from building perf
      out of tree).
      Signed-off-by: NJohn Garry <john.garry@huawei.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Acked-by: NIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <rric@kernel.org>
      Link: https://lore.kernel.org/r/1645449409-158238-3-git-send-email-john.garry@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7572733b
  4. 22 3月, 2022 2 次提交
  5. 19 3月, 2022 3 次提交
  6. 18 3月, 2022 9 次提交
  7. 12 3月, 2022 7 次提交
  8. 10 3月, 2022 1 次提交