From: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
To: Thomas Richter <tmricht@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
gor@linux.ibm.com, sumanthk@linux.ibm.com,
heiko.carstens@de.ibm.com
Subject: Re: [PATCH v2] perf test: Fix test trace+probe_vfs_getname.sh
Date: Fri, 31 Jan 2020 09:36:19 +0100 [thread overview]
Message-ID: <20200131083619.GG3841@kernel.org> (raw)
In-Reply-To: <20200120132011.64698-3-tmricht@linux.ibm.com>
Em Mon, Jan 20, 2020 at 02:20:11PM +0100, Thomas Richter escreveu:
> This test places a kprobe to function getname_flags() in the kernel
> which has the following prototype:
>
> struct filename *
> getname_flags(const char __user *filename, int flags, int *empty)
>
> Variable filename points to a filename located in user space memory.
> Looking at
> commit 88903c464321c ("tracing/probe: Add ustring type for user-space string")
> the kprobe should indicate that user space memory is accessed.
We can't just replace it, right? I.e. this should continue to work with
older kernels, i.e. the latest userspace tooling version should work
when installed in an older kernel, i.e. please just add more fallbacks
to cover the new cases.
- Arnaldo
> Fix this with a patch to specify user space memory access to
> parameter 'filename' and 'string' is replaced by 'ustring'.
>
> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
> ---
> tools/perf/tests/shell/lib/probe_vfs_getname.sh | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/tests/shell/lib/probe_vfs_getname.sh b/tools/perf/tests/shell/lib/probe_vfs_getname.sh
> index 7cb99b433888..7ecf117651dd 100644
> --- a/tools/perf/tests/shell/lib/probe_vfs_getname.sh
> +++ b/tools/perf/tests/shell/lib/probe_vfs_getname.sh
> @@ -13,8 +13,8 @@ add_probe_vfs_getname() {
> local verbose=$1
> if [ $had_vfs_getname -eq 1 ] ; then
> line=$(perf probe -L getname_flags 2>&1 | egrep 'result.*=.*filename;' | sed -r 's/[[:space:]]+([[:digit:]]+)[[:space:]]+result->uptr.*/\1/')
> - perf probe -q "vfs_getname=getname_flags:${line} pathname=result->name:string" || \
> - perf probe $verbose "vfs_getname=getname_flags:${line} pathname=filename:string"
> + perf probe -q "vfs_getname=getname_flags:${line} pathname=result->uptr:ustring" || \
> + perf probe $verbose "vfs_getname=getname_flags:${line} pathname=filename:ustring"
> fi
> }
>
> --
> 2.21.0
>
--
- Arnaldo
next prev parent reply other threads:[~2020-01-31 8:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-20 13:20 [PATCH v2] perf test: Fix test case Merge cpu map Thomas Richter
2020-01-20 13:20 ` [PATCH v2] perf probe: Add ustring support for perf probe command Thomas Richter
2020-02-05 15:45 ` [tip: perf/urgent] " tip-bot2 for Thomas Richter
2020-01-20 13:20 ` [PATCH v2] perf test: Fix test trace+probe_vfs_getname.sh Thomas Richter
2020-01-31 8:36 ` Arnaldo Carvalho de Melo [this message]
2020-02-05 15:45 ` [tip: perf/urgent] perf test: Fix test case Merge cpu map tip-bot2 for Thomas Richter
-- strict thread matches above, loose matches on Subject: below --
2020-02-03 12:48 [PATCH v2] perf test: Fix test trace+probe_vfs_getname.sh Thomas Richter
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=20200131083619.GG3841@kernel.org \
--to=arnaldo.melo@gmail.com \
--cc=gor@linux.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=sumanthk@linux.ibm.com \
--cc=tmricht@linux.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