All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, ananth@in.ibm.com, hpa@zytor.com,
	mingo@redhat.com, masami.hiramatsu.pt@hitachi.com,
	rusty@rustcorp.com.au, tglx@linutronix.de, mingo@elte.hu
Subject: [tip:perf/core] kprobes: Fix selftest to clear flags field for reusing probes
Date: Thu, 14 Oct 2010 07:40:22 GMT	[thread overview]
Message-ID: <tip-fd02e6f7ae085840d43d780149fcf95a614eca5e@git.kernel.org> (raw)
In-Reply-To: <20101014031024.4100.50107.stgit@ltc236.sdl.hitachi.co.jp>

Commit-ID:  fd02e6f7ae085840d43d780149fcf95a614eca5e
Gitweb:     http://git.kernel.org/tip/fd02e6f7ae085840d43d780149fcf95a614eca5e
Author:     Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
AuthorDate: Thu, 14 Oct 2010 12:10:24 +0900
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 14 Oct 2010 08:55:27 +0200

kprobes: Fix selftest to clear flags field for reusing probes

Fix selftest to clear flags field for reusing probes
because the flags field can be modified by Kprobes.
This also set NULL to kprobe.addr instead of 0.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: 2nddept-manager@sdl.hitachi.co.jp
LKML-Reference: <20101014031024.4100.50107.stgit@ltc236.sdl.hitachi.co.jp>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/test_kprobes.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/kernel/test_kprobes.c b/kernel/test_kprobes.c
index 4f10451..f8b11a2 100644
--- a/kernel/test_kprobes.c
+++ b/kernel/test_kprobes.c
@@ -115,7 +115,9 @@ static int test_kprobes(void)
 	int ret;
 	struct kprobe *kps[2] = {&kp, &kp2};
 
-	kp.addr = 0; /* addr should be cleard for reusing kprobe. */
+	/* addr and flags should be cleard for reusing kprobe. */
+	kp.addr = NULL;
+	kp.flags = 0;
 	ret = register_kprobes(kps, 2);
 	if (ret < 0) {
 		printk(KERN_ERR "Kprobe smoke test failed: "
@@ -210,7 +212,9 @@ static int test_jprobes(void)
 	int ret;
 	struct jprobe *jps[2] = {&jp, &jp2};
 
-	jp.kp.addr = 0; /* addr should be cleard for reusing kprobe. */
+	/* addr and flags should be cleard for reusing kprobe. */
+	jp.kp.addr = NULL;
+	jp.kp.flags = 0;
 	ret = register_jprobes(jps, 2);
 	if (ret < 0) {
 		printk(KERN_ERR "Kprobe smoke test failed: "
@@ -323,7 +327,9 @@ static int test_kretprobes(void)
 	int ret;
 	struct kretprobe *rps[2] = {&rp, &rp2};
 
-	rp.kp.addr = 0; /* addr should be cleard for reusing kprobe. */
+	/* addr and flags should be cleard for reusing kprobe. */
+	rp.kp.addr = NULL;
+	rp.kp.flags = 0;
 	ret = register_kretprobes(rps, 2);
 	if (ret < 0) {
 		printk(KERN_ERR "Kprobe smoke test failed: "

  reply	other threads:[~2010-10-14  7:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-14  3:10 [PATCH -tip 0/5] Kprobes updates Masami Hiramatsu
2010-10-14  3:10 ` [PATCH -tip 1/5] [RESEND] kprobes: Update document about irq disabled state in kprobe handler Masami Hiramatsu
2010-10-14  7:39   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2010-10-14  3:10 ` [PATCH -tip 2/5] [RESEND][BUGFIX] kprobes: Fix selftest to clear flags field for reusing probes Masami Hiramatsu
2010-10-14  7:40   ` tip-bot for Masami Hiramatsu [this message]
2010-10-14  3:10 ` [PATCH -tip 3/5] Define __stop_machine when CONFIG_STOP_MACHINE=n Masami Hiramatsu
2010-10-14  5:00   ` Tejun Heo
2010-10-14  7:40   ` [tip:perf/core] stopmachine: " tip-bot for Masami Hiramatsu
2010-10-14  3:10 ` [PATCH -tip 4/5] [BUGFIX] x86: Use __stop_machine() in text_poke_smp() Masami Hiramatsu
2010-10-14  7:41   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2010-10-14  3:10 ` [PATCH -tip 5/5] [BUGFIX] kconfig/x86: Add HAVE_TEXT_POKE_SMP config for stop_machine dependency Masami Hiramatsu
2010-10-14  7:41   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2010-10-14  6:52 ` [PATCH -tip 0/5] Kprobes updates Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-fd02e6f7ae085840d43d780149fcf95a614eca5e@git.kernel.org \
    --to=masami.hiramatsu.pt@hitachi.com \
    --cc=ananth@in.ibm.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=rusty@rustcorp.com.au \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.