From: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
To: oleg@redhat.com, srikar@linux.vnet.ibm.com, rostedt@goodmis.org,
mhiramat@kernel.org
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
alexander.shishkin@linux.intel.com, jolsa@redhat.com,
namhyung@kernel.org, linux-kernel@vger.kernel.org,
corbet@lwn.net, linux-doc@vger.kernel.org,
ananth@linux.vnet.ibm.com, alexis.berlemont@gmail.com,
naveen.n.rao@linux.vnet.ibm.com,
Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Subject: [PATCH v4 2/9] Uprobe: Change set_swbp definition
Date: Wed, 20 Jun 2018 09:26:22 +0530 [thread overview]
Message-ID: <20180620035629.7844-3-ravi.bangoria@linux.ibm.com> (raw)
In-Reply-To: <20180620035629.7844-1-ravi.bangoria@linux.ibm.com>
Instead of arch_uprobe, pass uprobe object to set_swbp(). We need
this in later set of patches.
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
---
arch/arm/probes/uprobes/core.c | 4 ++--
arch/mips/kernel/uprobes.c | 4 ++--
include/linux/uprobes.h | 2 +-
kernel/events/uprobes.c | 6 +++---
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/arm/probes/uprobes/core.c b/arch/arm/probes/uprobes/core.c
index d1329f1..c678a5c 100644
--- a/arch/arm/probes/uprobes/core.c
+++ b/arch/arm/probes/uprobes/core.c
@@ -29,11 +29,11 @@ bool is_swbp_insn(uprobe_opcode_t *insn)
(UPROBE_SWBP_ARM_INSN & 0x0fffffff);
}
-int set_swbp(struct arch_uprobe *auprobe, struct mm_struct *mm,
+int set_swbp(struct uprobe *uprobe, struct mm_struct *mm,
unsigned long vaddr)
{
return uprobe_write_opcode(mm, vaddr,
- __opcode_to_mem_arm(auprobe->bpinsn));
+ __opcode_to_mem_arm(uprobe->arch.bpinsn));
}
bool arch_uprobe_ignore(struct arch_uprobe *auprobe, struct pt_regs *regs)
diff --git a/arch/mips/kernel/uprobes.c b/arch/mips/kernel/uprobes.c
index f7a0645..2aaa378 100644
--- a/arch/mips/kernel/uprobes.c
+++ b/arch/mips/kernel/uprobes.c
@@ -211,7 +211,7 @@ unsigned long arch_uretprobe_hijack_return_addr(
/**
* set_swbp - store breakpoint at a given address.
- * @auprobe: arch specific probepoint information.
+ * @uprobe: uprobe object.
* @mm: the probed process address space.
* @vaddr: the virtual address to insert the opcode.
*
@@ -221,7 +221,7 @@ unsigned long arch_uretprobe_hijack_return_addr(
* This version overrides the weak version in kernel/events/uprobes.c.
* It is required to handle MIPS16 and microMIPS.
*/
-int __weak set_swbp(struct arch_uprobe *auprobe, struct mm_struct *mm,
+int __weak set_swbp(struct uprobe *uprobe, struct mm_struct *mm,
unsigned long vaddr)
{
return uprobe_write_opcode(mm, vaddr, UPROBE_SWBP_INSN);
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h
index 0a294e9..60f4eb5e 100644
--- a/include/linux/uprobes.h
+++ b/include/linux/uprobes.h
@@ -115,7 +115,7 @@ struct uprobes_state {
struct xol_area *xol_area;
};
-extern int set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr);
+extern int set_swbp(struct uprobe *uprobe, struct mm_struct *mm, unsigned long vaddr);
extern int set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr);
extern bool is_swbp_insn(uprobe_opcode_t *insn);
extern bool is_trap_insn(uprobe_opcode_t *insn);
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 471eac8..e38c882 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -342,14 +342,14 @@ int uprobe_write_opcode(struct mm_struct *mm, unsigned long vaddr,
/**
* set_swbp - store breakpoint at a given address.
- * @auprobe: arch specific probepoint information.
+ * @uprobe: uprobe object.
* @mm: the probed process address space.
* @vaddr: the virtual address to insert the opcode.
*
* For mm @mm, store the breakpoint instruction at @vaddr.
* Return 0 (success) or a negative errno.
*/
-int __weak set_swbp(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long vaddr)
+int __weak set_swbp(struct uprobe *uprobe, struct mm_struct *mm, unsigned long vaddr)
{
return uprobe_write_opcode(mm, vaddr, UPROBE_SWBP_INSN);
}
@@ -666,7 +666,7 @@ static bool filter_chain(struct uprobe *uprobe,
if (first_uprobe)
set_bit(MMF_HAS_UPROBES, &mm->flags);
- ret = set_swbp(&uprobe->arch, mm, vaddr);
+ ret = set_swbp(uprobe, mm, vaddr);
if (!ret)
clear_bit(MMF_RECALC_UPROBES, &mm->flags);
else if (first_uprobe)
--
1.8.3.1
next prev parent reply other threads:[~2018-06-20 3:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-20 3:56 [PATCH v4 0/9] Uprobes: Support SDT markers having reference count (semaphore) Ravi Bangoria
2018-06-20 3:56 ` [PATCH v4 1/9] Uprobes: Simplify uprobe_register() body Ravi Bangoria
2018-06-20 3:56 ` Ravi Bangoria [this message]
2018-06-20 5:32 ` [PATCH v4 2/9] Uprobe: Change set_swbp definition kbuild test robot
2018-06-20 8:07 ` kbuild test robot
2018-06-20 3:56 ` [PATCH v4 3/9] Uprobe: Change set_orig_insn definition Ravi Bangoria
2018-06-20 3:56 ` [PATCH v4 4/9] Uprobe: Change uprobe_write_opcode definition Ravi Bangoria
2018-06-20 3:56 ` [PATCH v4 5/9] Uprobes: Support SDT markers having reference count (semaphore) Ravi Bangoria
2018-06-20 3:56 ` [PATCH v4 6/9] trace_uprobe/sdt: Prevent multiple reference counter for same uprobe Ravi Bangoria
2018-06-20 3:56 ` [PATCH v4 7/9] Uprobes/sdt: " Ravi Bangoria
2018-06-20 3:56 ` [PATCH v4 8/9] Uprobes/sdt: Document about reference counter Ravi Bangoria
2018-06-20 3:56 ` [PATCH v4 9/9] perf probe: Support SDT markers having reference counter (semaphore) Ravi Bangoria
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=20180620035629.7844-3-ravi.bangoria@linux.ibm.com \
--to=ravi.bangoria@linux.ibm.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=alexis.berlemont@gmail.com \
--cc=ananth@linux.vnet.ibm.com \
--cc=corbet@lwn.net \
--cc=jolsa@redhat.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=srikar@linux.vnet.ibm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®