From: Ingo Molnar <mingo@elte.hu>
To: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perfcounters: fix type/event_id layout on big-endian systems
Date: Sat, 21 Mar 2009 10:56:52 +0100 [thread overview]
Message-ID: <20090321095651.GA7201@elte.hu> (raw)
In-Reply-To: <18884.47341.106849.379374@cargo.ozlabs.ibm.com>
* Paul Mackerras <paulus@samba.org> wrote:
> Ingo Molnar writes:
>
> > hm, this ifdef really looks ugly. How about just changing event_id
> > to 64 bits and having a separate u32 type field? The size impact is
> > minimal, the cleanliness win is significant :-)
>
> We wanted to get a complete and unique identifier for the event
> into 64 bits so that we could put it into the ring buffer for
> PERF_RECORD_GROUP and have it take up only one 8-byte slot and yet
> identify uniquely which counter's value follows it. I don't know
> that that is absolutely necessary but it sounds like a nice
> property.
>
> We could easily go back to a 1-bit raw field and have the type be
> either a 64-bit raw value or an 8-bit type plus 32 or 56-bit
> event_id.
>
> Or we could keep the current layout but use explicit shifts and
> masks rather than bitfields.
>
> I don't know the current C rules concerning unions very well, but
> I have the impression that writing to one member of a union and
> reading another is undefined behaviour, which is another strike
> against the current code if true...
>
> Anyway, the point is that the current code doesn't compile on
> powerpc and wouldn't work properly even if it did, so we need to
> do something.
yeah - i pulled your fix, thanks Paul.
Maybe the best option is to get rid of the bitfields and use masks
...
Ingo
next prev parent reply other threads:[~2009-03-21 9:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-21 4:53 [PATCH] perfcounters: fix type/event_id layout on big-endian systems Paul Mackerras
2009-03-21 9:42 ` Ingo Molnar
2009-03-21 9:52 ` Paul Mackerras
2009-03-21 9:56 ` Ingo Molnar [this message]
2009-03-21 11:41 ` Peter Zijlstra
2009-03-21 22:04 ` [PATCH] perf_counter: remove the event config bitfields Peter Zijlstra
2009-03-21 23:50 ` Paul Mackerras
2009-03-21 10:24 ` [PATCH] perfcounters: fix type/event_id layout on big-endian systems Peter Zijlstra
2009-03-21 12:08 ` Paul Mackerras
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=20090321095651.GA7201@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.org \
/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