linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Metzger, Markus T" <markus.t.metzger@intel.com>
To: "Andrew Morton" <akpm@linux-foundation.org>
Cc: <linux-kernel@vger.kernel.org>, <mingo@elte.hu>, <hpa@zytor.com>,
	<tglx@linutronix.de>, <ak@suse.de>,
	"Siddha, Suresh B" <suresh.b.siddha@intel.com>,
	"Michael Kerrisk" <mtk-manpages@gmx.net>,
	"Metzger, Markus T" <markus.t.metzger@intel.com>
Subject: RE: [patch 0/2] x86, ptrace:  support for branch trace store(BTS)
Date: Fri, 30 Nov 2007 09:57:22 -0000	[thread overview]
Message-ID: <029E5BE7F699594398CA44E3DDF5544401051EEF@swsmsx413.ger.corp.intel.com> (raw)
In-Reply-To: <20071129155940.7df70ac2.akpm@linux-foundation.org>


>Is there any userspace code avaialble which people can use to play with
>this?

Not yet. We are talking to internal teams regarding gdb support.


>How do you envisage it being used in the long term?  Do you 
>expect any of
>the standard performance tuning tools will be tweaked to 
>understand this
>feature and if so which ones?

I would expect debuggers to use it to show an execution trace of the 
debuggee. The ptrace interface targets application debuggers; kernel
debuggers would need a slightly different interface.

This saves you a lot of single-stepping through your code to answer the
question "how exactly did I get here". I used a similar feature on bare
metal XScale to hunt data aborts, which made the task pretty easy.

Performance tools, which would be interested in the PEBS part of it,
would
need to share DS with this debugging feature. When I grep'ed the kernel
to
see who else used DS, I did not find anybody accessing the DS_SAVE_AREA
MSR.
When there are multiple users of DS, we would need to introduce some
means
of managing that resource.
We may extend this patch to add support for reading PEBS using ptrace.


>I'm generally wondering "how will developers be using this in a year or
>two's time?"

Application developers will use it via application debuggers.
Kernel developers will use it via kgdb; a kernel interface needs to be
added to it. This patch provides the hardware access and an application
debugger interface.


>The patches were horridly wordwrapped.

My apologies. Andi already complained and I hoped I got it fixed.
I'm working on using a different email client and maybe a different
email 
account.


>Is there any likelihood that any other CPUs do now or will in 
>the future
>support any similar feature to this?  If so, is an 
>implementation which is
>100% contained to arch/x86 appropriate?

I am aware of a trace feature in XScale processors. I think there is
also
something available for ARM, but I don't know details.

If the feature turns out to be really useful, I would, of course, expect
(or at least hope) that other CPU's would provide a similar feature.

Most of the code is arch specific. If other CPU's share the general BTS
layout,
some of the ptrace_bts.c code could be shared.
Since the implementation only supports x86, I think the code should go
into
arch/x86 - at least until other CPU's are supported.
I would hope that the ptrace interface will be shared across
architectures.


regards,
markus.
---------------------------------------------------------------------
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen Germany
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer
Registergericht: Muenchen HRB 47456 Ust.-IdNr.
VAT Registration No.: DE129385895
Citibank Frankfurt (BLZ 502 109 00) 600119052

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

  reply	other threads:[~2007-11-30  9:59 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-29  8:14 [patch 0/2] x86, ptrace: support for branch trace store(BTS) Metzger, Markus T
2007-11-29 23:59 ` Andrew Morton
2007-11-30  9:57   ` Metzger, Markus T [this message]
2007-11-30 10:34     ` Andi Kleen
2007-11-30 15:45       ` Metzger, Markus T
2007-11-30 17:06         ` Ingo Molnar
2007-12-01  7:40           ` Ingo Molnar
2007-12-03 13:53             ` Markus Metzger
2007-12-03 15:17               ` Metzger, Markus T
2007-12-03 16:21               ` Andi Kleen
2007-12-03 16:45                 ` Ingo Molnar
2007-12-03 17:11                   ` Andi Kleen
2007-12-03 17:22                     ` Thomas Gleixner
2007-12-03 21:55                     ` Ingo Molnar
2007-12-03 22:02                       ` Andi Kleen
2007-12-04  8:52                 ` Metzger, Markus T
2007-11-30 10:54   ` Ingo Molnar
2007-11-30 15:48     ` Metzger, Markus T
2007-11-30 16:04   ` Michael Kerrisk
2007-11-30 16:08     ` Michael Kerrisk
2007-11-30 15:56 Markus Metzger
2007-12-04 18:03 Markus Metzger

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=029E5BE7F699594398CA44E3DDF5544401051EEF@swsmsx413.ger.corp.intel.com \
    --to=markus.t.metzger@intel.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mtk-manpages@gmx.net \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    /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).