linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Metzger, Markus T" <markus.t.metzger@intel.com>
To: <linux-kernel@vger.kernel.org>, <mingo@elte.hu>, <hpa@zytor.com>,
	<tglx@linutronix.de>, <ak@suse.de>
Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com>,
	"Metzger, Markus T" <markus.t.metzger@intel.com>,
	<akpm@linux-foundation.org>
Subject: [patch 0/2] x86, ptrace:  support for branch trace store(BTS)
Date: Thu, 29 Nov 2007 08:14:10 -0000	[thread overview]
Message-ID: <029E5BE7F699594398CA44E3DDF5544401024075@swsmsx413.ger.corp.intel.com> (raw)

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


So far, we incorporated mostly feedback from Andi Kleen. Is there any
more feedback that needs to be addressed?


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-29  8:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-29  8:14 Metzger, Markus T [this message]
2007-11-29 23:59 ` [patch 0/2] x86, ptrace: support for branch trace store(BTS) Andrew Morton
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=029E5BE7F699594398CA44E3DDF5544401024075@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=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).