For ALT Linux I try to build trace-cmd with libtraceevent as external package. And there is build error: ``` builder@i586:~/RPM/BUILD/trace-cmd-2.9.6/python$ gcc -fpic -c -pipe -frecord-gcc-switches -Wall -fdiagnostics-color=always -fdiagnostics-color=always -fdiagnostics-color=always -g -O2 -march=i586 -mtune=generic -Wno-unused-result -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DVSOCK -D_GNU_SOURCE -I/usr/src/RPM/BUILD/trace-cmd-2.9.6/include -I/usr/src/RPM/BUILD/trace-cmd-2.9.6/../../include -I/usr/src/RPM/BUILD/trace-cmd-2.9.6/include/trace-cmd -I/usr/src/RPM/BUILD/trace-cmd-2.9.6/lib/trace-cmd/include -I/usr/src/RPM/BUILD/trace-cmd-2.9.6/lib/trace-cmd/include/private -I/usr/src/RPM/BUILD/trace-cmd-2.9.6/tracecmd/include -I/usr/include/traceevent -Dwarning=tep_warning -Dpr_info=tep_info -I/usr/include/tracefs -I/usr/include/traceevent -DVAR_DIR="/var" '-DPLUGIN_TRACEEVENT_DIR="/usr/lib/traceevent/plugins"' '-DPLUGIN_TRACECMD_DIR=""' -DHAVE_BLK_TC_FLUSH `pkg-config --cflags python3` ctracecmd_wrap.c ctracecmd_wrap.c: In function 'tep_info': ctracecmd_wrap.c:2779:9: warning: implicit declaration of function '__vpr_info'; did you mean 'pr_info'? [-Wimplicit-function-declaration] 2779 | __vpr_info(fmt, ap); | ^~~~~~~~~~ | pr_info ctracecmd_wrap.c: In function 'tep_warning': ctracecmd_wrap.c:2791:9: warning: implicit declaration of function '__vwarning'; did you mean 'tep_vwarning'? [-Wimplicit-function-declaration] 2791 | __vwarning(fmt, ap); | ^~~~~~~~~~ | tep_vwarning ctracecmd_wrap.c: In function 'python_callback': ctracecmd_wrap.c:3910:9: warning: 'PyEval_CallObjectWithKeywords' is deprecated [-Wdeprecated-declarations] 3910 | result = PyEval_CallObject(context, arglist); | ^~~~~~ In file included from /usr/include/python3.9/Python.h:141, from ctracecmd_wrap.c:154: /usr/include/python3.9/ceval.h:17:43: note: declared here 17 | Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords( | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ctracecmd_wrap.c: In function '_wrap_tep_print_arg_string_offset_set': ctracecmd_wrap.c:7208:19: error: 'struct tep_print_arg_string' has no member named 'offset' 7208 | if (arg1) (arg1)->offset = arg2; | ^~ ctracecmd_wrap.c: In function '_wrap_tep_print_arg_string_offset_get': ctracecmd_wrap.c:7231:25: error: 'struct tep_print_arg_string' has no member named 'offset' 7231 | result = (int) ((arg1)->offset); | ^~ ctracecmd_wrap.c: In function '_wrap_tep_print_arg_bitmask_offset_set': ctracecmd_wrap.c:7356:19: error: 'struct tep_print_arg_bitmask' has no member named 'offset' 7356 | if (arg1) (arg1)->offset = arg2; | ^~ ctracecmd_wrap.c: In function '_wrap_tep_print_arg_bitmask_offset_get': ctracecmd_wrap.c:7379:25: error: 'struct tep_print_arg_bitmask' has no member named 'offset' 7379 | result = (int) ((arg1)->offset); | ^~ ``` It seems that `struct tep_print_arg_string` in libtraceevent 1.5.0 is defined as struct tep_print_arg_string { char *string; struct tep_format_field *field; }; But trace-cmd 2.9.6 expects: struct tep_print_arg_string { char *string; int offset; };
I tried to build trace-cmd, libtraceevent, and libtracefs using latest versions available in git repos, is that wrong? Did I miss something?
Thanks for reporting this. You are right. I usually test to make sure the stable versions of trace-cmd still build, I must have missed this. I'll have to figure out how to fix this. -- Steve
Created attachment 300309 [details] libtraceevent: Fix backward compatibility with tep_print_arg_string It appears that trace-cmd 2.9.6 referenced the tep_print_arg_string to get to the offset, which was removed by libtraceevent commit 512d7be1 ("libtraceevent: Add __rel_loc relative location attribute support"). Add the offset back to both tep_print_arg_string and to tep_print_arg_bitmask (yeah, it adds a hole in the structure), for backward compatibility.
Created attachment 300310 [details] libtraceevent: Fix backward compatibility with tep_print_arg_string It appears that trace-cmd 2.9.6 referenced the tep_print_arg_string to get to the offset, which was removed by libtraceevent commit 512d7be1 ("libtraceevent: Add __rel_loc relative location attribute support"). Add the offset back to both tep_print_arg_string and to tep_print_arg_bitmask (yeah, it adds a hole in the structure), for backward compatibility. -- v2 - I accidentally added unrelated changes to the previous patch.
(In reply to Vitaly Chikunov from comment #1) > I tried to build trace-cmd, libtraceevent, and libtracefs using latest > versions available in git repos, is that wrong? Did I miss something? I uploaded a patch to be applied to libtraceevent 1.5.0. Can you add that and see if it fixes the issue for you? Thanks, -- Steve
After applying this patch to libtraceevent, trace-cmd compiles successfully. Thanks!
Fixed by https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/commit/?id=cc7e61b351a532838b1e40010f7e93b66ef7d0f5