From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "Ingo Molnar" <mingo@elte.hu>,
linux-kernel@vger.kernel.org,
"Frédéric Weisbecker" <fweisbec@gmail.com>,
"Mike Galbraith" <efault@gmx.de>,
"Paul Mackerras" <paulus@samba.org>
Subject: Re: [PATCH 3/6] perf tools: Reorganize some structs to save space
Date: Thu, 8 Apr 2010 12:27:41 -0300 [thread overview]
Message-ID: <20100408152741.GH3908@ghostprotocols.net> (raw)
In-Reply-To: <1270739509.20295.2419.camel@laptop>
Em Thu, Apr 08, 2010 at 05:11:49PM +0200, Peter Zijlstra escreveu:
> On Thu, 2010-04-08 at 11:38 -0300, Arnaldo Carvalho de Melo wrote:
> > @@ -68,11 +68,11 @@ struct sample_data {
> > u64 addr;
> > u64 id;
> > u64 stream_id;
> > - u32 cpu;
> > u64 period;
> > - struct ip_callchain *callchain;
> > + u32 cpu;
> > u32 raw_size;
> > void *raw_data;
> > + struct ip_callchain *callchain;
> > };
>
> If that is a struct that is to match a kernel produced record then this
> is utterly broken.
No, it is not, it is filled in userspace:
tools/perf/util/event.c:
int event__parse_sample(event_t *event, u64 type, struct sample_data *data)
{
u64 *array = event->sample.array;
if (type & PERF_SAMPLE_IP) {
data->ip = event->ip.ip;
array++;
}
if (type & PERF_SAMPLE_TID) {
u32 *p = (u32 *)array;
data->pid = p[0];
data->tid = p[1];
array++;
}
if (type & PERF_SAMPLE_TIME) {
data->time = *array;
array++;
}
<SNIP>
We can reorder it at will and decoupled from any kernel changes.
- Arnaldo
next prev parent reply other threads:[~2010-04-08 15:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-08 14:38 [PATCH 0/6] Fixes and usability improvements Arnaldo Carvalho de Melo
2010-04-08 14:38 ` [PATCH 1/6] perf TUI: Show filters on the title and add help line about how to zoom out Arnaldo Carvalho de Melo
2010-04-08 14:38 ` [PATCH 2/6] perf TUI: Move "Yes" button to before "No" Arnaldo Carvalho de Melo
2010-04-08 14:38 ` [PATCH 3/6] perf tools: Reorganize some structs to save space Arnaldo Carvalho de Melo
2010-04-08 15:11 ` Peter Zijlstra
2010-04-08 15:27 ` Arnaldo Carvalho de Melo [this message]
2010-04-08 14:38 ` [PATCH 4/6] perf bench: fix spello Arnaldo Carvalho de Melo
2010-04-08 14:38 ` [PATCH 5/6] perf: cleanup some Documentation Arnaldo Carvalho de Melo
2010-04-08 14:38 ` [PATCH 6/6] perf trace: Ignore "overwrite" field if present in /events/header_page Arnaldo Carvalho de Melo
2010-04-08 14:59 ` [PATCH 0/6] Fixes and usability improvements Ingo Molnar
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=20100408152741.GH3908@ghostprotocols.net \
--to=acme@infradead.org \
--cc=efault@gmx.de \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=peterz@infradead.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;
as well as URLs for NNTP newsgroup(s).