This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH -mm 2/2] kprobes: add tests for register_kprobes
- From: Jim Keniston <jkenisto at us dot ibm dot com>
- To: Masami Hiramatsu <mhiramat at redhat dot com>
- Cc: Andrew Morton <akpm at linux-foundation dot org>, Ananth N Mavinakayanahalli <ananth at in dot ibm dot com>, David Miller <davem at davemloft dot net>, systemtap-ml <systemtap at sources dot redhat dot com>, LKML <linux-kernel at vger dot kernel dot org>
- Date: Fri, 06 Jun 2008 17:36:26 -0700
- Subject: Re: [PATCH -mm 2/2] kprobes: add tests for register_kprobes
- References: <484944CA.902@redhat.com>
On Fri, 2008-06-06 at 10:08 -0400, Masami Hiramatsu wrote:
> Add testcases for *probe batch registration (register_kprobes)
> to kprobes sanity tests.
>
> Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
> CC: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
> CC: Jim Keniston <jkenisto@us.ibm.com>
> CC: David Miller <davem@davemloft.net>
> ---
> ...
> +
> +static int test_kprobes(void)
> +{
> + int ret;
> + struct kprobe *kps[2] = {&kp, &kp2};
preh_val and posth_val are being reused after test_kprobe(), which sets
them to non-zero values. Seems like you want to reinitialize them here
as well as below.
Ditto jph_val for jprobes and krph_val for kretprobes.
Ack otherwise.
Jim
+
> + ret = register_kprobes(kps, 2);
> + if (ret < 0) {
> + printk(KERN_ERR "Kprobe smoke test failed: "
> + "register_kprobes returned %d\n", ret);
> + return ret;
> + }
> +
> + ret = target(rand1);
> +
> + if (preh_val == 0) {
> + printk(KERN_ERR "Kprobe smoke test failed: "
> + "kprobe pre_handler not called\n");
> + handler_errors++;
> + }
> +
> + if (posth_val == 0) {
> + printk(KERN_ERR "Kprobe smoke test failed: "
> + "kprobe post_handler not called\n");
> + handler_errors++;
> + }
> +
> + preh_val = 0;
> + posth_val = 0;
> + ret = target2(rand1);
> ...