SUSE / clang-extract

Other
7 stars 3 forks source link

Undeclared identifier on net/tls/tls_device.c, same issue as #11 #24

Closed marcosps closed 1 month ago

marcosps commented 1 month ago

When extracting code from codestream 15.2u36 onwards, clang-extract failes to rename some tracepoints from tls_device_resync_rx, and maybe others too. I can't reproduce the same behavior on upstream kernel, but the problem seems similar to #11.

/home/mpdesouza/kgr/data/x86_64/usr/src/linux-5.3.18-150200.24.151/net/tls/tls_device.c:430:27: error: use of undeclared identifier '__tracepoint_tls_device_rx_resync_nh_delay'; did you mean 'klpe___tracepoint_tls_device_rx_resync_nh_delay'?                               
  430 |                 typeof ((&__tracepoint_tls_device_rx_resync_nh_delay)->funcs) ________p1 = ({                                                                                                                                                                           
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                                    
      |                           klpe___tracepoint_tls_device_rx_resync_nh_delay   

The problem happens when trying to extract symbols tls_device_rx_resync_new_rec and tls_dev_event from file net/tls/tls_device.c on codestream 15.2u36. I can help reproducing if you want.

giulianobelinassi commented 1 month ago

Is this in a macro? This looks like a bug in the SymbolExternalizer at first look.

marcosps commented 1 month ago

Is this in a macro? This looks like a bug in the SymbolExternalizer at first look.

Yes, this is the result of the macro TRACE_EVENT, which is resolved into __DEFINE_TRACE on include/linux/tracepoint.h, and this macro declares the trace_<tracepoint_name> functions.