Re: [PATCH 0/11] LTTng-core (basic tracing infrastructure) 0.5.108

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chuck,

i cannot email you because the mail always bounces ...

the kprobes benchmark is a simple "NOP" function:

 static int counter = 0;

 static int probe_pre_handler (struct kprobe * kp,
                               struct pt_regs * regs)
 {
         counter++;
         return 0;
 }

i've attached it.

	Ingo

* Chuck Ebbert <[email protected]> wrote:

> In-Reply-To: <[email protected]>
> 
> On Mon, 18 Sep 2006 17:17:13 +0200, Ingo Molnar wrote:
> 
> > yeah - and i dont think the kprobes overhead is a fundamental thing - i 
> > posted a few kprobes-speedup patches as a reply to your measurements.
> 
> Where is the source code for the kprobes benchmarks you used?
> 
> -- 
> Chuck
/*
 * no-op kprobe handler
 * Copyright (c) 2005 Hitachi,Ltd.,
 * Created by Masami Hiramatsu<[email protected]>
 */
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/kprobes.h>

MODULE_AUTHOR("M.Hiramatsu");
MODULE_LICENSE("GPL");

static unsigned long addr = 0;
module_param(addr, ulong, 0444);

static struct kprobe kp;
static int counter=0;

static int probe_pre_handler (struct kprobe * kp,
			      struct pt_regs * regs)
{
	counter++;
	return 0;
}

static int install_probe(void) 
{
	int ret = -10000;
	if (addr) {
		kp.pre_handler = probe_pre_handler;
		kp.addr = (void *)addr;
		printk("probe install to %p\n", (void*)addr);
		ret = register_kprobe(&kp);
	}
	if (ret) {
		printk("probe install error: %d\n",ret);
	}
	return ret;
}

static void uninstall_probe(void)
{
	if (kp.addr) {
		printk("uninstall from %p\n", (void*)kp.addr);
		unregister_kprobe(&kp);
	}
	printk("count:%d\n",counter);
}

module_init(install_probe);
module_exit(uninstall_probe);

[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]
  Powered by Linux