1. 01 Aug, 2022 7 commits
    • Ian Rogers's avatar
      perf symbol: Fail to read phdr workaround · 6d518ac7
      Ian Rogers authored
      The perf jvmti agent doesn't create program headers, in this case
      fallback on section headers as happened previously.
      
      Committer notes:
      
      To test this, from a public post by Ian:
      
      1) download a Java workload dacapo-9.12-MR1-bach.jar from
      https://sourceforge.net/projects/dacapobench/
      
      2) build perf such as "make -C tools/perf O=/tmp/perf NO_LIBBFD=1" it
      should detect Java and create /tmp/perf/libperf-jvmti.so
      
      3) run perf with the jvmti agent:
      
        perf record -k 1 java -agentpath:/tmp/perf/libperf-jvmti.so -jar dacapo-9.12-MR1-bach.jar -n 10 fop
      
      4) run perf inject:
      
        perf inject -i perf.data -o perf-injected.data -j
      
      5) run perf report
      
        perf report -i perf-injected.data | grep org.apache.fop
      
      With this patch reverted I see lots of symbols like:
      
           0.00%  java             jitted-388040-4656.so  [.] org.apache.fop.fo.FObj.bind(org.apache.fop.fo.PropertyList)
      
      With the patch (2d86612a ("perf symbol: Correct address for bss
      symbols")) I see lots of:
      
        dso__load_sym_internal: failed to find program header for symbol:
        Lorg/apache/fop/fo/FObj;bind(Lorg/apache/fop/fo/PropertyList;)V
        st_value: 0x40
      
      Fixes: 2d86612a ("perf symbol: Correct address for bss symbols")
      Reviewed-by: default avatarLeo Yan <leo.yan@linaro.org>
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarLeo Yan <leo.yan@linaro.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      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>
      Link: http://lore.kernel.org/lkml/20220731164923.691193-1-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6d518ac7
    • Namhyung Kim's avatar
      perf lock: Implement cpu and task filters for BPF · 6fda2405
      Namhyung Kim authored
      Add -a/--all-cpus and -C/--cpu options for cpu filtering.  Also -p/--pid
      and --tid options are added for task filtering.  The short -t option is
      taken for --threads already.  Tracking the command line workload is
      possible as well.
      
        $ sudo perf lock contention -a -b sleep 1
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Blake Jones <blakejones@google.com>
      Cc: Boqun Feng <boqun.feng@gmail.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      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>
      Cc: Waiman Long <longman@redhat.com>
      Cc: Will Deacon <will@kernel.org>
      Link: https://lore.kernel.org/r/20220729200756.666106-4-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6fda2405
    • Namhyung Kim's avatar
      perf lock: Use BPF for lock contention analysis · 407b36f6
      Namhyung Kim authored
      Add -b/--use-bpf option to use BPF to collect lock contention stats.
      For simplicity it now runs system-wide and requires C-c to stop.
      Upcoming changes will add the usual filtering.
      
        $ sudo perf lock con -b
        ^C
         contended   total wait     max wait     avg wait         type   caller
      
                42    192.67 us     13.64 us      4.59 us     spinlock   queue_work_on+0x20
                23     85.54 us     10.28 us      3.72 us     spinlock   worker_thread+0x14a
                 6     13.92 us      6.51 us      2.32 us        mutex   kernfs_iop_permission+0x30
                 3     11.59 us     10.04 us      3.86 us        mutex   kernfs_dop_revalidate+0x3c
                 1      7.52 us      7.52 us      7.52 us     spinlock   kthread+0x115
                 1      7.24 us      7.24 us      7.24 us     rwlock:W   sys_epoll_wait+0x148
                 2      7.08 us      3.99 us      3.54 us     spinlock   delayed_work_timer_fn+0x1b
                 1      6.41 us      6.41 us      6.41 us     spinlock   idle_balance+0xa06
                 2      2.50 us      1.83 us      1.25 us        mutex   kernfs_iop_lookup+0x2f
                 1      1.71 us      1.71 us      1.71 us        mutex   kernfs_iop_getattr+0x2c
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Blake Jones <blakejones@google.com>
      Cc: Boqun Feng <boqun.feng@gmail.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      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>
      Cc: Waiman Long <longman@redhat.com>
      Cc: Will Deacon <will@kernel.org>
      Link: https://lore.kernel.org/r/20220729200756.666106-3-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      407b36f6
    • Namhyung Kim's avatar
      perf lock: Pass machine pointer to is_lock_function() · 77d54a2c
      Namhyung Kim authored
      This is a preparation for later change to expose the function externally
      so that it can be used without the implicit session data.
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Blake Jones <blakejones@google.com>
      Cc: Boqun Feng <boqun.feng@gmail.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      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>
      Cc: Waiman Long <longman@redhat.com>
      Cc: Will Deacon <will@kernel.org>
      Link: https://lore.kernel.org/r/20220729200756.666106-2-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      77d54a2c
    • Ian Rogers's avatar
      perf test: Add user space counter reading tests · 9bd70218
      Ian Rogers authored
      These tests are based on test_stat_user_read in
      tools/lib/perf/tests/test-evsel.c.
      
      The tests are modified to skip if perf_event_open fails or rdpmc isn't
      supported.
      
      Committer testing:
      
        ⬢[acme@toolbox perf]$ perf test "mmap interface"
          4: mmap interface tests                         :
          4.1: Read samples using the mmap interface      : Skip (permissions)
        ⬢[acme@toolbox perf]$
      
        [root@five ~]# perf test "mmap interface"
          4: mmap interface tests                         :
          4.1: Read samples using the mmap interface      : Ok
        [root@five ~]#
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20220719223946.176299-4-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9bd70218
    • Ian Rogers's avatar
      perf test: Remove x86 rdpmc test · 481fadfb
      Ian Rogers authored
      This test has been superseded by test_stat_user_read in:
      
        tools/lib/perf/tests/test-evsel.c
      
      The updated test doesn't divide-by-0 when running time of a counter is
      0. It also supports ARM64.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      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>
      Link: http://lore.kernel.org/lkml/20220719223946.176299-3-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      481fadfb
    • Arnaldo Carvalho de Melo's avatar
      Merge remote-tracking branch 'torvalds/master' into perf/core · 18808564
      Arnaldo Carvalho de Melo authored
      To pick up the fixes that went upstream via acme/perf/urgent and to get
      to v5.19.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      18808564
  2. 31 Jul, 2022 6 commits
  3. 30 Jul, 2022 2 commits
  4. 29 Jul, 2022 25 commits