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

Ingo Molnar
2006-09-25T15:47:25Z

[-- Attachment #1: Type: text/plain, Size: 716 bytes --]

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 <76306.1226@compuserve.com> wrote:

> In-Reply-To: <20060918151713.GA11495@elte.hu>
>
> 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

[-- Attachment #2: noop_kprobe.c --]
[-- Type: text/plain, Size: 1014 bytes --]

/*
* no-op kprobe handler
* Copyright (c) 2005 Hitachi,Ltd.,
* Created by Masami Hiramatsu<hiramatu@sdl.hitachi.co.jp>
*/
#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);