From: Michael Ellerman <mpe@ellerman.id.au>
To: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>,
Ingo Molnar <mingo@kernel.org>
Cc: Anton Blanchard <anton@samba.org>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
Oleg Nesterov <oleg@redhat.com>,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Subject: Re: [PATCH] uprobe: Warn if unable to install breakpoint
Date: Fri, 01 Sep 2017 15:09:29 +1000 [thread overview]
Message-ID: <87r2vr57jq.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <20170831183215.4306-1-naveen.n.rao@linux.vnet.ibm.com>
"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> writes:
> When we try to install a uprobe breakpoint in uprobe_mmap(), we ignore
> all errors encountered in the process per this comment at the top of
> the function:
> /*
> * Called from mmap_region/vma_adjust with mm->mmap_sem acquired.
> *
> * Currently we ignore all errors and always return 0, the callers
> * can't handle the failure anyway.
> */
>
> However, this is very confusing for users since no probe hits are
> recorded nor is an error logged in dmesg.
>
> Fix this by logging an error in dmesg so that users can discover that
> there was an issue with the uprobe. To facilitate use of uprobe_warn(),
> we move that function to the top of the file.
>
> With this patch, we see a message similar to this in dmesg:
> [ 201.449213] uprobe: uprobe_t:9740 failed to setup probe at 0x95c (-524)
>
> Reported-by: Anton Blanchard <anton@samba.org>
> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> ---
> kernel/events/uprobes.c | 21 ++++++++++++++-------
> 1 file changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
> index 0e137f98a50c..587c591a535c 100644
> --- a/kernel/events/uprobes.c
> +++ b/kernel/events/uprobes.c
> @@ -112,6 +112,12 @@ struct xol_area {
> unsigned long vaddr; /* Page(s) of instruction slots */
> };
>
> +static void uprobe_warn(struct task_struct *t, const char *msg)
> +{
> + pr_warn("uprobe: %s:%d failed to %s\n",
> + current->comm, current->pid, msg);
That should probably be ratelimited no?
cheers
next prev parent reply other threads:[~2017-09-01 5:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-31 18:32 Naveen N. Rao
2017-09-01 5:09 ` Michael Ellerman [this message]
2017-09-13 19:16 ` Naveen N. Rao
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=87r2vr57jq.fsf@concordia.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=anton@samba.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mingo@kernel.org \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=oleg@redhat.com \
--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®