From: Hemant Kumar <hemant@linux.vnet.ibm.com>
To: Alexis Berlemont <alexis.berlemont@gmail.com>,
linux-kernel@vger.kernel.org
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
alexander.shishkin@linux.intel.com
Subject: Re: [PATCH 2/2] perf probe: add sdt probes arguments into the uprobe cmd string
Date: Thu, 17 Nov 2016 14:34:05 +0530 [thread overview]
Message-ID: <52251cbe-6825-1d03-7b5b-e7517549caa0@linux.vnet.ibm.com> (raw)
In-Reply-To: <20161116235601.13433-3-alexis.berlemont@gmail.com>
Hi Alexis,
On 11/17/2016 05:26 AM, Alexis Berlemont wrote:
> An sdt probe can be associated with arguments but they were not passed
> to the user probe tracing interface (uprobe_events); this patch adapts
> the sdt argument descriptors according to the uprobe input format.
>
> As the uprobe parser does not support scaled address mode, perf will
> skip arguments which cannot be adapted to the uprobe format.
>
> Here are the results:
>
> $ perf buildid-cache -v --add test_sdt
> $ perf probe -x test_sdt sdt_libfoo:table_frob
> $ perf probe -x test_sdt sdt_libfoo:table_diddle
> $ perf record -e sdt_libfoo:table_frob -e sdt_libfoo:table_diddle test_sdt
> $ perf script
> test_sdt ... 666.255678: sdt_libfoo:table_frob: (4004d7) arg0=0 arg1=0
> test_sdt ... 666.255683: sdt_libfoo:table_diddle: (40051a) arg0=0 arg1=0
> test_sdt ... 666.255686: sdt_libfoo:table_frob: (4004d7) arg0=1 arg1=2
> test_sdt ... 666.255689: sdt_libfoo:table_diddle: (40051a) arg0=3 arg1=4
> test_sdt ... 666.255692: sdt_libfoo:table_frob: (4004d7) arg0=2 arg1=4
> test_sdt ... 666.255694: sdt_libfoo:table_diddle: (40051a) arg0=6 arg1=8
Cool! Thanks for working on this.
I have a comment below.
> Signed-off-by: Alexis Berlemont <alexis.berlemont@gmail.com>
> ---
> tools/perf/util/probe-file.c | 176 ++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 172 insertions(+), 4 deletions(-)
>
> diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
> index 436b647..a97a170 100644
> --- a/tools/perf/util/probe-file.c
> +++ b/tools/perf/util/probe-file.c
> @@ -28,6 +28,46 @@
> #include "probe-file.h"
> #include "session.h"
>
> +#ifdef HAVE_GELF_GETNOTE_SUPPORT
> +
> +/*
> + * Local declarations needed for adjusting gcc/gas-generated registers
> + * before filling the uprobe tracer interface.
> + */
> +
> +struct sdt_reg_renaming {
> + const char *sdt_name;
> + const char *uprobe_name;
> +};
> +
> +#define REG_RENAMING(n, m) {.sdt_name = "%" #n, .uprobe_name = "%" #m}
> +#define REG_RENAMING_END {.sdt_name = NULL, .uprobe_name = NULL}
> +
> +static const struct sdt_reg_renaming sdt_reg_renaming_table[] = {
> + REG_RENAMING(eax, ax),
> + REG_RENAMING(rax, ax),
> + REG_RENAMING(ebx, bx),
> + REG_RENAMING(rbx, bx),
> + REG_RENAMING(ecx, cx),
> + REG_RENAMING(rcx, cx),
> + REG_RENAMING(edx, dx),
> + REG_RENAMING(rdx, dx),
> + REG_RENAMING(esi, si),
> + REG_RENAMING(rsi, si),
> + REG_RENAMING(edi, di),
> + REG_RENAMING(rdi, di),
> + REG_RENAMING(ebp, bp),
> + REG_RENAMING(rbp, bp),
> + REG_RENAMING_END,
> +};
Please put the above in arch helper headers for x86, as these register
names and their conversions are specific to x86.
[SNIP]
--
Thanks,
Hemant Kumar
next prev parent reply other threads:[~2016-11-17 9:04 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-16 23:55 [PATCH 0/2] perf: add support of SDT probes arguments Alexis Berlemont
2016-11-16 23:56 ` [PATCH 1/2] perf sdt: add scanning of sdt probles arguments Alexis Berlemont
2016-11-16 23:56 ` [PATCH 2/2] perf probe: add sdt probes arguments into the uprobe cmd string Alexis Berlemont
2016-11-17 9:04 ` Hemant Kumar [this message]
2016-11-18 23:56 ` [PATCH v2 0/2] " Alexis Berlemont
2016-11-18 23:56 ` [PATCH v2 1/2] perf sdt: add scanning of sdt probles arguments Alexis Berlemont
2016-11-25 14:40 ` Arnaldo Carvalho de Melo
2016-11-26 0:58 ` [PATCH v4 0/2] perf probe: add sdt probes arguments into the uprobe cmd string Alexis Berlemont
2016-12-05 23:42 ` Alexis Berlemont
2016-12-06 14:45 ` Arnaldo Carvalho de Melo
2016-11-26 0:58 ` [PATCH v4 1/2] perf sdt: add scanning of sdt probles arguments Alexis Berlemont
2016-12-07 2:44 ` Masami Hiramatsu
2016-11-26 0:58 ` [PATCH v4 2/2] perf probe: add sdt probes arguments into the uprobe cmd string Alexis Berlemont
2016-12-07 3:26 ` Masami Hiramatsu
2016-12-09 15:14 ` Arnaldo Carvalho de Melo
2016-12-10 10:00 ` Masami Hiramatsu
2016-12-14 0:07 ` [PATCH v5 0/2] " Alexis Berlemont
2016-12-14 7:36 ` Ingo Molnar
2017-01-23 11:23 ` Ravi Bangoria
2017-02-22 22:41 ` Alexis Berlemont
2017-01-24 6:58 ` Ravi Bangoria
2017-01-24 8:22 ` Ingo Molnar
2017-01-24 8:36 ` Ravi Bangoria
2017-02-02 11:11 ` [PATCH 0/5] perf/sdt: Argument support for x86 and powepc Ravi Bangoria
2017-02-02 11:11 ` [PATCH 1/5] perf/sdt: Show proper hint Ravi Bangoria
2017-02-02 13:40 ` Ingo Molnar
2017-02-02 16:20 ` Arnaldo Carvalho de Melo
2017-02-03 10:26 ` [PATCH v2] " Ravi Bangoria
2017-02-03 15:18 ` Arnaldo Carvalho de Melo
2017-02-07 7:53 ` Ingo Molnar
2017-02-07 15:50 ` Arnaldo Carvalho de Melo
2017-02-07 8:00 ` Ingo Molnar
2017-02-16 10:16 ` [RFC] perf/sdt: Directly record SDT event with 'perf record' Ravi Bangoria
2017-02-20 7:08 ` Ingo Molnar
2017-02-20 8:21 ` Ravi Bangoria
2017-02-20 8:42 ` Ingo Molnar
2017-02-20 11:01 ` Ravi Bangoria
2017-02-20 14:11 ` Arnaldo Carvalho de Melo
2017-02-23 8:13 ` Ravi Bangoria
2017-02-23 12:48 ` Arnaldo Carvalho de Melo
2017-02-07 1:13 ` [PATCH v2] perf/sdt: Show proper hint Masami Hiramatsu
2017-02-10 7:44 ` [tip:perf/core] perf sdt: Show proper hint when event not yet in place via 'perf probe' tip-bot for Ravi Bangoria
2017-02-02 11:11 ` [PATCH 2/5] perf/sdt/x86: Add renaming logic for rNN and other registers Ravi Bangoria
2017-02-07 3:11 ` Masami Hiramatsu
2017-03-21 14:08 ` Arnaldo Carvalho de Melo
2017-03-24 18:45 ` [tip:perf/core] perf sdt x86: " tip-bot for Ravi Bangoria
2017-02-02 11:11 ` [PATCH 3/5] perf/sdt/x86: Move OP parser to tools/perf/arch/x86/ Ravi Bangoria
2017-02-07 3:11 ` Masami Hiramatsu
2017-02-07 5:22 ` Ravi Bangoria
2017-03-21 14:10 ` Arnaldo Carvalho de Melo
2017-03-21 23:00 ` Masami Hiramatsu
2017-03-22 11:22 ` Arnaldo Carvalho de Melo
2017-03-21 14:55 ` Masami Hiramatsu
2017-02-02 11:11 ` [PATCH 4/5] perf/sdt/powerpc: Add argument support Ravi Bangoria
2017-02-02 11:11 ` [PATCH 5/5] perf/probe: Change MAX_CMDLEN Ravi Bangoria
2017-02-07 1:40 ` Masami Hiramatsu
2017-02-07 5:45 ` [PATCH v2] " Ravi Bangoria
2017-03-21 5:19 ` Masami Hiramatsu
2017-03-21 13:37 ` Arnaldo Carvalho de Melo
2017-03-24 18:43 ` [tip:perf/core] perf probe: " tip-bot for Ravi Bangoria
2017-02-07 2:55 ` [PATCH 0/5] perf/sdt: Argument support for x86 and powepc Masami Hiramatsu
2017-03-06 7:53 ` Ravi Bangoria
2017-03-06 13:42 ` Masami Hiramatsu
2017-03-21 5:08 ` [PATCH v5 0/2] perf probe: add sdt probes arguments into the uprobe cmd string Masami Hiramatsu
2016-12-14 0:07 ` [PATCH v5 1/2] perf sdt: add scanning of sdt probles arguments Alexis Berlemont
2017-03-06 13:39 ` Masami Hiramatsu
2017-03-21 13:52 ` Arnaldo Carvalho de Melo
2017-03-24 18:44 ` [tip:perf/core] perf sdt: Add scanning of sdt probes arguments tip-bot for Alexis Berlemont
2016-12-14 0:07 ` [PATCH v5 2/2] perf probe: add sdt probes arguments into the uprobe cmd string Alexis Berlemont
2017-01-24 8:50 ` Ravi Bangoria
2017-03-06 17:23 ` Masami Hiramatsu
2017-03-24 18:44 ` [tip:perf/core] perf probe: Add " tip-bot for Alexis Berlemont
2016-11-18 23:56 ` [PATCH v2 2/2] perf probe: add " Alexis Berlemont
2016-11-21 10:25 ` Hemant Kumar
2016-11-24 23:13 ` [PATCH v3 0/2] " Alexis Berlemont
2016-11-24 23:13 ` [PATCH v3 1/2] perf sdt: add scanning of sdt probles arguments Alexis Berlemont
2016-11-24 23:13 ` [PATCH v3 2/2] perf probe: add sdt probes arguments into the uprobe cmd string Alexis Berlemont
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=52251cbe-6825-1d03-7b5b-e7517549caa0@linux.vnet.ibm.com \
--to=hemant@linux.vnet.ibm.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=alexis.berlemont@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).