1. 02 4月, 2022 5 次提交
    • I
      perf evlist: Rename cpus to user_requested_cpus · 0df6ade7
      Ian Rogers 提交于
      evlist contains cpus and all_cpus. all_cpus is the union of the cpu maps
      of all evsels.
      
      For non-task targets, cpus is set to be cpus requested from the command
      line, defaulting to all online cpus if no cpus are specified.
      
      For an uncore event, all_cpus may be just CPU 0 or every online CPU.
      
      This causes all_cpus to have fewer values than the cpus variable which
      is confusing given the 'all' in the name.
      
      To try to make the behavior clearer, rename cpus to user_requested_cpus
      and add comments on the two struct variables.
      Signed-off-by: NIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Fastabend <john.fastabend@gmail.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: KP Singh <kpsingh@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin KaFai Lau <kafai@fb.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Yonghong Song <yhs@fb.com>
      Cc: bpf@vger.kernel.org
      Cc: coresight@lists.linaro.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: netdev@vger.kernel.org
      Link: http://lore.kernel.org/lkml/20220328232648.2127340-3-irogers@google.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0df6ade7
    • J
      perf tools: Stop depending on .git files for building PERF-VERSION-FILE · d4ff9265
      John Garry 提交于
      This essentially reverts commit c72e3f04 ("tools/perf/build:
      Speed up git-version test on re-make") and commit 4e666cdb
      ("perf tools: Fix dependency for version file creation")
      
      In commit c72e3f04 ("tools/perf/build: Speed up git-version test
      on re-make"), a makefile dependency on .git/HEAD was added. The
      background is that running PERF-VERSION-FILE is relatively slow, and
      commands like "git describe" are particularly slow.
      
      In commit 4e666cdb ("perf tools: Fix dependency for version file
      creation"), an additional dependency on .git/ORIG_HEAD was added, as
      .git/HEAD may not change for "git reset --hard HEAD^" command. However,
      depending on whether we're on a branch or not, a "git cherry-pick" may
      not lead to the version being updated.
      
      As discussed with the git community in [0], using git internal files for
      dependencies is not reliable. Commit 4e666cdb also breaks some build
      scenarios [1].
      
      As mentioned, c72e3f04 ("tools/perf/build: Speed up git-version
      test on re-make") was added to speed up the build. However in commit
      7572733b ("perf tools: Fix version kernel tag") we removed the
      call to "git describe", so just revert Makefile.perf back to same as pre
      c72e3f04 ("tools/perf/build: Speed up git-version test on
      re-make") and the build should not be so slow, as below:
      
      Pre 7572733b:
      
        $> time util/PERF-VERSION-GEN
          PERF_VERSION = 5.17.rc8.g4e666cdb
      
        real    0m0.110s
        user    0m0.091s
        sys     0m0.019s
      
      Post 7572733b:
      
        $> time util/PERF-VERSION-GEN
          PERF_VERSION = 5.17.rc8.g7572733b
      
        real    0m0.039s
        user    0m0.036s
        sys     0m0.007s
      
      [0] https://lore.kernel.org/git/87wngkpddp.fsf@igel.home/T/#m4a4dd6de52fdbe21179306cd57b3761eb07f45f8
      [1] https://lore.kernel.org/linux-perf-users/20220329093120.4173283-1-matthieu.baerts@tessares.net/T/#u
      
      Committer testing:
      
      After a fresh rebuild using 'make -C tools/perf O=/tmp/build/perf install-bin':
      
        $ perf -v
        perf version 5.17.g162f9db407b6
        $ git log --oneline -1
        162f9db407b6a6e5 (HEAD -> perf/core) perf tools: Stop depending on .git files for building PERF-VERSION-FILE
        $
      
      Now using a detached tarball, i.e. outside the kernel source tree:
      
        $ ls -la perf*tar
        ls: cannot access 'perf*tar': No such file or directory
        $ make perf-tar-src-pkg
          TAR
          PERF_VERSION = 5.17.g31d10b3ef133
        $ ls -la perf*tar
        -rw-r--r--. 1 acme acme 22241280 Mar 30 13:26 perf-5.17.0.tar
        $ mv perf-5.17.0.tar /tmp
        $ cd /tmp
        $ tar xf perf-5.17.0.tar
        $ cd perf-5.17.0/
        $ make -C tools/perf |& tail
          CC      util/pmu.o
          CC      util/pmu-flex.o
          CC      util/expr-flex.o
          CC      util/expr.o
          LD      util/scripting-engines/perf-in.o
          LD      util/intel-pt-decoder/perf-in.o
          LD      util/perf-in.o
          LD      perf-in.o
          LINK    perf
        make: Leaving directory '/tmp/perf-5.17.0/tools/perf'
        $ tools/perf/perf -v
        perf version 5.17.g31d10b3ef133
        $ pwd
        /tmp/perf-5.17.0
        $ cat PERF-VERSION-FILE
        #define PERF_VERSION "5.17.g31d10b3ef133"
        $
      
      Fixes: 4e666cdb ("perf tools: Fix dependency for version file creation")
      Reported-by: NMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: NJohn Garry <john.garry@huawei.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: NMatthieu Baerts <matthieu.baerts@tessares.net>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: https://lore.kernel.org/r/1648635774-14581-1-git-send-email-john.garry@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d4ff9265
    • A
      perf beauty: Update copy of linux/socket.h with the kernel sources · 9a195da4
      Arnaldo Carvalho de Melo 提交于
      To pick the changes in:
      
        a6a6fe27 ("net/smc: Dynamic control handshake limitation by socket options")
      
      This automagically adds support for the SOL_MNC socket level:
      
        $ diff -u tools/perf/trace/beauty/include/linux/socket.h include/linux/socket.h
        --- tools/perf/trace/beauty/include/linux/socket.h	2022-03-14 17:55:22.277148656 -0300
        +++ include/linux/socket.h	2022-03-27 19:12:48.908250063 -0300
        @@ -366,6 +366,7 @@
         #define SOL_XDP		283
         #define SOL_MPTCP	284
         #define SOL_MCTP	285
        +#define SOL_SMC		286
      
         /* IPX options */
         #define IPX_TYPE	1
        $ tools/perf/trace/beauty/socket.sh > before
        $ cp include/linux/socket.h tools/perf/trace/beauty/include/linux/socket.h
        $ tools/perf/trace/beauty/socket.sh > after
        $ diff -u before after
        --- before	2022-03-29 11:47:56.390258780 -0300
        +++ after	2022-03-29 11:48:03.158436189 -0300
        @@ -67,6 +67,7 @@
         	[283] = "XDP",
         	[284] = "MPTCP",
         	[285] = "MCTP",
        +	[286] = "SMC",
         };
      
         DEFINE_STRARRAY(socket_level, "SOL_");
        $
      
      This will allow 'perf trace' to translate 286 into "SMC" as is done with
      the other socket levels:
      
        # perf trace -e setsockopt --max-events 4
         344.916 ( 0.003 ms): Socket Thread/3816 setsockopt(fd: 168, level: TCP, optname: 5, optval: 0x7f5797b9c4f8, optlen: 4) = 0
         344.920 ( 0.002 ms): Socket Thread/3816 setsockopt(fd: 168, level: TCP, optname: 6, optval: 0x7f5797b9c4f4, optlen: 4) = 0
        1246.974 ( 0.010 ms): systemd-resolv/1128 setsockopt(fd: 22, level: IP, optname: 11, optval: 0x7ffc96cd7244, optlen: 4) = 0
        1246.986 ( 0.002 ms): systemd-resolv/1128 setsockopt(fd: 22, level: IP, optname: 8, optval: 0x7ffc96cd7264, optlen: 4) = 0
      
      This addresses this perf build warning:
      
        Warning: Kernel ABI header at 'tools/perf/trace/beauty/include/linux/socket.h' differs from latest version at 'include/linux/socket.h'
        diff -u tools/perf/trace/beauty/include/linux/socket.h include/linux/socket.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: D. Wythe <alibuda@linux.alibaba.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lore.kernel.org/lkml/YkMdpzzjPu5VZtW3@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9a195da4
    • A
      perf tools: Update copy of libbpf's hashmap.c · 4d4d00dd
      Arnaldo Carvalho de Melo 提交于
      To pick the changes in:
      
        fba60b17 ("libbpf: Use IS_ERR_OR_NULL() in hashmap__free()")
      
      That don't entail any changes in tools/perf.
      
      This addresses this perf build warning:
      
        Warning: Kernel ABI header at 'tools/perf/util/hashmap.h' differs from latest version at 'tools/lib/bpf/hashmap.h'
        diff -u tools/perf/util/hashmap.h tools/lib/bpf/hashmap.h
      
      Not a kernel ABI, its just that this uses the mechanism in place for
      checking kernel ABI files drift.
      
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mauricio Vásquez <mauricio@kinvolk.io>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lore.kernel.org/lkml/YkMb2SAIai2VeuUD@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4d4d00dd
    • I
      perf stat: Avoid SEGV if core.cpus isn't set · 8a96f454
      Ian Rogers 提交于
      Passing NULL to perf_cpu_map__max doesn't make sense as there is no
      valid max. Avoid this problem by null checking in
      perf_stat_init_aggr_mode.
      Signed-off-by: NIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Fastabend <john.fastabend@gmail.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: KP Singh <kpsingh@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin KaFai Lau <kafai@fb.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Yonghong Song <yhs@fb.com>
      Cc: bpf@vger.kernel.org
      Cc: coresight@lists.linaro.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: netdev@vger.kernel.org
      Link: http://lore.kernel.org/lkml/20220328062414.1893550-5-irogers@google.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8a96f454
  2. 26 3月, 2022 7 次提交
    • K
      perf evsel: Improve AMD IBS (Instruction-Based Sampling) error handling messages · ab0809af
      Kim Phillips 提交于
      Improve the error message returned on failed perf_event_open() on AMD
      systems when using IBS (Instruction-Based Sampling).
      
      Output of executing 'perf record -e ibs_op// true' as a non root user
      BEFORE this patch (perf will add the 'u' modifier at the end to exclude
      kernel/hypervisor sampling):
      
        The sys_perf_event_open() syscall returned with 22 (Invalid argument)for event (ibs_op//u).
        /bin/dmesg | grep -i perf may provide additional information.
      
      Output after:
      
        AMD IBS can't exclude kernel events.  Try running at a higher privilege level.
      
      Output of executing 'sudo perf record -e ibs_op// true' BEFORE this patch:
      
        Error:
        The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (ibs_op//).
        /bin/dmesg | grep -i perf may provide additional information.
      
      Output after:
      
        Error:
        Invalid event (ibs_op//) in per-thread mode, enable system wide with '-a'.
      
      Folowing the suggestion:
      
        $ sudo perf record -a -e ibs_op// true
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 1.664 MB perf.data (194 samples) ]
        $
      Signed-off-by: NKim Phillips <kim.phillips@amd.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: João 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: Rafael J. Wysocki <rafael@kernel.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20220322221517.2510440-12-eranian@google.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ab0809af
    • A
      perf python: Add perf_env stubs that will be needed in evsel__open_strerror() · b58230de
      Arnaldo Carvalho de Melo 提交于
      The AMD IBS error message enhancements will use these, but we're not
      using evsel__open_strerror() in the python binding so far.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b58230de
    • W
      perf tools: Enhance the matching of sub-commands abbreviations · ae0f4eb3
      Wei Li 提交于
      We support short command 'rec*' for 'record' and 'rep*' for 'report' in
      lots of sub-commands, but the matching is not quite strict currnetly.
      
      It may be puzzling sometime, like we mis-type a 'recport' to report but
      it will perform 'record' in fact without any message.
      
      To fix this, add a check to ensure that the short cmd is valid prefix
      of the real command.
      
      Committer testing:
      
        [root@quaco ~]# perf c2c re sleep 1
      
         Usage: perf c2c {record|report}
      
            -v, --verbose         be more verbose (show counter open errors, etc)
      
        # perf c2c rec sleep 1
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.038 MB perf.data (16 samples) ]
        # perf c2c recport sleep 1
      
         Usage: perf c2c {record|report}
      
            -v, --verbose         be more verbose (show counter open errors, etc)
      
        # perf c2c record sleep 1
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.038 MB perf.data (15 samples) ]
        # perf c2c records sleep 1
      
         Usage: perf c2c {record|report}
      
            -v, --verbose         be more verbose (show counter open errors, etc)
      
        #
      Signed-off-by: NWei Li <liwei391@huawei.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Hanjun Guo <guohanjun@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Rui Xiang <rui.xiang@huawei.com>
      Link: http://lore.kernel.org/lkml/20220325092032.2956161-1-liwei391@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ae0f4eb3
    • A
      tools arm64: Import cputype.h · 1314376d
      Ali Saidi 提交于
      Bring-in the kernel's arch/arm64/include/asm/cputype.h into tools/
      for arm64 to make use of all the core-type definitions in perf.
      
      Replace sysreg.h with the version already imported into tools/.
      
      Committer notes:
      
      Added an entry to tools/perf/check-headers.sh, so that we get notified
      when the original file in the kernel sources gets modified.
      
      Tester notes:
      
      LGTM. I did the testing on both my x86 and Arm64 platforms, thanks for
      the fixing up.
      Signed-off-by: NAli Saidi <alisaidi@amazon.com>
      Tested-by: NLeo Yan <leo.yan@linaro.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: German Gomez <german.gomez@arm.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: Kajol Jain <kjain@linux.ibm.com>
      Cc: Li Huafei <lihuafei1@huawei.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nick.Forrington@arm.com
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Will Deacon <will@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20220324183323.31414-2-alisaidi@amazon.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1314376d
    • N
      perf lock: Add -F/--field option to control output · 4bd9cab5
      Namhyung Kim 提交于
      The -F/--field option is to customize the list of fields to output:
      
        $ perf lock report -F contended,wait_max -k avg_wait
                        Name  contended   max wait (ns)   avg wait (ns)
      
              slock-AF_INET6          1           23543           23543
           &lruvec->lru_lock          5           18317           11254
              slock-AF_INET6          1           10379           10379
                  rcu_node_1          1            2104            2104
         &dentry->d_lockr...          1            1844            1844
         &dentry->d_lockr...          1            1672            1672
            &newf->file_lock         15            2279            1025
         &dentry->d_lockr...          1             792             792
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Andi Kleen <ak@linux.intel.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>
      Link: https://lore.kernel.org/r/20220323230259.288494-3-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4bd9cab5
    • N
      perf lock: Extend struct lock_key to have print function · 64999e44
      Namhyung Kim 提交于
      And use it to print output for each key field.  No functional change
      intended and the output should be identical.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Andi Kleen <ak@linux.intel.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>
      Link: https://lore.kernel.org/r/20220323230259.288494-2-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      64999e44
    • N
      perf lock: Add --synth=no option for record · 67b61f59
      Namhyung Kim 提交于
      The perf lock command has nothing to symbolize and lock names come
      from the tracepoint.  Moreover, kernel symbols are available even the
      --synth=no option is given.
      
      This will reduce the startup time by avoiding unnecessary synthesis.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Andi Kleen <ak@linux.intel.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>
      Link: https://lore.kernel.org/r/20220323230259.288494-1-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      67b61f59
  3. 25 3月, 2022 1 次提交
    • 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
  4. 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
  5. 22 3月, 2022 2 次提交
  6. 19 3月, 2022 3 次提交
  7. 18 3月, 2022 8 次提交
  8. 12 3月, 2022 4 次提交
  9. 08 3月, 2022 2 次提交