Playing around with kprobe I noticed, that "kprobing"
the function "do_gettimeofday" completly freezes the
system (2.6.12-rc3). Other functions like "do_fork" or
"do_settimeofday" are doing well.
Does anybody know the reason for it?
Juergen.
=================================
// BEWARE: THIS CODE MAY FREEZE YOUR SYSTEM
#include <linux/module.h>
#include <linux/kprobes.h>
#include <linux/kallsyms.h>
static int call_count = 0;
static int pre_probe(struct kprobe *p, struct pt_regs *regs)
{
++call_count;
return 0;
}
static struct kprobe kp = {
.pre_handler = pre_probe,
.post_handler = NULL,
.fault_handler = NULL,
.addr = (kprobe_opcode_t *) NULL,
};
static int __init probe_init(void)
{
kp.addr = (kprobe_opcode_t *) kallsyms_lookup_name("do_gettimeofday");
if (kp.addr == NULL) {
printk("kallsyms_lookup_name could not find address"
"for the specified symbol name\n");
return 1;
}
register_kprobe(&kp);
printk("kprobe registered address %p\n", kp.addr);
return 0;
}
static void __exit probe_exit(void)
{
unregister_kprobe(&kp);
printk("do_gettimeofday() called %d times.\n", call_count);
}
module_init( probe_init );
module_exit( probe_exit );
MODULE_LICENSE("GPL");
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]