All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: "K.Prasad" <prasad@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH 4/4] perf tools: Add support for breakpoint events in perf tools
Date: Mon, 23 Nov 2009 21:25:28 +0100	[thread overview]
Message-ID: <20091123202525.GA4979@nowhere> (raw)
In-Reply-To: <20091123173601.GA7273@in.ibm.com>

On Mon, Nov 23, 2009 at 11:06:01PM +0530, K.Prasad wrote:
> On Mon, Nov 23, 2009 at 03:42:35PM +0100, Frederic Weisbecker wrote:
> > Add the breakpoint events support with this new sysnopsis:
> > 
> > mem:addr[:access]
> > 
> > Where addr is a raw addr value in the kernel and access can be
> > either [r][w][x]
> > 
> > Example to profile tasklist_lock:
> > 
> > 	$ grep tasklist_lock /proc/kallsyms
> > 	ffffffff8189c000 D tasklist_lock
> > 
> > 	$ perf record -e mem:0xffffffff8189c000:rw -a -f -c 1
> > 	$ perf report
> 
> The problem in obtaining just the breakpoint address is that there can
> be a variety of breakpoint lengths that can be associated with them -
> assigning the smallest possible length (1-Byte) may cause loss of
> exceptions and a higher length would lead to stray exceptions (such
> dilemmas led to the support of symbol-only breakpoint in ksym_tracer and
> perf-tools in my patchset...the default 1-Byte breakpoint length being a
> temporary fix).


Right.

 
> With kernel symbols as input it would be possible to derive the bkpt
> length based on the symbol-size, say using
> kallsyms_lookup_size_offset() (although the corresponding length may not
> be available on the host processor such requests can be failed or
> over-ridden by the user using a smaller length), but for addresses I think
> it is vital to know what breakpoint length is desired by the user.



Yeah. I guess we first need a way to manually add this length, may
be:

	mem:addr/len:access

And as you said, finding it automatically for symbols. But still, passing
symbols to perf attr leads to confusion and complexity if we want to profile
in userspace.

I think we should find this symbol length from userspace.
I'm not sure how yet, probably using Dwarf. Arnaldo, do you have an
idea about that?

> This comes at the cost of exposing the user to variations in
> breakpoint implementation across architectures and demand processor-specific
> knowledge, but specifying a kernel-space address would anyway require the
> user to penetrate beyond the normal abstraction provided by the
> interface/tool...so I presume it must be acceptable.



Yeah. We'll probably need to write a quick sum-up about
such variations to facilitate perf uses.


> On a related note, the supported breakpoint length for PPC64 is a fixed
> 8-Byte length (which means all extraneous exceptions must be filtered by
> the breakpoint architecture) and Book-E Power processors matching
> addresses against a bitmask; for S390 it can be practically anything
> (bound by a set of start and end addresses)...and you see what a
> quandary it leads to!
> 
> Thanks,
> K.Prasad


Yep :)

Thanks.


  reply	other threads:[~2009-11-23 20:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-23 14:42 [PATCH 1/4] hw-breakpoints: Include only linux/perf_event.h from kernel part of bp headers Frederic Weisbecker
2009-11-23 14:42 ` [PATCH 2/4] hw-breakpoints: Check the breakpoint params from perf tools Frederic Weisbecker
2009-11-23 17:43   ` [tip:perf/core] " tip-bot for Frederic Weisbecker
2009-11-23 14:42 ` [PATCH 3/4] perf: Add kernel side syscall events support for breakpoints Frederic Weisbecker
2009-11-23 17:43   ` [tip:perf/core] " tip-bot for Frederic Weisbecker
2009-11-23 14:42 ` [PATCH 4/4] perf tools: Add support for breakpoint events in perf tools Frederic Weisbecker
2009-11-23 17:36   ` K.Prasad
2009-11-23 20:25     ` Frederic Weisbecker [this message]
2009-11-23 21:09       ` Arnaldo Carvalho de Melo
2009-11-23 21:19         ` Frederic Weisbecker
2009-11-23 21:25           ` Ingo Molnar
2009-11-23 21:25           ` Arnaldo Carvalho de Melo
2009-11-23 17:38   ` Ingo Molnar
2009-11-23 17:44   ` [tip:perf/core] " tip-bot for Frederic Weisbecker
2009-11-23 17:43 ` [tip:perf/core] hw-breakpoints: Include only linux/perf_event.h from kernel part of bp headers tip-bot for Frederic Weisbecker

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=20091123202525.GA4979@nowhere \
    --to=fweisbec@gmail.com \
    --cc=acme@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=prasad@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 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.