Some misc minor kprobes porting issues
Quentin Barnes
qbarnes@urbana.css.mot.com
Wed Apr 11 06:15:00 GMT 2007
I bumped into several issues while doing my ARM kprobes port.
Most I've brought up on the list before. Below are a couple minor
ones that deal with kprobes in general that I hadn't previously
mentioned. I'm listing them here in hopes of spawning a little
discussion when people are bored.
flush_insn_slot()
=================
Every architecture except sparc64 has this set to an empty do/while
macro.
This macro is only used by add_aggr_kprobe() after a copy_kprobe().
Copy_probe() duplicates "arch_specific_insn" contents. That means
this macro is only useful in the case where an architecture stores
the executable instruction directly in the arch_specific_insn data
structure. (Hence it is a very poorly named macro.) This is
only done on architectures that have Harvard caches and not using
instruction slots.
What I'd recommend the macro be renamed to something more
appropriate like "flush_arch_specific_insn()".
I would also further recommend that the one line statement in
add_aggr_kprobe() using the macro be #ifndef'd out based on
__ARCH_WANT_KPROBES_INSN_SLOT and let everyone else not needing
the poorly named macro just delete it from their kprobes.h.
register_die_notifier()
=======================
The call to register_die_notifier() by init_kprobes() is pointless for
ARM. We currently have a dummy function for register_die_notifier().
Kprobes for ARM uses an undefined instruction to trigger its exception
and ARM already has its own handler for undefs apart of the die
handler.
I'd recommend that the die registration call be moved from the
generic init_kprobes() function into the architecture-specific
arch_init_kprobes() functions.
Quentin
More information about the Systemtap
mailing list