This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tapsets/23599] New: Use of usymname() with stap -u leads to kernel module compilation errors


https://sourceware.org/bugzilla/show_bug.cgi?id=23599

            Bug ID: 23599
           Summary: Use of usymname() with stap -u leads to kernel module
                    compilation errors
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tapsets
          Assignee: systemtap at sourceware dot org
          Reporter: agentzh at gmail dot com
  Target Milestone: ---

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]