Consider the following minimal example: ``` $ stap -e 'probe oneshot { println(usymname(0xdeadbeef)) }' -u /tmp/stapcgQk9g/stap_ca4ae4c5dee3b96fa22873c547018f71_10015_src.c: In function ‘function___global_print_ubacktrace__overload_0’: /tmp/stapcgQk9g/stap_ca4ae4c5dee3b96fa22873c547018f71_10015_src.c:1103:5: error: implicit declaration of function ‘_stp_stack_user_print’; did you mean ‘_stp_stat_per_cpu_ptr’? [-Werror=implicit-function-declaration] _stp_stack_user_print(CONTEXT, _STP_SYM_FULL); ^~~~~~~~~~~~~~~~~~~~~ _stp_stat_per_cpu_ptr /tmp/stapcgQk9g/stap_ca4ae4c5dee3b96fa22873c547018f71_10015_src.c: In function ‘function___global_sprint_ubacktrace__overload_0’: /tmp/stapcgQk9g/stap_ca4ae4c5dee3b96fa22873c547018f71_10015_src.c:1365:5: error: implicit declaration of function ‘_stp_stack_user_sprint’; did you mean ‘_stp_store_deref_string’? [-Werror=implicit-function-declaration] _stp_stack_user_sprint (STAP_RETVALUE, MAXSTRINGLEN, CONTEXT, ^~~~~~~~~~~~~~~~~~~~~~ _stp_store_deref_string /tmp/stapcgQk9g/stap_ca4ae4c5dee3b96fa22873c547018f71_10015_src.c: In function ‘function___private__opt_stap_old_share_systemtap_tapset_linux_ucontext_symbols_stp___ustack_raw__overload_0’: /tmp/stapcgQk9g/stap_ca4ae4c5dee3b96fa22873c547018f71_10015_src.c:2848:35: error: implicit declaration of function ‘_stp_stack_user_get’; did you mean ‘_stp_stat_get’? [-Werror=implicit-function-declaration] STAP_RETVALUE = _stp_stack_user_get (CONTEXT, (unsigned)STAP_ARG_n); ^~~~~~~~~~~~~~~~~~~ _stp_stat_get cc1: all warnings being treated as errors make[1]: *** [scripts/Makefile.build:324: /tmp/stapcgQk9g/stap_ca4ae4c5dee3b96fa22873c547018f71_10015_src.o] Error 1 make: *** [Makefile:1565: _module_/tmp/stapcgQk9g] Error 2 WARNING: kbuild exited with status: 2 Pass 4: compilation failed. [man error::pass4] ``` After removing the `-u` command-line option, this example works as expected immediately: ``` $ stap -e 'probe oneshot { println(usymname(0xdeadbeef)) }' 0xdeadbeef ``` Seems like use of `usymname()` brings in other unused tapset functions like `__ustack_raw` in the same tapset file (tapset/linux/ucontext-symbols.stp) but for some reasons, their `/* unwind */` pragma fails to set the `need_unwind` flag in the `systemtap_session` object.
OK, the following quick patch seems to fix this issue: https://pastebin.com/K1hyYXjq I'll prepare a formal patch to the mailing list for formal review :)
Already committed a fix to master via commit 0ff547ede.