<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools/perf/util, branch for-next</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=for-next</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=for-next'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2024-12-12T05:40:46Z</updated>
<entry>
<title>perf probe: Fix uninitialized variable</title>
<updated>2024-12-12T05:40:46Z</updated>
<author>
<name>James Clark</name>
<email>james.clark@linaro.org</email>
</author>
<published>2024-12-11T08:55:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=434fffa926b10706f2bde2db22979d68463302fc'/>
<id>urn:sha1:434fffa926b10706f2bde2db22979d68463302fc</id>
<content type='text'>
Since the linked fixes: commit, err is returned uninitialized due to the
removal of "return 0". Initialize err to fix it.

This fixes the following intermittent test failure on release builds:

 $ perf test "testsuite_probe"
 ...
 -- [ FAIL ] -- perf_probe :: test_invalid_options :: mutually exclusive options :: -L foo -V bar (output regexp parsing)
 Regexp not found: \"Error: switch .+ cannot be used with switch .+\"
 ...

Fixes: 080e47b2a237 ("perf probe: Introduce quotation marks support")
Tested-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Reviewed-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Acked-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Link: https://lore.kernel.org/r/20241211085525.519458-2-james.clark@linaro.org
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf hwmon_pmu: Use openat rather than dup to refresh directory</title>
<updated>2024-12-09T23:00:03Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2024-12-06T04:23:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3f61a12b08bd84e6cf705484c2cb9d5b891882fa'/>
<id>urn:sha1:3f61a12b08bd84e6cf705484c2cb9d5b891882fa</id>
<content type='text'>
The hwmon PMU test will make a temp directory, open the directory with
O_DIRECTORY then fill it with contents. As the open is before the
filling the contents the later fdopendir may reflect the initial empty
state, meaning no events are seen. Change to re-open the directory,
rather than dup the fd, so the latest contents are seen.

Minor tweaks/additions to debug messages.

Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Tested-by: Arnaldo Carvalho de Melo &lt;acme@kernel.org&gt;
Link: https://lore.kernel.org/r/20241206042306.1055913-1-irogers@google.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf tools: Fix precise_ip fallback logic</title>
<updated>2024-12-05T23:15:29Z</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung@kernel.org</email>
</author>
<published>2024-12-05T23:15:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c33aea446bf555ab2b4e06deb914ba8f87cdb068'/>
<id>urn:sha1:c33aea446bf555ab2b4e06deb914ba8f87cdb068</id>
<content type='text'>
Sometimes it returns other than EOPNOTSUPP for invalid precise_ip so
it cannot check the error code.  Let's move the fallback after the
missing feature checks so that it can handle EINVAL as well.  This also
aligns well with the existing behavior which blindly turns off the
precise_ip but we check the missing features correctly now.

Fixes: af954f76eea56453 ("perf tools: Check fallback error and order")
Reported-by: kernel test robot &lt;oliver.sang@intel.com&gt;
Reported-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Closes: https://lore.kernel.org/oe-lkp/202411301431.799e5531-lkp@intel.com
Tested-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Link: https://lore.kernel.org/r/Z1DV0lN8qHSysX7f@google.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf machine: Initialize machine-&gt;env to address a segfault</title>
<updated>2024-12-03T18:07:31Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
<email>acme@kernel.org</email>
</author>
<published>2024-11-26T14:47:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=88a6e2f67cc94f751a74409ab4c21e5fc8ea6757'/>
<id>urn:sha1:88a6e2f67cc94f751a74409ab4c21e5fc8ea6757</id>
<content type='text'>
Its used from trace__run(), for the 'perf trace' live mode, i.e. its
strace-like, non-perf.data file processing mode, the most common one.

The trace__run() function will set trace-&gt;host using machine__new_host()
that is supposed to give a machine instance representing the running
machine, and since we'll use perf_env__arch_strerrno() to get the right
errno -&gt; string table, we need to use machine-&gt;env, so initialize it in
machine__new_host().

Before the patch:

  (gdb) run trace --errno-summary -a sleep 1
  &lt;SNIP&gt;
   Summary of events:

   gvfs-afc-volume (3187), 2 events, 0.0%

     syscall            calls  errors  total       min       avg       max       stddev
                                       (msec)    (msec)    (msec)    (msec)        (%)
     --------------- --------  ------ -------- --------- --------- ---------     ------
     pselect6               1      0     0.000     0.000     0.000     0.000      0.00%

   GUsbEventThread (3519), 2 events, 0.0%

     syscall            calls  errors  total       min       avg       max       stddev
                                       (msec)    (msec)    (msec)    (msec)        (%)
     --------------- --------  ------ -------- --------- --------- ---------     ------
     poll                   1      0     0.000     0.000     0.000     0.000      0.00%
  &lt;SNIP&gt;
  Program received signal SIGSEGV, Segmentation fault.
  0x00000000005caba0 in perf_env__arch_strerrno (env=0x0, err=110) at util/env.c:478
  478		if (env-&gt;arch_strerrno == NULL)
  (gdb) bt
  #0  0x00000000005caba0 in perf_env__arch_strerrno (env=0x0, err=110) at util/env.c:478
  #1  0x00000000004b75d2 in thread__dump_stats (ttrace=0x14f58f0, trace=0x7fffffffa5b0, fp=0x7ffff6ff74e0 &lt;_IO_2_1_stderr_&gt;) at builtin-trace.c:4673
  #2  0x00000000004b78bf in trace__fprintf_thread (fp=0x7ffff6ff74e0 &lt;_IO_2_1_stderr_&gt;, thread=0x10fa0b0, trace=0x7fffffffa5b0) at builtin-trace.c:4708
  #3  0x00000000004b7ad9 in trace__fprintf_thread_summary (trace=0x7fffffffa5b0, fp=0x7ffff6ff74e0 &lt;_IO_2_1_stderr_&gt;) at builtin-trace.c:4747
  #4  0x00000000004b656e in trace__run (trace=0x7fffffffa5b0, argc=2, argv=0x7fffffffde60) at builtin-trace.c:4456
  #5  0x00000000004ba43e in cmd_trace (argc=2, argv=0x7fffffffde60) at builtin-trace.c:5487
  #6  0x00000000004c0414 in run_builtin (p=0xec3068 &lt;commands+648&gt;, argc=5, argv=0x7fffffffde60) at perf.c:351
  #7  0x00000000004c06bb in handle_internal_command (argc=5, argv=0x7fffffffde60) at perf.c:404
  #8  0x00000000004c0814 in run_argv (argcp=0x7fffffffdc4c, argv=0x7fffffffdc40) at perf.c:448
  #9  0x00000000004c0b5d in main (argc=5, argv=0x7fffffffde60) at perf.c:560
  (gdb)

After:

  root@number:~# perf trace -a --errno-summary sleep 1
  &lt;SNIP&gt;
     pw-data-loop (2685), 1410 events, 16.0%

     syscall            calls  errors  total       min       avg       max       stddev
                                       (msec)    (msec)    (msec)    (msec)        (%)
     --------------- --------  ------ -------- --------- --------- ---------     ------
     epoll_wait           188      0   983.428     0.000     5.231    15.595      8.68%
     ioctl                 94      0     0.811     0.004     0.009     0.016      2.82%
     read                 188      0     0.322     0.001     0.002     0.006      5.15%
     write                141      0     0.280     0.001     0.002     0.018      8.39%
     timerfd_settime       94      0     0.138     0.001     0.001     0.007      6.47%

   gnome-control-c (179406), 1848 events, 20.9%

     syscall            calls  errors  total       min       avg       max       stddev
                                       (msec)    (msec)    (msec)    (msec)        (%)
     --------------- --------  ------ -------- --------- --------- ---------     ------
     poll                 222      0   959.577     0.000     4.322    21.414     11.40%
     recvmsg              150      0     0.539     0.001     0.004     0.013      5.12%
     write                300      0     0.442     0.001     0.001     0.007      3.29%
     read                 150      0     0.183     0.001     0.001     0.009      5.53%
     getpid               102      0     0.101     0.000     0.001     0.008      7.82%

  root@number:~#

Fixes: 54373b5d53c1f6aa ("perf env: Introduce perf_env__arch_strerrno()")
Reported-by: Veronika Molnarova &lt;vmolnaro@redhat.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Acked-by: Veronika Molnarova &lt;vmolnaro@redhat.com&gt;
Acked-by: Michael Petlan &lt;mpetlan@redhat.com&gt;
Tested-by: Michael Petlan &lt;mpetlan@redhat.com&gt;
Link: https://lore.kernel.org/r/Z0XffUgNSv_9OjOi@x1
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf tools: Fix build-id event recording</title>
<updated>2024-12-02T20:36:20Z</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung@kernel.org</email>
</author>
<published>2024-11-27T03:13:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=23c44f6c83257923b179461694edcf62749bedd5'/>
<id>urn:sha1:23c44f6c83257923b179461694edcf62749bedd5</id>
<content type='text'>
The build-id events written at the end of the record session are broken
due to unexpected data.  The write_buildid() writes the fixed length
event first and then variable length filename.

But a recent change made it write more data in the padding area
accidentally.  So readers of the event see zero-filled data for the
next entry and treat it incorrectly.  This resulted in wrong kernel
symbols because the kernel DSO loaded a random vmlinux image in the
path as it didn't have a valid build-id.

Fixes: ae39ba16554e ("perf inject: Fix build ID injection")
Reported-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Tested-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Reviewed-by: Ian Rogers &lt;irogers@google.com&gt;
Link: https://lore.kernel.org/r/Z0aRFFW9xMh3mqKB@google.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf tests: Fix hwmon parsing with PMU name test</title>
<updated>2024-11-22T21:38:39Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2024-11-21T00:09:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6d78089da9805787a72e52604ad4b2ed7380be3f'/>
<id>urn:sha1:6d78089da9805787a72e52604ad4b2ed7380be3f</id>
<content type='text'>
Incorrectly the hwmon with PMU name test didn't pass "true". Fix and
address issue with hwmon_pmu__config_terms needing to load events - a
load bearing assert fired. Also fix missing list deletion when putting
the hwmon test PMU and lower some debug warnings to make the hwmon PMU
less spammy in verbose mode.

Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Tested-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: https://lore.kernel.org/r/20241121000955.536930-1-irogers@google.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf hwmon_pmu: Ensure hwmon key union is zeroed before use</title>
<updated>2024-11-22T21:38:39Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2024-11-19T23:00:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=62878b400f5b02416368eda361277c045c675466'/>
<id>urn:sha1:62878b400f5b02416368eda361277c045c675466</id>
<content type='text'>
Non-zero values led to mismatches in testing. This was reproducible
with -fsanitize=undefined.

Reported-by: Arnaldo Carvalho de Melo &lt;acme@kernel.org&gt;
Closes: https://lore.kernel.org/lkml/Zzdtj0PEWEX3ATwL@x1/
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Acked-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: https://lore.kernel.org/r/20241119230033.115369-1-irogers@google.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf bpf-filter: Return -ENOMEM directly when pfi allocation fails</title>
<updated>2024-11-22T21:36:00Z</updated>
<author>
<name>Hao Ge</name>
<email>gehao@kylinos.cn</email>
</author>
<published>2024-11-13T03:05:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bd077a53ad87cb111632e564cdfe8dfbe96786de'/>
<id>urn:sha1:bd077a53ad87cb111632e564cdfe8dfbe96786de</id>
<content type='text'>
Directly return -ENOMEM when pfi allocation fails,
instead of performing other operations on pfi.

Fixes: 0fe2b18ddc40 ("perf bpf-filter: Support multiple events properly")
Signed-off-by: Hao Ge &lt;gehao@kylinos.cn&gt;
Acked-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: hao.ge@linux.dev
Cc: bpf@vger.kernel.org
Link: https://lore.kernel.org/r/20241113030537.26732-1-hao.ge@linux.dev
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf: Remove unused del_perf_probe_events()</title>
<updated>2024-11-16T20:07:31Z</updated>
<author>
<name>Dr. David Alan Gilbert</name>
<email>linux@treblig.org</email>
</author>
<published>2024-10-22T00:29:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=85c60a01b85ee956adf8d46c253fc50f75363e8f'/>
<id>urn:sha1:85c60a01b85ee956adf8d46c253fc50f75363e8f</id>
<content type='text'>
del_perf_probe_events() last use was removed by commit 3d6dfae889174340
("perf parse-events: Remove BPF event support")

Remove it.

It was the last user of probe_file__del_events(), so remove it as well.

Signed-off-by: Dr. David Alan Gilbert &lt;linux@treblig.org&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Ian Rogers &lt;irogers@google.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: https://lore.kernel.org/r/20241022002940.302946-1-linux@treblig.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf pmu: Move pmu_metrics_table__find and remove ARM override</title>
<updated>2024-11-16T19:42:36Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2024-11-07T16:20:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8f997865ee9e73281a92a7ab7ebcab84e1a36d83'/>
<id>urn:sha1:8f997865ee9e73281a92a7ab7ebcab84e1a36d83</id>
<content type='text'>
Move pmu_metrics_table__find() to the jevents.py generated pmu-events.c
and remove indirection override for ARM.

The movement removes perf_pmu__find_metrics_table that exists to enable
the ARM override.

The ARM override isn't necessary as just the CPUID, not PMU, is used in
the metric table lookup.

On non-ARM the CPU argument is just ignored for the CPUID, for ARM -1 is
passed so that the CPUID for the first logical CPU is read.

Reviewed-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Tested-by: Xu Yang &lt;xu.yang_2@nxp.com&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Albert Ou &lt;aou@eecs.berkeley.edu&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Alexandre Ghiti &lt;alexghiti@rivosinc.com&gt;
Cc: Athira Rajeev &lt;atrajeev@linux.vnet.ibm.com&gt;
Cc: Ben Zong-You Xie &lt;ben717@andestech.com&gt;
Cc: Benjamin Gray &lt;bgray@linux.ibm.com&gt;
Cc: Bibo Mao &lt;maobibo@loongson.cn&gt;
Cc: Clément Le Goffic &lt;clement.legoffic@foss.st.com&gt;
Cc: Dima Kogan &lt;dima@secretsauce.net&gt;
Cc: Dr. David Alan Gilbert &lt;linux@treblig.org&gt;
Cc: Huacai Chen &lt;chenhuacai@kernel.org&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: John Garry &lt;john.g.garry@oracle.com&gt;
Cc: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Cc: Leo Yan &lt;leo.yan@linux.dev&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Masami Hiramatsu &lt;mhiramat@kernel.org&gt;
Cc: Mike Leach &lt;mike.leach@linaro.org&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Palmer Dabbelt &lt;palmer@dabbelt.com&gt;
Cc: Paul Walmsley &lt;paul.walmsley@sifive.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Ravi Bangoria &lt;ravi.bangoria@amd.com&gt;
Cc: Sandipan Das &lt;sandipan.das@amd.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Cc: Yicong Yang &lt;yangyicong@hisilicon.com&gt;
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-riscv@lists.infradead.org
Link: https://lore.kernel.org/r/20241107162035.52206-9-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
</feed>
