From: Adrian Hunter <adrian.hunter@intel.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>, linux-kernel@vger.kernel.org
Subject: [PATCH 1/7] perf record: Combine some auxtrace initialization into a single function
Date: Tue, 6 Mar 2018 11:13:12 +0200 [thread overview]
Message-ID: <1520327598-1317-2-git-send-email-adrian.hunter@intel.com> (raw)
In-Reply-To: <1520327598-1317-1-git-send-email-adrian.hunter@intel.com>
In preparation for adding AUX area sampling support, combine some auxtrace
initialization into a single function.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
tools/perf/builtin-record.c | 36 ++++++++++++++++++++++++------------
1 file changed, 24 insertions(+), 12 deletions(-)
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 907267206973..9b6338ce9c2b 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -273,6 +273,24 @@ static void record__read_auxtrace_snapshot(struct record *rec)
}
}
+static int record__auxtrace_init(struct record *rec)
+{
+ int err;
+
+ if (!rec->itr) {
+ rec->itr = auxtrace_record__init(rec->evlist, &err);
+ if (err)
+ return err;
+ }
+
+ err = auxtrace_parse_snapshot_options(rec->itr, &rec->opts,
+ rec->opts.auxtrace_snapshot_opts);
+ if (err)
+ return err;
+
+ return auxtrace_parse_filters(rec->evlist);
+}
+
#else
static inline
@@ -293,6 +311,11 @@ int auxtrace_record__snapshot_start(struct auxtrace_record *itr __maybe_unused)
return 0;
}
+static int record__auxtrace_init(struct record *rec __maybe_unused)
+{
+ return 0;
+}
+
#endif
static int record__mmap_evlist(struct record *rec,
@@ -1711,17 +1734,6 @@ int cmd_record(int argc, const char **argv)
alarm(rec->switch_output.time);
}
- if (!rec->itr) {
- rec->itr = auxtrace_record__init(rec->evlist, &err);
- if (err)
- goto out;
- }
-
- err = auxtrace_parse_snapshot_options(rec->itr, &rec->opts,
- rec->opts.auxtrace_snapshot_opts);
- if (err)
- goto out;
-
/*
* Allow aliases to facilitate the lookup of symbols for address
* filters. Refer to auxtrace_parse_filters().
@@ -1730,7 +1742,7 @@ int cmd_record(int argc, const char **argv)
symbol__init(NULL);
- err = auxtrace_parse_filters(rec->evlist);
+ err = record__auxtrace_init(rec);
if (err)
goto out;
--
1.9.1
next prev parent reply other threads:[~2018-03-06 9:14 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-06 9:13 [PATCH 0/7] perf tools: Prepare for AUX area sampling support Adrian Hunter
2018-03-06 9:13 ` Adrian Hunter [this message]
2018-03-09 8:38 ` [tip:perf/core] perf record: Combine some auxtrace initialization into a single function tip-bot for Adrian Hunter
2018-03-06 9:13 ` [PATCH 2/7] perf auxtrace: Prevent decoding when --no-itrace Adrian Hunter
2018-03-06 14:06 ` Arnaldo Carvalho de Melo
2018-03-06 14:21 ` Adrian Hunter
2018-03-06 14:32 ` Arnaldo Carvalho de Melo
2018-03-07 8:27 ` [tip:perf/urgent] " tip-bot for Adrian Hunter
2018-03-06 9:13 ` [PATCH 3/7] perf auxtrace: Add missing parameters from kernel-doc comments Adrian Hunter
2018-03-09 8:40 ` [tip:perf/core] " tip-bot for Adrian Hunter
2018-03-06 9:13 ` [PATCH 4/7] perf auxtrace: Rename some buffer-queuing functions Adrian Hunter
2018-03-09 8:40 ` [tip:perf/core] " tip-bot for Adrian Hunter
2018-03-06 9:13 ` [PATCH 5/7] perf auxtrace: Make auxtrace_queues__add_buffer() return buffer_ptr Adrian Hunter
2018-03-09 8:41 ` [tip:perf/core] " tip-bot for Adrian Hunter
2018-03-06 9:13 ` [PATCH 6/7] perf auxtrace: Make auxtrace_queues__add_buffer() allocate struct buffer Adrian Hunter
2018-03-06 20:25 ` Arnaldo Carvalho de Melo
2018-03-07 8:06 ` Adrian Hunter
2018-03-07 14:11 ` Arnaldo Carvalho de Melo
2018-04-05 6:17 ` Adrian Hunter
2018-04-05 11:33 ` Arnaldo Carvalho de Melo
2018-04-06 17:04 ` [tip:perf/urgent] " tip-bot for Adrian Hunter
2018-03-06 9:13 ` [PATCH 7/7] perf auxtrace: Make auxtrace_queues__add_buffer() do CPU filtering Adrian Hunter
2018-04-06 11:44 ` Adrian Hunter
2018-04-10 5:28 ` [tip:perf/urgent] " tip-bot for Adrian Hunter
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=1520327598-1317-2-git-send-email-adrian.hunter@intel.com \
--to=adrian.hunter@intel.com \
--cc=acme@kernel.org \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.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).