• Naveen N. Rao's avatar
    powerpc/kprobes: Convert __kprobes to NOKPROBE_SYMBOL() · 71f6e58e
    Naveen N. Rao authored
    Along similar lines as commit 9326638c ("kprobes, x86: Use NOKPROBE_SYMBOL()
    instead of __kprobes annotation"), convert __kprobes annotation to either
    NOKPROBE_SYMBOL() or nokprobe_inline. The latter forces inlining, in which case
    the caller needs to be added to NOKPROBE_SYMBOL().
    
    Also:
     - blacklist arch_deref_entry_point(), and
     - convert a few regular inlines to nokprobe_inline in lib/sstep.c
    
    A key benefit is the ability to detect such symbols as being
    blacklisted. Before this patch:
    
      $ cat /sys/kernel/debug/kprobes/blacklist | grep read_mem
      $ perf probe read_mem
      Failed to write event: Invalid argument
        Error: Failed to add events.
      $ dmesg | tail -1
      [ 3736.112815] Could not insert probe at _text+10014968: -22
    
    After patch:
      $ cat /sys/kernel/debug/kprobes/blacklist | grep read_mem
      0xc000000000072b50-0xc000000000072d20	read_mem
      $ perf probe read_mem
      read_mem is blacklisted function, skip it.
      Added new events:
        (null):(...
    71f6e58e
sstep.c 43.4 KB