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

From: Ingo Molnar
Date: Mon Sep 25 2006 - 11:47:48 EST



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@xxxxxxxxxxxxxx> wrote:

> In-Reply-To: <20060918151713.GA11495@xxxxxxx>
>
> 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<hiramatu@xxxxxxxxxxxxxxxxx>
*/
#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);