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

On Thu, 29 Nov 2007 08:14:10 -0000
"Metzger, Markus T" <markus.t.metzger@intel.com> wrote:

> Support for Intel's last branch recording to ptrace. This gives
> debuggers
> access to this hardware feature and allows them to show an execution
> trace
> of the debugged application.
> 
> Last branch recording (see section 18.5 in the Intel 64 and IA-32
> Architectures Software Developer's Manual) allows taking an execution
> trace of the running application without instrumentation. When a branch
> is executed, the hardware logs the source and destination address in a
> cyclic buffer given to it by the OS.
> 
> This can be a great debugging aid. It shows you how exactly you got
> where you currently are without requiring you to do lots of single
> stepping and rerunning.
> 
> This patch manages the various buffers, configures the trace
> hardware, disentangles the trace, and provides a user interface via
> ptrace. On the high-level design:
> - there is one optional trace buffer per thread_struct
> - upon a context switch, the trace hardware is reconfigured to either
>   disable tracing or to use the appropriate buffer for the new task.
>   - tracing induces ~20% overhead as branch records are sent out on
>     the bus. 
>   - the hardware collects trace per processor. To disentangle the
>     traces for different tasks, we use separate buffers and reconfigure
>     the trace hardware.
> - the low-level data layout is configured at cpu initialization time
>   - different processors use different branch record formats
> 
> 
> patch 1/2 contains the kernel changes
> patch 2/2 contains changes to the ptrace man pages
> 
> 

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

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'm generally wondering "how will developers be using this in a year or
two's time?"

Please cc Michael Kerrisk <mtk-manpages@gmx.net> on future versions of
these patches.

The patches were horridly wordwrapped.

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?  


  reply	other threads:[~2007-11-30  0:00 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 [this message]
2007-11-30  9:57   ` Metzger, Markus T
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=20071129155940.7df70ac2.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ak@suse.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus.t.metzger@intel.com \
    --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).