• Masami Hiramatsu's avatar
    kprobes: support probing module __exit function · e8386a0c
    Masami Hiramatsu authored
    
    
    Allows kprobes to probe __exit routine.  This adds flags member to struct
    kprobe.  When module is freed(kprobes hooks module_notifier to get this
    event), kprobes which probe the functions in that module are set to "Gone"
    flag to the flags member.  These "Gone" probes are never be enabled.
    Users can check the GONE flag through debugfs.
    
    This also removes mod_refcounted, because we couldn't free a module if
    kprobe incremented the refcount of that module.
    
    [akpm@linux-foundation.org: document some locking]
    [mhiramat@redhat.com: bugfix: pass aggr_kprobe to arch_remove_kprobe]
    [mhiramat@redhat.com: bugfix: release old_p's insn_slot before error return]
    Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
    Acked-by: default avatarAnanth N Mavinakayanahalli <ananth@in.ibm.com>
    Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
    Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torva...
    e8386a0c
kprobes.txt 20.9 KB