linux/tools/perf/tests
Michael Jeanson 536e81f074 perf data ctf: replace libbabeltrace with babeltrace2-ctf-writer
The 1.x branch of Babeltrace has been superseded by 2.x in 2020 and has
been unmaintained since 2022, efforts have started to remove it from
popular distributions.

Babeltrace 2.x offers a very similar 'ctf-writer' library that can be used
with minimal changes for the '--to-ctf' feature and has been packaged
since Debian 11 and Fedora 32.

This patch replaces the 'libbabeltrace' build feature with
'babeltrace2-ctf-writer' using pkgconfig detection, adjusts the naming of
the public headers and applies minor API cleanups.

There is no changes to the output ctf traces, the ctf-writer API still
implements version 1.8 of the CTF specification that can be read by
either Babeltrace 1 / 2 or any CTF compliant reader.

Also remove some ifdefs in the cli option parsing to allow printing the
helpful error message with '--to-ctf' when built without babeltrace2.

Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Derek Foreman <derek.foreman@collabora.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
History 2026-06-04 17:34:52 -03:00
..
config-fragments perf tools: Enable configs required for test_uprobe_from_different_cu.sh 2024-04-17 12:21:39 -03:00
shell perf data ctf: replace libbabeltrace with babeltrace2-ctf-writer 2026-06-04 17:34:52 -03:00
workloads perf test: Remove /usr/bin/cc dependency from Intel PT shell test 2026-06-04 11:41:46 -03:00
api-io.c perf tests api-io: Use zfree() to reduce chances of use after free 2023-04-12 10:14:58 -03:00
backward-ring-buffer.c perf target: Remove uid from target 2025-06-09 11:18:18 -07:00
bitmap.c libperf cpumap: Make index and nr types unsigned 2026-04-01 14:50:53 -07:00
bp_account.c perf tests bp_account: Fix leaked file descriptor 2025-07-11 12:05:02 -07:00
bp_signal.c perf tools: Make more global variables static 2026-04-08 19:21:04 -07:00
bp_signal_overflow.c perf parse-events: Add default_breakpoint_len helper 2024-09-04 09:49:09 -03:00
Build perf tests: Add test for uncore event sorting 2026-05-20 18:23:55 -03:00
builtin-test.c perf test: Remove /usr/bin/cc dependency from Intel PT shell test 2026-06-04 11:41:46 -03:00
code-reading.c perf tools: Use calloc() where applicable 2026-04-08 19:21:05 -07:00
cpumap.c libperf cpumap: Make index and nr types unsigned 2026-04-01 14:50:53 -07:00
demangle-java-test.c perf test demangle-java: Don't segv if demangling fails 2025-05-28 10:12:47 -03:00
demangle-ocaml-test.c perf test demangle-ocaml: Switch to using dso__demangle_sym() 2025-05-09 17:03:09 -03:00
demangle-rust-v0-test.c perf test demangle-rust: Add Rust demangling test 2025-05-09 17:01:57 -03:00
dlfilter-test.c perf event: Fix size of synthesized sample with branch stacks 2026-05-20 16:11:30 -03:00
dso-data.c perf tools: Make more global variables static 2026-04-08 19:21:04 -07:00
dwarf-unwind.c perf machine: Explicitly pass in host perf_env 2025-07-25 10:37:57 -07:00
event-times.c perf thread_map: Remove uid options 2025-06-09 11:18:18 -07:00
event_groups.c perf test: Update event_groups test to use instructions 2025-01-18 10:32:57 -08:00
event_update.c perf evlist: Improve default event for s390 2026-03-19 14:42:46 -07:00
evsel-roundtrip-name.c perf evsel: Use evsel__name_is() helper 2024-04-03 11:48:56 -03:00
evsel-tp-sched.c perf build: Include libtraceevent headers directly indicated by pkg-config 2024-11-08 22:42:57 -08:00
expand-cgroup.c perf evlist: Improve default event for s390 2026-03-19 14:42:46 -07:00
expr.c perf test expr: Fix system_tsc_freq for only x86 2024-12-11 09:19:44 -08:00
fdarray.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
genelf.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
hists_common.c perf dso: Add reference count checking and accessor functions 2024-05-06 15:28:49 -03:00
hists_common.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hists_cumulate.c perf hist: Remove evsel from struct hist_entry_iter 2026-05-20 16:39:36 -03:00
hists_filter.c perf hist: Remove evsel from struct hist_entry_iter 2026-05-20 16:39:36 -03:00
hists_link.c perf sort: Use perf_env to set arch sort keys and header 2025-07-25 10:37:58 -07:00
hists_output.c perf hist: Remove evsel from struct hist_entry_iter 2026-05-20 16:39:36 -03:00
hwmon_pmu.c perf tests hwmon_pmu: Use PRIu64 + (uint64_t) cast for a __u64 field to work more widely 2026-05-28 18:31:50 -03:00
is_printable_array.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
kallsyms-split.c perf tests kallsyms: Fix missed map__put() 2026-01-20 17:29:15 -03:00
keep-tracking.c perf test: Switch cycles event to cpu-cycles 2025-10-15 23:59:12 +09:00
kmod-path.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
make perf data ctf: replace libbabeltrace with babeltrace2-ctf-writer 2026-06-04 17:34:52 -03:00
maps.c perf test maps: Additional maps__fixup_overlap_and_insert tests 2025-11-19 16:20:15 -08:00
mem.c perf mem-info: Add reference count checking 2024-05-07 18:06:44 -03:00
mem2node.c libperf cpumap: Make index and nr types unsigned 2026-04-01 14:50:53 -07:00
mmap-basic.c perf tests: Sort includes and add missed explicit dependencies 2026-05-27 08:20:31 -03:00
mmap-thread-lookup.c perf machine: Explicitly pass in host perf_env 2025-07-25 10:37:57 -07:00
openat-syscall-all-cpus.c libperf cpumap: Make index and nr types unsigned 2026-04-01 14:50:53 -07:00
openat-syscall-tp-fields.c perf evsel: Refactor evsel tracepoint sample accessors perf_sample 2026-05-20 16:35:59 -03:00
openat-syscall.c perf thread_map: Remove uid options 2025-06-09 11:18:18 -07:00
parse-events.c perf test: Fix ratio_to_prev event parsing test 2026-04-02 12:51:10 -07:00
parse-metric.c perf test parse-metric: Ensure aggregate counts appear to have run 2026-02-08 11:30:01 -03:00
parse-no-sample-id-all.c perf session: Validate HEADER_ATTR attr.size before swapping 2026-05-29 11:44:32 -03:00
pe-file-parsing.c perf tools: Don't read build-ids from non-regular files 2025-11-26 10:13:38 -08:00
pe-file.c perf tests: Add test for PE binary format support 2020-09-04 14:38:15 -03:00
pe-file.exe perf tests: Add test for PE binary format support 2020-09-04 14:38:15 -03:00
pe-file.exe.debug perf tests: Add test for PE binary format support 2020-09-04 14:38:15 -03:00
perf-hooks.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
perf-record.c perf sample: Make sure perf_sample__init/exit are used 2026-04-05 23:12:15 -07:00
perf-targz-src-pkg perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
perf-time-to-tsc.c perf test: Switch cycles event to cpu-cycles 2025-10-15 23:59:12 +09:00
pfm.c perf auxtrace: Remove errno.h from auxtrace.h and fix transitive dependencies 2025-11-13 23:03:11 -08:00
pmu-events.c perf test pmu-events: A sub-test per metric table 2026-06-04 11:36:36 -03:00
pmu.c perf arm-spe: Don't warn about the discard bit if it doesn't exist 2026-05-29 21:20:50 -03:00
sample-parsing.c perf event: Fix size of synthesized sample with branch stacks 2026-05-20 16:11:30 -03:00
sdt.c perf tools: Don't read build-ids from non-regular files 2025-11-26 10:13:38 -08:00
sigtrap.c perf btf: Make the sigtrap test helper to find a member by name widely available 2024-12-09 17:52:41 -03:00
stat.c perf stat: Move stat_config into config.c 2024-12-18 16:24:32 -03:00
subcmd-help.c perf test subcmd help: Add exclude disjoint subcmd names 2026-01-12 15:57:23 -03:00
sw-clock.c perf tests sw-clock: Mark the volatile tmp variable as __maybe_unused 2026-01-20 20:49:53 -03:00
switch-tracking.c perf evlist: Try to avoid computing evsel from sample 2026-05-20 16:39:40 -03:00
symbols.c perf symbol: Add setters for bitfields sharing a byte to avoid concurrent update issues 2026-06-03 16:53:45 -03:00
task-exit.c perf target: Remove uid from target 2025-06-09 11:18:18 -07:00
tests-scripts.c perf test: Skip shebang and SPDX comments in shell test descriptions 2026-06-04 11:40:36 -03:00
tests-scripts.h perf tests: Run time generate shell test suites 2024-02-22 09:13:06 -08:00
tests.h perf test: Remove /usr/bin/cc dependency from Intel PT shell test 2026-06-04 11:41:46 -03:00
thread-map.c perf tools: Use calloc() where applicable 2026-04-08 19:21:05 -07:00
thread-maps-share.c perf maps: Hide maps internals 2024-02-12 12:35:41 -08:00
time-utils-test.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
tool_pmu.c perf tests: Fix Tool PMU test segfault 2025-02-12 19:34:56 -08:00
topology.c perf tests topology: Switch env->arch use to env->e_machine 2026-06-03 16:45:04 -03:00
uncore-event-sorting.c perf tests: Add test for uncore event sorting 2026-05-20 18:23:55 -03:00
unit_number__scnprintf.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
util.c perf test: Split monolithic 'util' test suite into sub-tests 2026-06-04 11:40:51 -03:00
vmlinux-kallsyms.c perf symbol: Add setters for bitfields sharing a byte to avoid concurrent update issues 2026-06-03 16:53:45 -03:00
wp.c perf tools: Make more global variables static 2026-04-08 19:21:04 -07:00