perfetto: enabled traced_perf by compiling with clang

traced_perf is required for using e.g. callstack_sampling, see https://perfetto.dev/docs/getting-started/cpu-profiling

Tested on qemu:

Starting perfetto using a configuration which uses `callstack_sampling` starts traced_perf as a side-effect when perfetto is compiled with clang:

```
root@qemux86-64:~#  tracebox --txt -c /tmp/config.pbtxt -o /tmp/perfetto-trace.pb &
root@qemux86-64:~# ps -eo pid,cmd | grep tracebox
  529 tracebox --txt -c /tmp/config.pbtxt -o /tmp/perfetto-trace.pb
  530 /usr/bin/tracebox traced
  533 /usr/bin/tracebox traced_probes --reset-ftrace
  536 /usr/bin/tracebox traced_perf
```

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Etienne Cordonnier 2025-08-09 15:12:02 +02:00 committed by Khem Raj
parent 1b2ebce563
commit ab5cd440b3
No known key found for this signature in database
GPG Key ID: BB053355919D3314

View File

@ -51,6 +51,9 @@ require perfetto.inc
DEPENDS += " ninja-native"
# Use clang in order to enable traced_perf ( see https://github.com/google/perfetto/blob/092d0ceace6fa516fac1bd4e715c226eaaebe26e/gn/perfetto.gni#L177 ,
# enable_perfetto_traced_perf depends on "is_clang")
TOOLCHAIN = "clang"
COMPATIBLE_HOST = "(i.86|x86_64|aarch64|arm).*-linux*"
CCACHE_DISABLE = "1"