isotop

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • isotop
    Participant

    Hello.

    I had faced the same problems on SAMA5 development board with “kgdboe” module and I have found solution, which allows me to debug target with GDB.

    The issue was in that the wrapper “register_tracepoint_wrapper” makes a call to “kallsyms_lookup_name” with argument equal to “__tracepoint_netif_receive_skb”.
    But for some reason the symbol “__tracepoint_netif_receive_skb” is not present in the kernel symbol table. Due to symbol absence the function “kallsyms_lookup_name”
    returns NULL-pointer and “tracepoint_probe_register” tries to dereference NULL-pointer. Fortunately there is “__tracepoint_ptr_netif_receive_skb” symbol in kernel symbol
    table and it contains pointer to “__tracepoint_netif_receive_skb”.
    So the solution is to modify wrappers to next form:

    #define register_tracepoint_wrapper(tp, func, ctx) \
    tracepoint_probe_register(*(struct tracepoint **)kallsyms_lookup_name(“__tracepoint_ptr_” #tp), func, ctx)

    #define unregister_tracepoint_wrapper(tp, func, ctx) \
    tracepoint_probe_unregister(*(struct tracepoint **)kallsyms_lookup_name(“__tracepoint_ptr_” #tp), func, ctx)

Viewing 1 post (of 1 total)