From 2c46dbb517a10b18d459e6ceffefde5bfb290cf6 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Thu, 1 Apr 2010 23:59:19 -0500 Subject: perf: Convert perf header attrs into attr events Bypasses the attr perf header code and replaces it with a synthesized event and processing function that accomplishes the same thing, used when reading/writing perf data to/from a pipe. Making the attrs into events allows them to be streamed over a pipe along with the rest of the header data (in later patches). It also paves the way to allowing events to be added and removed from perf sessions dynamically. Signed-off-by: Tom Zanussi Acked-by: Thomas Gleixner Cc: fweisbec@gmail.com Cc: rostedt@goodmis.org Cc: k-keiichi@bx.jp.nec.com Cc: acme@ghostprotocols.net LKML-Reference: <1270184365-8281-6-git-send-email-tzanussi@gmail.com> Signed-off-by: Ingo Molnar --- tools/perf/builtin-record.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tools/perf/builtin-record.c') diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index d4464f7fcea..289d9cf3bf7 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -584,6 +584,16 @@ static int __cmd_record(int argc, const char **argv) post_processing_offset = lseek(output, 0, SEEK_CUR); + if (pipe_output) { + err = event__synthesize_attrs(&session->header, + process_synthesized_event, + session); + if (err < 0) { + pr_err("Couldn't synthesize attrs.\n"); + return err; + } + } + err = event__synthesize_kernel_mmap(process_synthesized_event, session, "_text"); if (err < 0) -- cgit v1.2.3