1

I followed instructions provided by the existing Stackoverflow question/answer Building Perf with Babeltrace (for Perf to CTF Conversion)

Building linux/tools/perf with Babeltrace conversion support fails with the following error:

LINK perf libperf.a(libperf-in.o): In function event_class_add_field: /tools/perf/util/data-convert-bt.c:988: undefined reference to bt_ctf_validate_identifier collect2: error: ld returned 1 exit status Makefile.perf:567: recipe for target 'perf' failed

I tried building linux/tools/perf with Babeltrace installed from packages on Debian Linux distribution and also building Babeltrace from source code.

In both cases, Babeltrace was successfully installed and available before an attempt at building linux/tools/perf with Babeltrace CTF support.

Harsh Patel
  • 6,334
  • 10
  • 40
  • 73
  • 1
    Babeltrace built from source code, git tag -l displays: v2.0.0-pre4 – ss_programming Jan 02 '19 at 00:11
  • I get the same error when building linux/tools/perf on Linux source code versions 4.20 and 4.15.0. – ss_programming Jan 02 '19 at 00:19
  • Building linux/tools/perf with: `NO_LIBBABELTRACE=1 make` Results in a working perf binary. – ss_programming Jan 02 '19 at 00:23
  • Can you try to build with older version of Babeltrace, with checking that this version has `bt_ctf_validate_identifier` function? For example you may try versions from 2017 when the question https://stackoverflow.com/questions/43576997/ was asked or v1.5.6 or v1.5.3. Where is the git of babeltrace? The function `bt_ctf_validate_identifier` was added in 2015 [654c1444](https://github.com/efficios/babeltrace/commit/654c1444b546fd79b209288b93ed4e87d9bb8a2b) to `formats/ctf/ir/utils.c` file which is part of v1.5.6 but not 2.0.0. – osgx Jan 04 '19 at 08:35

1 Answers1

0

bt_ctf_validate_identifier function seems to be defined and implemented only in 1.5 branch of the babeltrace, not in 2.0 (v2.0.0-pre4)

https://github.com/efficios/babeltrace/blob/stable-1.5/formats/ctf/ir/utils.c https://github.com/efficios/babeltrace/blob/v1.5.6/formats/ctf/ir/utils.c

75   int bt_ctf_validate_identifier(const char *input_string)

Try to recompile and reinstall babeltrace from git tag v1.5.6 and then clean and recompile perf with this version.

perf tool from linux kernel versions 4.15 - 4.20 seems to be written for stable-1.5 branches of the babeltrace.

osgx
  • 90,338
  • 53
  • 357
  • 513