[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131107080348.GC31926@gmail.com>
Date: Thu, 7 Nov 2013 09:03:48 +0100
From: Ingo Molnar <mingo@...nel.org>
To: David Ahern <dsahern@...il.com>
Cc: acme@...stprotocols.net, linux-kernel@...r.kernel.org,
jolsa@...hat.com, Frederic Weisbecker <fweisbec@...il.com>,
Namhyung Kim <namhyung.kim@....com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 1/4] perf record: Refactor feature handling into a
separate function
* David Ahern <dsahern@...il.com> wrote:
> Code move only. No logic changes.
>
> Signed-off-by: David Ahern <dsahern@...il.com>
> Cc: Ingo Molnar <mingo@...nel.org>
> Cc: Frederic Weisbecker <fweisbec@...il.com>
> Cc: Jiri Olsa <jolsa@...hat.com>
> Cc: Namhyung Kim <namhyung.kim@....com>
> Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> Cc: Stephane Eranian <eranian@...gle.com>
> ---
> tools/perf/builtin-record.c | 33 +++++++++++++++++++++------------
> 1 file changed, 21 insertions(+), 12 deletions(-)
>
> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> index ea4c04f7437e..2932069ad7a8 100644
> --- a/tools/perf/builtin-record.c
> +++ b/tools/perf/builtin-record.c
> @@ -342,9 +342,28 @@ out:
> return rc;
> }
>
> +static void perf_record__init_features(struct perf_record *rec)
> +{
> + struct perf_evlist *evsel_list = rec->evlist;
> + struct perf_session *session = rec->session;
> + int feat;
> +
> + for (feat = HEADER_FIRST_FEATURE; feat < HEADER_LAST_FEATURE; feat++)
> + perf_header__set_feat(&session->header, feat);
> +
> + if (rec->no_buildid)
> + perf_header__clear_feat(&session->header, HEADER_BUILD_ID);
> +
> + if (!have_tracepoints(&evsel_list->entries))
> + perf_header__clear_feat(&session->header, HEADER_TRACING_DATA);
> +
> + if (!rec->opts.branch_stack)
> + perf_header__clear_feat(&session->header, HEADER_BRANCH_STACK);
> +}
> +
> static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
> {
> - int err, feat;
> + int err;
> unsigned long waking = 0;
> const bool forks = argc > 0;
> struct machine *machine;
> @@ -371,17 +390,7 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
>
> rec->session = session;
>
> - for (feat = HEADER_FIRST_FEATURE; feat < HEADER_LAST_FEATURE; feat++)
> - perf_header__set_feat(&session->header, feat);
> -
> - if (rec->no_buildid)
> - perf_header__clear_feat(&session->header, HEADER_BUILD_ID);
> -
> - if (!have_tracepoints(&evsel_list->entries))
> - perf_header__clear_feat(&session->header, HEADER_TRACING_DATA);
> -
> - if (!rec->opts.branch_stack)
> - perf_header__clear_feat(&session->header, HEADER_BRANCH_STACK);
> + perf_record__init_features(rec);
>
> if (forks) {
> err = perf_evlist__prepare_workload(evsel_list, &opts->target,
> --
> 1.8.3.4 (Apple Git-47)
Acked-by: Ingo Molnar <mingo@...nel.org>
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists