From: David Ahern <dsahern@gmail.com>
To: Stephane Eranian <eranian@google.com>
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
mingo@elte.hu, acme@redhat.com
Subject: Re: [PATCH v2 4/5] perf record: add meta-data support for pipe-mode
Date: Tue, 15 May 2012 21:34:10 -0600 [thread overview]
Message-ID: <4FB32032.3000509@gmail.com> (raw)
In-Reply-To: <1337081295-10303-5-git-send-email-eranian@google.com>
On 5/15/12 5:28 AM, Stephane Eranian wrote:
> This patch adds the meta-data header support for perf record
> when used in pipe mode: perf record -o -
>
> Up until now, meta-data was only available when perf record
> was used in "regular" mode, i.e., generating a perf.data file.
> For users depending on pipe mode, no host, event header information
> was gathered. This patch addresses this limitation.
>
> The difficulty in pipe mode is that information needs to be written
> sequentially to the pipe. Meta data headers are usually generated
> (and also expected) at the beginning of the file (or piped output).
> To solve this problem, we introduce new synthetic record types,
> one for each meta-data type. The approach is similar to what
> is already used for BUILD_ID and TRACING_DATA.
>
> We have modified util/header.c such that the same routines are used
> to generate and read the meta-data information regardless of pipe-mode
> vs. regular mode. To make this work, we added a new struct called
> feat_fd which encapsulates all the information necessary to read or
> write meta-data information to a file/pipe or from a file/pipe.
>
> It should be noted that there is a limitation with the current
> perf in terms of endianess in pipe mode. Perf assumes the records
> are generated using the same endianess during collection and
> analysis. That is always the case with the example shown below.
> However, one could also do:
> $ perf record -o - noploop 2 | perf inject -b>perf.data
> $ cat perf.data | perf report -i -
>
> With this patch, it is possible to get:
> $ perf record -o - noploop 2 | perf inject -b | perf report -i -
> # ========
> # captured on: Fri Jan 20 18:13:55 2012
> # ========
> #
> # hostname : quad
> # os release : 3.2.0-rc7-tip
> # perf version : 3.2.0
> # arch : x86_64
> # nrcpus online : 4
> # nrcpus avail : 4
> # cpudesc : Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
> # cpuid : GenuineIntel,6,15,11
> # total memory : 8092884 kB
> ...
> # HEADER_CPU_TOPOLOGY info available, use -I to display
> noploop for 2 seconds
> [ perf record: Woken up 1 times to write data ]
> [ perf record: Captured and wrote 0.084 MB - (~3677 samples) ]
> 99.80% noploop noploop [.] noploop
> 0.19% noploop [kernel.kallsyms] [k] radix_tree_gang_lookup
>
> Signed-off-by: Stephane Eranian<eranian@google.com>
I love the feature and it works nicely, but there has been push back on
adding more synthesized events. Also the size of the patch is a bit
much to take in. If there is no objection to the synthesized can you
break the patch up -- e.g., introduce the events in one, synthesis and
processing functions in another, plug into the commands, ...
David
next prev parent reply other threads:[~2012-05-16 3:34 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-15 11:28 [PATCH v2 0/5] perf tools: add meta-data header support in pipe mode Stephane Eranian
2012-05-15 11:28 ` [PATCH v2 1/5] perf inject: fix broken perf inject -b Stephane Eranian
2012-05-16 1:58 ` David Ahern
2012-05-23 15:29 ` [tip:perf/core] perf inject: Fix " tip-bot for Stephane Eranian
2012-05-15 11:28 ` [PATCH v2 2/5] perf tools: fix piped mode read code Stephane Eranian
2012-05-16 2:24 ` David Ahern
2012-05-23 15:29 ` [tip:perf/core] perf tools: Fix " tip-bot for Stephane Eranian
2012-05-15 11:28 ` [PATCH v2 3/5] perf tools: rename HEADER_TRACE_INFO to HEADER_TRACING_DATA Stephane Eranian
2012-05-16 2:34 ` David Ahern
2012-05-23 15:28 ` [tip:perf/core] " tip-bot for Stephane Eranian
2012-05-15 11:28 ` [PATCH v2 4/5] perf record: add meta-data support for pipe-mode Stephane Eranian
2012-05-16 3:34 ` David Ahern [this message]
2012-05-16 7:41 ` Stephane Eranian
2012-05-18 16:50 ` David Ahern
2012-05-18 17:19 ` Arnaldo Carvalho de Melo
2012-05-22 17:33 ` Peter Zijlstra
2012-05-22 17:51 ` Stephane Eranian
2012-05-23 0:45 ` Namhyung Kim
2012-05-23 1:01 ` Arnaldo Carvalho de Melo
2012-05-23 8:10 ` Peter Zijlstra
2012-05-23 8:21 ` Peter Zijlstra
2012-05-23 13:06 ` Stephane Eranian
2012-05-24 15:36 ` David Ahern
2012-05-24 16:19 ` Arnaldo Carvalho de Melo
2012-05-24 16:22 ` David Ahern
2012-05-24 16:44 ` Arnaldo Carvalho de Melo
2012-05-15 11:28 ` [PATCH v2 5/5] perf: make perf buildid-list work better with pipe mode Stephane Eranian
2012-05-16 3:55 ` David Ahern
2012-05-23 15:30 ` [tip:perf/core] perf buildid-list: Work " tip-bot for Stephane Eranian
2012-05-16 1:34 ` [PATCH v2 0/5] perf tools: add meta-data header support in " Namhyung Kim
2012-05-16 2:05 ` David Ahern
2012-05-16 2:32 ` Namhyung Kim
2012-05-16 2:38 ` David Ahern
2012-05-16 2:50 ` Namhyung Kim
2012-05-16 15:03 ` Arnaldo Carvalho de Melo
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=4FB32032.3000509@gmail.com \
--to=dsahern@gmail.com \
--cc=acme@redhat.com \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.