2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/tools/tracing/rtla/src
Tomas Glozar 8020361d51 rtla: Define _GNU_SOURCE in timerlat_bpf.c
Newer versions of glibc include a definition of struct sched_attr in
bits/sched.h (included through sched.h which is included by rtla).
Commit 0eecee3406 ("tools/rtla: fix collision with glibc
sched_attr/sched_set_attr") has modified the definition of struct
sched_attr in utils.h, so that it is only applied with older versions of
glibc that do not define it, in order to prevent build failure.

The definition in bits/sched.h depends on _GNU_SOURCE.
timerlat_bpf.c does not define _GNU_SOURCE, making it fall back to the
definition in utils.h. The latter has two fields less, leading to
shifted offsets of struct timerlat_params in timerlat_bpf_init.

Because of the shift, timerlat_bpf_init incorrectly reads
params->entries as 0 for timerlat-hist and disables the creation of
histogram maps, causing breakage in BPF sample collection mode:

$ rtla timerlat hist -d 1s
Error pulling BPF data

Fix the issue by also defining _GNU_SOURCE in timerlat_bpf.c.

Cc: John Kacur <jkacur@redhat.com>
Cc: Luis Goncalves <lgoncalv@redhat.com>
Link: https://lore.kernel.org/20250430144651.621766-1-tglozar@redhat.com
Fixes: e34293ddce ("rtla/timerlat: Add BPF skeleton to collect samples")
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2025-05-07 17:25:46 -04:00
..
Build rtla/timerlat: Add BPF skeleton to collect samples 2025-03-04 12:35:18 -05:00
osnoise_hist.c rtla: Set distinctive exit value for failed tests 2025-05-07 15:36:19 -04:00
osnoise_top.c rtla: Set distinctive exit value for failed tests 2025-05-07 15:36:19 -04:00
osnoise.c rtla: Always set all tracer options 2025-03-26 10:36:39 -04:00
osnoise.h rtla: Unify apply_config between top and hist 2025-03-26 10:36:39 -04:00
rtla.c rtla: Add hwnoise tool 2023-02-13 23:56:46 -05:00
timerlat_aa.c rtla/timerlat: Unify params struct 2025-03-04 12:35:17 -05:00
timerlat_aa.h rtla/timerlat: Give timerlat auto analysis its own instance 2023-06-13 16:31:35 -04:00
timerlat_bpf.c rtla: Define _GNU_SOURCE in timerlat_bpf.c 2025-05-07 17:25:46 -04:00
timerlat_bpf.h rtla/timerlat: Add BPF skeleton to collect samples 2025-03-04 12:35:18 -05:00
timerlat_hist.c rtla: Set distinctive exit value for failed tests 2025-05-07 15:36:19 -04:00
timerlat_top.c rtla: Set distinctive exit value for failed tests 2025-05-07 15:36:19 -04:00
timerlat_u.c rtla/timerlat: Do not stop user-space if a cpu is offline 2023-09-22 14:43:46 +02:00
timerlat_u.h rtla/timerlat_top: Add timerlat user-space support 2023-06-13 16:38:51 -04:00
timerlat.bpf.c rtla/timerlat: Add BPF skeleton to collect samples 2025-03-04 12:35:18 -05:00
timerlat.c rtla: Always set all tracer options 2025-03-26 10:36:39 -04:00
timerlat.h rtla: Unify apply_config between top and hist 2025-03-26 10:36:39 -04:00
trace.c rtla: Fix segfault in save_trace_to_file call 2025-03-26 10:35:20 -04:00
trace.h rtla: Count all processed events 2025-01-24 13:46:24 -05:00
utils.c rtla: Define __NR_sched_setattr for LoongArch 2025-05-07 16:35:31 -04:00
utils.h rtla: Set distinctive exit value for failed tests 2025-05-07 15:36:19 -04:00