1. 13 May, 2022 2 commits
    • Adrian Hunter's avatar
      perf tools: Remove unused machines__find_host() · 843e5ba7
      Adrian Hunter authored
      machines__find_host() does not exist. Remove declaration.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.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/20220513084459.6581-1-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      843e5ba7
    • Dmitry Vyukov's avatar
      perf bench: Add breakpoint benchmarks · 68a6772f
      Dmitry Vyukov authored
      Add 2 benchmarks:
      
      1. Performance of thread creation/exiting in presence of breakpoints.
      2. Performance of breakpoint modification in presence of threads.
      
      The benchmarks capture use cases that we are interested in:
      using inheritable breakpoints in large highly-threaded applications.
      
      The benchmarks show significant slowdown imposed by breakpoints
      (even when they don't fire).
      
      Testing on Intel 8173M with 112 HW threads show:
      
        perf bench --repeat=56 breakpoint thread --breakpoints=0 --parallelism=56 --threads=20
              78.675000 usecs/op
        perf bench --repeat=56 breakpoint thread --breakpoints=4 --parallelism=56 --threads=20
           12967.135714 usecs/op
      
      That's 165x slowdown due to presence of the breakpoints.
      
        perf bench --repeat=20000 breakpoint enable --passive=0 --active=0
               1.433250 usecs/op
        perf bench --repeat=20000 breakpoint enable --passive=224 --active=0
             585.318400 usecs/op
        perf bench --repeat=20000 breakpoint enable --passive=0 --active=111
             635.953000 usecs/op
      
      That's 408x and 444x slowdown due to presence of threads.
      
      Profiles show some overhead in toggle_bp_slot,
      but also very high contention:
      
          90.83%  breakpoint-thre  [kernel.kallsyms]  [k] osq_lock
           4.69%  breakpoint-thre  [kernel.kallsyms]  [k] mutex_spin_on_owner
           2.06%  breakpoint-thre  [kernel.kallsyms]  [k] __reserve_bp_slot
           2.04%  breakpoint-thre  [kernel.kallsyms]  [k] toggle_bp_slot
      
          79.01%  breakpoint-enab  [kernel.kallsyms]  [k] smp_call_function_single
           9.94%  breakpoint-enab  [kernel.kallsyms]  [k] llist_add_batch
           5.70%  breakpoint-enab  [kernel.kallsyms]  [k] _raw_spin_lock_irq
           1.84%  breakpoint-enab  [kernel.kallsyms]  [k] event_function_call
           1.12%  breakpoint-enab  [kernel.kallsyms]  [k] send_call_function_single_ipi
           0.37%  breakpoint-enab  [kernel.kallsyms]  [k] generic_exec_single
           0.24%  breakpoint-enab  [kernel.kallsyms]  [k] __perf_event_disable
           0.20%  breakpoint-enab  [kernel.kallsyms]  [k] _perf_event_enable
           0.18%  breakpoint-enab  [kernel.kallsyms]  [k] toggle_bp_slot
      
      Committer notes:
      
      Fixup struct init for older compilers:
      
         3    32.90 alpine:3.5                    : FAIL clang version 3.8.1 (tags/RELEASE_381/final)
          bench/breakpoint.c:49:34: error: missing field 'size' initializer [-Werror,-Wmissing-field-initializers]
                  struct perf_event_attr attr = {0};
                                                  ^
          1 error generated.
         7    37.31 alpine:3.9                    : FAIL gcc version 8.3.0 (Alpine 8.3.0)
          bench/breakpoint.c:49:34: error: missing field 'size' initializer [-Werror,-Wmissing-field-initializers]
                  struct perf_event_attr attr = {0};
                                                  ^
          1 error generated.
      Signed-off-by: default avatarDmitriy Vyukov <dvyukov@google.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Acked-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Marco Elver <elver@google.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/20220505155745.1690906-1-dvyukov@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      68a6772f
  2. 11 May, 2022 1 commit
  3. 10 May, 2022 11 commits
  4. 09 May, 2022 6 commits
    • Linus Torvalds's avatar
      Merge tag 'platform-drivers-x86-v5.18-4' of... · 9be9ed26
      Linus Torvalds authored
      Merge tag 'platform-drivers-x86-v5.18-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
      
      Pull x86 platform driver fixes from Hans de Goede:
      
       - thinkpad_acpi AMD suspend/resume + fan detection fixes
      
       - two other small fixes
      
       - one hardware-id addition
      
      * tag 'platform-drivers-x86-v5.18-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
        platform/surface: aggregator: Fix initialization order when compiling as builtin module
        platform/surface: gpe: Add support for Surface Pro 8
        platform/x86/intel: Fix 'rmmod pmt_telemetry' panic
        platform/x86: thinkpad_acpi: Correct dual fan probe
        platform/x86: thinkpad_acpi: Add a s2idle resume quirk for a number of laptops
        platform/x86: thinkpad_acpi: Convert btusb DMI list to quirks
      9be9ed26
    • Ian Rogers's avatar
      perf metrics: Don't add all tool events for sharing · 8586d274
      Ian Rogers authored
      Tool events are added to the set of events for parsing so that having a
      tool event in a metric doesn't inhibit event sharing of events between
      metrics.
      
      All tool events were added but this meant unused tool events would be
      counted. Reduce this set of tool events to just those present in the
      overall metric list.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Florian Fischer <florian.fischer@muhq.space>
      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: Kim Phillips <kim.phillips@amd.com>
      Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Shunsuke Nakamura <nakamura.shun@fujitsu.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20220507053410.3798748-6-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8586d274
    • Ian Rogers's avatar
      perf metrics: Support all tool events · 9aa09230
      Ian Rogers authored
      Previously duration_time was hard coded, which was ok until commit
      b03b89b3 ("perf stat: Add user_time and system_time events")
      added additional tool events. Do for all tool events what was previously
      done just for duration_time.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Florian Fischer <florian.fischer@muhq.space>
      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: Kim Phillips <kim.phillips@amd.com>
      Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Shunsuke Nakamura <nakamura.shun@fujitsu.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20220507053410.3798748-5-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9aa09230
    • Ian Rogers's avatar
      perf evsel: Add tool event helpers · 79932d16
      Ian Rogers authored
      Convert to and from a string. Fix evsel__tool_name() as array is
      off-by-1.  Support more than just duration_time as a metric-id.
      
      Fixes: 75eafc97 ("perf list: Print all available tool events")
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Florian Fischer <florian.fischer@muhq.space>
      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: Kim Phillips <kim.phillips@amd.com>
      Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Shunsuke Nakamura <nakamura.shun@fujitsu.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20220507053410.3798748-4-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      79932d16
    • Ian Rogers's avatar
      perf evsel: Constify a few arrays · 545a96c9
      Ian Rogers authored
      Remove public definition of evsel__tool_names(). Not used outside
      util/evsel.c.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Florian Fischer <florian.fischer@muhq.space>
      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: Kim Phillips <kim.phillips@amd.com>
      Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Shunsuke Nakamura <nakamura.shun@fujitsu.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20220507053410.3798748-3-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      545a96c9
    • Ian Rogers's avatar
      Revert "perf stat: Support metrics with hybrid events" · 17b3867d
      Ian Rogers authored
      This reverts commit 60344f1a.
      
      Hybrid metrics place a PMU at the end of the parse string. This is also
      where tool events are placed. The behavior of the parse string isn't
      clear and so revert the change for now.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Florian Fischer <florian.fischer@muhq.space>
      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: Kim Phillips <kim.phillips@amd.com>
      Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Shunsuke Nakamura <nakamura.shun@fujitsu.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20220507053410.3798748-2-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      17b3867d
  5. 08 May, 2022 20 commits