public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: graalfs@linux.vnet.ibm.com
To: robert.richter@amd.com
Cc: mingo@elte.hu, oprofile-list@lists.sf.net,
	linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org,
	borntraeger@de.ibm.com, schwidefsky@de.ibm.com,
	heiko.carstens@de.ibm.com
Subject: [patch 0/4] OProfile support for System z's hardware sampling
Date: Mon, 20 Dec 2010 14:05:41 +0100	[thread overview]
Message-ID: <20101220130541.446049933@linux.vnet.ibm.com> (raw)

So far, OProfile takes samples by using a software interrupt.
The purpose of this series of patches is to add support for System z hardware sampling to OProfile.

Hardware (HW) sampling is a feature provided by System z processors (z10 and follow ons).
When sampling, the processor takes samples containing the instruction address, PID, and other information.
The samples are taken at a programmable rate and stored into a buffer provided by the operating system.
The sampling process is implemented in hardware and millicode and thus does not affect the operating system
being oberved, apart from requiring buffer memory that the Linux kernel must provide.

Hardware sampling is available in LPAR mode on 64 BIT processors only.

The overall approach is to replace the software-based sample generation by hardware sampling.
The driver for the HW sampling mechanism is a kernel module named hwsampler.
Kernel module hwsampler provides functions for
 - controlling the sampling hardware,
 - setting up appropriate buffer structures (HW buffers),
 - retrieving sample entries from these buffers.
Kernel module hwsampler can handle multiple CPUs.

The samples contain the instruction address, a bit distinguishing between kernel and user space,
and for user space samples also the PID.
Instead of taking samples from its own per-CPU buffers, OProfile would rather take samples from the
HW buffers.

When hardware sampling can be enabled on the current System z processor it will be the new default.
Switching back to timer based sampling can be established by using

   echo 0 > /dev/oprofile/hwsampling/hwsampler

The user space drivers of OProfile also need an extension to control hw sampling by appropriate options.


             reply	other threads:[~2010-12-20 13:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-20 13:05 graalfs [this message]
2010-12-20 13:05 ` [patch 1/4] This patch adds support for hardware based sampling on System z processors (models z10 and up) graalfs
2011-01-03 17:06   ` Robert Richter
2011-01-19 16:54     ` Heinz Graalfs
2010-12-20 13:05 ` [patch 2/4] This patch enhances OProfile to support System zs hardware sampling feature graalfs
2011-01-03 19:02   ` Robert Richter
2011-01-19 16:55     ` Heinz Graalfs
2010-12-20 13:05 ` [patch 3/4] This patch introduces a new oprofile sample add function (oprofile_add_ext_hw_sample) graalfs
2011-01-04 15:34   ` Robert Richter
2011-01-07 16:31     ` Heinz Graalfs
2011-01-19 16:56     ` Heinz Graalfs
2010-12-20 13:05 ` [patch 4/4] Handle memory unmap while hardware sampling is running graalfs
2011-01-03 20:39   ` Robert Richter

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=20101220130541.446049933@linux.vnet.ibm.com \
    --to=graalfs@linux.vnet.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oprofile-list@lists.sf.net \
    --cc=robert.richter@amd.com \
    --cc=schwidefsky@de.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox