linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephane Eranian <eranian@hpl.hp.com>
To: Eric Gouriou <eric.gouriou@hp.com>
Cc: David Gibson <david@gibson.dropbear.id.au>,
	"Bryan O'Sullivan" <bos@serpentine.com>,
	perfmon@napali.hpl.hp.com, perfctr-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [perfmon] perfmon2 code review: 32-bit ABI on	64-bit OS
Date: Mon, 13 Feb 2006 12:31:20 -0800	[thread overview]
Message-ID: <20060213203120.GJ11285@frankl.hpl.hp.com> (raw)
In-Reply-To: <43EFCCE0.3090004@hp.com>

David,

On Sun, Feb 12, 2006 at 04:03:44PM -0800, Eric Gouriou wrote:
> David Gibson wrote:
> >On Sat, Feb 11, 2006 at 02:33:54PM -0800, Stephane Eranian wrote:
> [...]
> >>The most challenging piece is the IP (program pointer) that is in every
> >>sample. Today it is defined as unsigned long because this is fairly
> >>natural for a code address. The 64bit OS captures addresses as 64-bit,
> >>the 32-bit monitoring tool running on top has to consume them as 64-bit
> >>addresses, so u64 would be fine. 
> >>
> >>But not on a 32-bit kernel with a 32-bit tool, addresses exported as u64
> >>would certainly work but consume double to buffer space, and that is a
> >>more serious issue in my mind.
> >
> >Hmm.. does the sampling buffer collect on userspace PC values, or
> >kernel ones as well?
> 
>  Either, or both, depending on the measurement settings.
> 
>  I live in a 64-bit world, so my take on this issue would be to expose
> the PC as a uint64_t, always. There is already so much overhead in the
> default per-sample header that I wouldn't worry about it.
> 
Eric is right, on many architectures, incl. PPC64 I am sure, you can easily
configure a counter to measure at any priv levels including at the kernel level.
As such a 32-bt monitoring tool could see 64-bit generated samples. Similarly,
I don't think it would be unreasonable to have a 32-bit tool monitor 64-bit
applications.

The question is whether hardcoding the IP to always be u64 is a valid choice.
Eric's comment about overhead is based on the current default sampling format
which systematically adds a fixed size header to each sample. That header
contains the IP. So adding 4 bytes to this header is not a big deal.

However, because we can define virtual PMDs that map to software resources, it
is likely that the default format will evolve to allow an application to specify
everything it needs for each sample. For instance, you can have a PMD
that maps to the current PID, another one that maps to the interrupt IP. Then
you can chose to include those into the sample and you would nto need a fixed size
header anymore.

-- 
-Stephane

  reply	other threads:[~2006-02-13 20:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-20 18:37 [perfmon] Re: quick overview of the perfmon2 interface Truong, Dan
2006-01-20 22:22 ` Andrew Morton
2006-01-25 20:33 ` Bryan O'Sullivan
2006-01-25 22:28   ` [Perfctr-devel] " Stephane Eranian
2006-01-25 22:46     ` Bryan O'Sullivan
2006-01-26  7:48       ` Stephane Eranian
2006-01-26 18:26         ` Bryan O'Sullivan
     [not found]     ` <1138649612.4077.50.camel@localhost.localdomain>
     [not found]       ` <1138651545.4487.13.camel@camp4.serpentine.com>
     [not found]         ` <1139155731.4279.0.camel@localhost.localdomain>
     [not found]           ` <1139245253.27739.8.camel@camp4.serpentine.com>
2006-02-10 15:36             ` perfmon2 code review: 32-bit ABI on 64-bit OS Stephane Eranian
2006-02-10 18:27               ` Bryan O'Sullivan
     [not found]                 ` <1139681785.4316.33.camel@localhost.localdomain>
2006-02-11 22:33                   ` [perfmon] " Stephane Eranian
2006-02-12 23:46                     ` [Perfctr-devel] " David Gibson
2006-02-13  0:03                       ` Eric Gouriou
2006-02-13 20:31                         ` Stephane Eranian [this message]
     [not found]                     ` <1139857076.4342.10.camel@localhost.localdomain>
2006-02-14 23:41                       ` Stephane Eranian
2006-02-20 17:54                       ` Stephane Eranian
2006-02-13 20:34                 ` Stephane Eranian

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=20060213203120.GJ11285@frankl.hpl.hp.com \
    --to=eranian@hpl.hp.com \
    --cc=bos@serpentine.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=eric.gouriou@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perfctr-devel@lists.sourceforge.net \
    --cc=perfmon@napali.hpl.hp.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;
as well as URLs for NNTP newsgroup(s).