All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Hemant Kumar <hkshaw@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, srikar@linux.vnet.ibm.com,
	peterz@infradead.org, oleg@redhat.com,
	hegdevasant@linux.vnet.ibm.com, mingo@redhat.com,
	anton@redhat.com, systemtap@sourceware.org, namhyung@kernel.org,
	aravinda@linux.vnet.ibm.com
Subject: Re: [PATCH v2 2/3] Support for perf to probe into SDT markers:
Date: Tue, 08 Oct 2013 20:47:48 +0900	[thread overview]
Message-ID: <5253F0E4.4080105@hitachi.com> (raw)
In-Reply-To: <20131007064806.11693.23845.stgit@hemant-fedora>

(2013/10/07 15:48), Hemant Kumar wrote:
> This allows perf to probe into the sdt markers/notes present in
> the libraries and executables. We try to find the associated location
> and handle prelinking (since, stapsdt notes section is not allocated
> during runtime). Prelinking is handled with the help of base
> section which is allocated during runtime. This address can be compared
> with the address retrieved from the notes' description. If its different,
> we can take this difference and then add to the note's location.
> 
> We can use existing '-a/--add' option to add events for sdt markers.
> Also, we can add multiple events at once using the same '-a' option.
> 
> Usage:
> perf probe -x /lib64/libc.so.6 -a 'my_event=%libc:setjmp'
> 
> or
> 
> perf probe -x /lib64/libc.so.6 %libc:setjmp
> 
> Output (corresponding to the first usage):
> Added new event:
>   libc:my_event        (on 0x35981)
> 
> You can now use it in all perf tools, such as:
> 
>     perf record -e libc:my_event -aR sleep 1
> 
> 
> Signed-off-by: Hemant Kumar Shaw <hkshaw@linux.vnet.ibm.com>
> ---
>  tools/perf/builtin-probe.c    |   11 +++++
>  tools/perf/util/probe-event.c |   89 +++++++++++++++++++++++++++++++++++++----
>  tools/perf/util/probe-event.h |    2 +
>  tools/perf/util/symbol-elf.c  |   80 +++++++++++++++++++++++++++++++++++++
>  tools/perf/util/symbol.h      |    3 +
>  5 files changed, 177 insertions(+), 8 deletions(-)
> 
> diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
> index cbd2383..6f09723 100644
> --- a/tools/perf/builtin-probe.c
> +++ b/tools/perf/builtin-probe.c
> @@ -370,6 +370,17 @@ int cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
>  			pr_err("Error: Don't use --markers with --funcs.\n");
>  			usage_with_options(probe_usage, options);
>  		}
> +		if (params.mod_events) {
> +			ret = add_perf_probe_events(params.events,
> +						    params.nevents,
> +						    params.max_probe_points,
> +						    params.target,
> +						    params.force_add);
> +			if (ret < 0) {
> +				pr_err(" Error: Failed to add events. "
> +				       " (%d)\n", ret);
> +			}
> +		}

What is this code for? params.sdt is true only if "--markers" is set, and that
should not be used with --add and --del, because it's an action "query markers".
We should give an error and abort here.

Other points are covered by Namhyung's review(thanks!).

Thank you!

-- 
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com



  parent reply	other threads:[~2013-10-08 11:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-07  6:46 [PATCH v2 0/3] Perf support to SDT markers Hemant Kumar
2013-10-07  6:47 ` [PATCH v2 1/3] SDT markers listing by perf: Hemant Kumar
2013-10-08  8:57   ` Namhyung Kim
2013-10-08 13:04     ` Hemant
2013-10-08 11:39   ` Masami Hiramatsu
2013-10-08 13:25     ` Hemant
2013-10-07  6:48 ` [PATCH v2 2/3] Support for perf to probe into SDT markers: Hemant Kumar
2013-10-08  9:09   ` Namhyung Kim
2013-10-08 13:08     ` Hemant
2013-10-08 11:47   ` Masami Hiramatsu [this message]
2013-10-08 13:30     ` Hemant
2013-10-07  6:48 ` [PATCH v2 3/3] Documentation regarding perf/sdt Hemant Kumar
2013-10-07 15:47 ` [PATCH v2 0/3] Perf support to SDT markers Frank Ch. Eigler
2013-10-08  9:10   ` Namhyung Kim
2013-10-08 13:09     ` Hemant
2013-10-08 13:31   ` Hemant
2013-10-08  6:03 ` Masami Hiramatsu
2013-10-08 12:53   ` Hemant

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=5253F0E4.4080105@hitachi.com \
    --to=masami.hiramatsu.pt@hitachi.com \
    --cc=anton@redhat.com \
    --cc=aravinda@linux.vnet.ibm.com \
    --cc=hegdevasant@linux.vnet.ibm.com \
    --cc=hkshaw@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=srikar@linux.vnet.ibm.com \
    --cc=systemtap@sourceware.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 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.