1. 29 4月, 2021 2 次提交
  2. 25 4月, 2021 1 次提交
  3. 24 4月, 2021 3 次提交
  4. 23 4月, 2021 1 次提交
  5. 21 4月, 2021 1 次提交
  6. 20 4月, 2021 9 次提交
  7. 16 4月, 2021 3 次提交
    • V
      perf beauty: Fix fsconfig generator · 2e1daee1
      Vitaly Chikunov 提交于
      After gnulib update sed stopped matching `[[:space:]]*+' as before,
      causing the following compilation error:
      
        In file included from builtin-trace.c:719:
        trace/beauty/generated/fsconfig_arrays.c:2:3: error: expected expression before ']' token
            2 |  [] = "",
      	|   ^
        trace/beauty/generated/fsconfig_arrays.c:2:3: error: array index in initializer not of integer type
        trace/beauty/generated/fsconfig_arrays.c:2:3: note: (near initialization for 'fsconfig_cmds')
      
      Fix this by correcting the regular expression used in the generator.
      Also, clean up the script by removing redundant egrep, xargs, and printf
      invocations.
      
      Committer testing:
      
      Continues to work:
      
        $ cat tools/perf/trace/beauty/fsconfig.sh
        #!/bin/sh
        # SPDX-License-Identifier: LGPL-2.1
      
        if [ $# -ne 1 ] ; then
        	linux_header_dir=tools/include/uapi/linux
        else
        	linux_header_dir=$1
        fi
      
        linux_mount=${linux_header_dir}/mount.h
      
        printf "static const char *fsconfig_cmds[] = {\n"
        ms='[[:space:]]*'
        sed -nr "s/^${ms}FSCONFIG_([[:alnum:]_]+)${ms}=${ms}([[:digit:]]+)${ms},.*/\t[\2] = \"\1\",/p" \
        	${linux_mount}
        printf "};\n"
        $ tools/perf/trace/beauty/fsconfig.sh
        static const char *fsconfig_cmds[] = {
        	[0] = "SET_FLAG",
        	[1] = "SET_STRING",
        	[2] = "SET_BINARY",
        	[3] = "SET_PATH",
        	[4] = "SET_PATH_EMPTY",
        	[5] = "SET_FD",
        	[6] = "CMD_CREATE",
        	[7] = "CMD_RECONFIGURE",
        };
        $
      
      Fixes: d3529300 ("perf beauty: Add generator for fsconfig's 'cmd' arg values")
      Signed-off-by: NVitaly Chikunov <vt@altlinux.org>
      Co-authored-by: NDmitry V. Levin <ldv@altlinux.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Link: http://lore.kernel.org/lkml/20210414182723.1670663-1-vt@altlinux.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2e1daee1
    • A
      perf record: Improve 'Workload failed' message printing events + what was exec'ed · 3535a696
      Arnaldo Carvalho de Melo 提交于
      Before:
      
        # perf record -a cycles,instructions,cache-misses
        Workload failed: No such file or directory
        #
      
      After:
      
        # perf record -a cycles,instructions,cache-misses
        Failed to collect 'cycles' for the 'cycles,instructions,cache-misses' workload: No such file or directory
        #
      
      Helps disambiguating other error scenarios:
      
        # perf record -a -e cycles,instructions,cache-misses bla
        Failed to collect 'cycles,instructions,cache-misses' for the 'bla' workload: No such file or directory
        # perf record -a cycles,instructions,cache-misses sleep 1
        Failed to collect 'cycles' for the 'cycles,instructions,cache-misses' workload: No such file or directory
        #
      
      When all goes well we're back to the usual:
      
        # perf record -a -e cycles,instructions,cache-misses sleep 1
        [ perf record: Woken up 3 times to write data ]
        [ perf record: Captured and wrote 3.151 MB perf.data (21242 samples) ]
        #
      Acked-by: NIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lore.kernel.org/lkml/20210414131628.2064862-3-acme@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3535a696
    • A
      perf evlist: Add a method to return the list of evsels as a string · 9865ea8a
      Arnaldo Carvalho de Melo 提交于
      Add a 'scnprintf' method to obtain the list of evsels in a evlist as a
      string, excluding the "dummy" event used for things like receiving
      metadata events (PERF_RECORD_FORK, MMAP, etc) when synthesizing
      preexisting threads.
      
      Will be used to improve the error message for workload failure in 'perf
      record.
      Acked-by: NIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lore.kernel.org/lkml/20210414131628.2064862-2-acme@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9865ea8a
  8. 14 4月, 2021 1 次提交
    • Y
      perf annotate: Fix sample events lost in stdio mode · 5676dba7
      Yang Jihong 提交于
      In hist__find_annotations(), since different 'struct hist_entry' entries
      may point to same symbol, we free notes->src to signal already processed
      this symbol in stdio mode; when annotate, entry will skipped if
      notes->src is NULL to avoid repeated output.
      
      However, there is a problem, for example, run the following command:
      
       # perf record -e branch-misses -e branch-instructions -a sleep 1
      
      perf.data file contains different types of sample event.
      
      If the same IP sample event exists in branch-misses and branch-instructions,
      this event uses the same symbol. When annotate branch-misses events, notes->src
      corresponding to this event is set to null, as a result, when annotate
      branch-instructions events, this event is skipped and no annotate is output.
      
      Solution of this patch is to remove zfree in hists__find_annotations and
      change sort order to "dso,symbol" to avoid duplicate output when different
      processes correspond to the same symbol.
      Signed-off-by: NYang Jihong <yangjihong1@huawei.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Gustavo A. R. Silva <gustavoars@kernel.org>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: zhangjinhao2@huawei.com
      Link: http://lore.kernel.org/lkml/20210319123527.173883-1-yangjihong1@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5676dba7
  9. 09 4月, 2021 10 次提交
  10. 08 4月, 2021 2 次提交
    • I
      perf arm-spe: Avoid potential buffer overrun · 92f1e8ad
      Ian Rogers 提交于
      SPE extended headers are > 1 byte so ensure the buffer contains at least
      this before reading. This issue was detected by fuzzing.
      Signed-off-by: NIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andre Przywara <andre.przywara@arm.com>
      Cc: Dave Martin <dave.martin@arm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lore.kernel.org/lkml/20210407153955.317215-1-irogers@google.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      92f1e8ad
    • J
      perf report: Fix wrong LBR block sorting · f2013278
      Jin Yao 提交于
      When '--total-cycles' is specified, it supports sorting for all blocks
      by 'Sampled Cycles%'. This is useful to concentrate on the globally
      hottest blocks.
      
      'Sampled Cycles%' - block sampled cycles aggregation / total sampled cycles
      
      But in current code, it doesn't use the cycles aggregation. Part of
      'cycles' counting is possibly dropped for some overlap jumps. But for
      identifying the hot block, we always need the full cycles.
      
        # perf record -b ./triad_loop
        # perf report --total-cycles --stdio
      
      Before:
      
        #
        # Sampled Cycles%  Sampled Cycles  Avg Cycles%  Avg Cycles                                          [Program Block Range]      Shared Object
        # ...............  ..............  ...........  ..........  .............................................................  .................
        #
                    0.81%             793        4.32%         793                           [setup-vdso.h:34 -> setup-vdso.h:40]         ld-2.27.so
                    0.49%             480        0.87%         160                    [native_write_msr+0 -> native_write_msr+16]  [kernel.kallsyms]
                    0.48%             476        0.52%          95                      [native_read_msr+0 -> native_read_msr+29]  [kernel.kallsyms]
                    0.31%             303        1.65%         303                              [nmi_restore+0 -> nmi_restore+37]  [kernel.kallsyms]
                    0.26%             255        1.39%         255      [nohz_balance_exit_idle+75 -> nohz_balance_exit_idle+162]  [kernel.kallsyms]
                    0.24%             234        1.28%         234                       [end_repeat_nmi+67 -> end_repeat_nmi+83]  [kernel.kallsyms]
                    0.23%             227        1.24%         227            [__irqentry_text_end+96 -> __irqentry_text_end+126]  [kernel.kallsyms]
                    0.20%             194        1.06%         194             [native_set_debugreg+52 -> native_set_debugreg+56]  [kernel.kallsyms]
                    0.11%             106        0.14%          26                [native_sched_clock+0 -> native_sched_clock+98]  [kernel.kallsyms]
                    0.10%              97        0.53%          97            [trigger_load_balance+0 -> trigger_load_balance+67]  [kernel.kallsyms]
                    0.09%              85        0.46%          85             [get-dynamic-info.h:102 -> get-dynamic-info.h:111]         ld-2.27.so
        ...
                    0.00%           92.7K        0.02%           4                           [triad_loop.c:64 -> triad_loop.c:65]         triad_loop
      
      The hottest block '[triad_loop.c:64 -> triad_loop.c:65]' is not at
      the top of output.
      
      After:
      
        # Sampled Cycles%  Sampled Cycles  Avg Cycles%  Avg Cycles                                           [Program Block Range]      Shared Object
        # ...............  ..............  ...........  ..........  ..............................................................  .................
        #
                   94.35%           92.7K        0.02%           4                            [triad_loop.c:64 -> triad_loop.c:65]         triad_loop
                    0.81%             793        4.32%         793                            [setup-vdso.h:34 -> setup-vdso.h:40]         ld-2.27.so
                    0.49%             480        0.87%         160                     [native_write_msr+0 -> native_write_msr+16]  [kernel.kallsyms]
                    0.48%             476        0.52%          95                       [native_read_msr+0 -> native_read_msr+29]  [kernel.kallsyms]
                    0.31%             303        1.65%         303                               [nmi_restore+0 -> nmi_restore+37]  [kernel.kallsyms]
                    0.26%             255        1.39%         255       [nohz_balance_exit_idle+75 -> nohz_balance_exit_idle+162]  [kernel.kallsyms]
                    0.24%             234        1.28%         234                        [end_repeat_nmi+67 -> end_repeat_nmi+83]  [kernel.kallsyms]
                    0.23%             227        1.24%         227             [__irqentry_text_end+96 -> __irqentry_text_end+126]  [kernel.kallsyms]
                    0.20%             194        1.06%         194              [native_set_debugreg+52 -> native_set_debugreg+56]  [kernel.kallsyms]
                    0.11%             106        0.14%          26                 [native_sched_clock+0 -> native_sched_clock+98]  [kernel.kallsyms]
                    0.10%              97        0.53%          97             [trigger_load_balance+0 -> trigger_load_balance+67]  [kernel.kallsyms]
                    0.09%              85        0.46%          85              [get-dynamic-info.h:102 -> get-dynamic-info.h:111]         ld-2.27.so
                    0.08%              82        0.06%          11  [intel_pmu_drain_pebs_nhm+580 -> intel_pmu_drain_pebs_nhm+627]  [kernel.kallsyms]
                    0.08%              77        0.42%          77                  [lru_add_drain_cpu+0 -> lru_add_drain_cpu+133]  [kernel.kallsyms]
                    0.08%              74        0.10%          18                [handle_pmi_common+271 -> handle_pmi_common+310]  [kernel.kallsyms]
                    0.08%              74        0.40%          74              [get-dynamic-info.h:131 -> get-dynamic-info.h:157]         ld-2.27.so
                    0.07%              69        0.09%          17  [intel_pmu_drain_pebs_nhm+432 -> intel_pmu_drain_pebs_nhm+468]  [kernel.kallsyms]
      
      Now the hottest block is reported at the top of output.
      
      Fixes: b65a7d37 ("perf hist: Support block formats with compare/sort/display")
      Signed-off-by: NJin Yao <yao.jin@linux.intel.com>
      Reviewed-by: NAndi Kleen <ak@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jin Yao <yao.jin@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20210407024452.29988-1-yao.jin@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f2013278
  11. 07 4月, 2021 1 次提交
  12. 05 4月, 2021 1 次提交
  13. 02 4月, 2021 1 次提交
  14. 31 3月, 2021 1 次提交
  15. 30 3月, 2021 1 次提交
  16. 26 3月, 2021 2 次提交
    • L
      perf test: Change to use bash for daemon test · 1dc481c0
      Leo Yan 提交于
      When executing the daemon test on Arm64 and x86 with Debian (Buster)
      distro, both skip the test case with the log:
      
        # ./perf test -v 76
        76: daemon operations                                               :
        --- start ---
        test child forked, pid 11687
        test daemon list
        trap: SIGINT: bad trap
        ./tests/shell/daemon.sh: 173: local: cpu-clock: bad variable name
        test child finished with -2
        ---- end ----
        daemon operations: Skip
      
      So the error happens for the variable expansion when use local variable
      in the shell script.  Since Debian Buster uses dash but not bash as
      non-interactive shell, when execute the daemon testing, it hits a known
      issue for dash which was reported [1].
      
      To resolve this issue, one option is to add double quotes for all local
      variables assignment, so need to change the code from:
      
        local line=`perf daemon --config ${config} -x: | head -2 | tail -1`
      
        ... to:
      
        local line="`perf daemon --config ${config} -x: | head -2 | tail -1`"
      
      But the testing script has bunch of local variables, this leads to big
      changes for whole script.
      
      On the other hand, the testing script asks to use the "local" feature
      which is bash-specific, so this patch explicitly uses "#!/bin/bash" to
      ensure running the script with bash.
      
      After:
      
        # ./perf test -v 76
        76: daemon operations                                               :
        --- start ---
        test child forked, pid 11329
        test daemon list
        test daemon reconfig
        test daemon stop
        test daemon signal
        signal 12 sent to session 'test [11596]'
        signal 12 sent to session 'test [11596]'
        test daemon ping
        test daemon lock
        test child finished with 0
        ---- end ----
        daemon operations: Ok
      
      [1] https://bugs.launchpad.net/ubuntu/+source/dash/+bug/139097
      
      Fixes: 2291bb91 ("perf tests: Add daemon 'list' command test")
      Signed-off-by: NLeo Yan <leo.yan@linaro.org>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20210320104554.529213-1-leo.yan@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1dc481c0
    • A
      perf sort: Display sort dimension p_stage_cyc only on supported archs · 50fa3a53
      Athira Rajeev 提交于
      The sort dimension "p_stage_cyc" is used to represent pipeline
      stage cycle information. Presently, this is used only in powerpc.
      
      For unsupported platforms, we don't want to display it
      in the perf report output columns. Hence add check in sort_dimension__add()
      and skip the sort key incase it is not applicable for the particular arch.
      Signed-off-by: NAthira Rajeev <atrajeev@linux.vnet.ibm.com>
      Reviewed-by: NMadhavan Srinivasan <maddy@linux.ibm.com>
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
      Link: https://lore.kernel.org/r/1616425047-1666-6-git-send-email-atrajeev@linux.vnet.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      50fa3a53