From: Jiri Olsa <jolsa@redhat.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@kernel.org>, Paul Mackerras <paulus@samba.org>,
Namhyung Kim <namhyung.kim@lge.com>,
LKML <linux-kernel@vger.kernel.org>,
David Ahern <dsahern@gmail.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Minchan Kim <minchan@kernel.org>
Subject: Re: [PATCH 03/13] perf annotate: Move session handling out of __cmd_annotate()
Date: Wed, 13 Aug 2014 13:48:22 +0200 [thread overview]
Message-ID: <20140813114822.GD2370@krava.brq.redhat.com> (raw)
In-Reply-To: <1407825645-24586-4-git-send-email-namhyung@kernel.org>
On Tue, Aug 12, 2014 at 03:40:35PM +0900, Namhyung Kim wrote:
SNIP
>
> @@ -301,6 +281,10 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
> .ordering_requires_timestamps = true,
> },
> };
> + struct perf_data_file file = {
> + .path = input_name,
> + .mode = PERF_DATA_MODE_READ,
> + };
> const struct option options[] = {
> OPT_STRING('i', "input", &input_name, "file",
> "input file name"),
> @@ -308,7 +292,7 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
> "only consider symbols in these dsos"),
> OPT_STRING('s', "symbol", &annotate.sym_hist_filter, "symbol",
> "symbol to annotate"),
> - OPT_BOOLEAN('f', "force", &annotate.force, "don't complain, do it"),
> + OPT_BOOLEAN('f', "force", &file.force, "don't complain, do it"),
> OPT_INCR('v', "verbose", &verbose,
> "be more verbose (show symbol address, etc)"),
> OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
> @@ -341,6 +325,7 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
> "Show event group information together"),
> OPT_END()
> };
> + int ret;
>
> argc = parse_options(argc, argv, options, annotate_usage, 0);
>
> @@ -353,11 +338,16 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
>
> setup_browser(true);
>
> + annotate.session = perf_session__new(&file, false, &annotate.tool);
> + if (annotate.session == NULL)
> + return -ENOMEM;
I know you're just moving code, but perf_session__new could
fail for more reasons than just ENOMEM, which is the most
unlikely case ;-) -1 is probably better option here
jirka
next prev parent reply other threads:[~2014-08-13 11:48 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-12 6:40 [PATCHSET 00/13] perf tools: Fix vmlinux search path initialization Namhyung Kim
2014-08-12 6:40 ` [PATCH 01/13] perf script: Fix possible memory leaks Namhyung Kim
2014-08-13 6:21 ` Adrian Hunter
2014-08-13 7:05 ` Namhyung Kim
2014-08-13 19:27 ` Arnaldo Carvalho de Melo
2014-08-14 8:45 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-08-12 6:40 ` [PATCH 02/13] perf tools: Fix a memory leak in vmlinux_path__init() Namhyung Kim
2014-08-14 8:45 ` [tip:perf/core] perf symbols: " tip-bot for Namhyung Kim
2014-08-12 6:40 ` [PATCH 03/13] perf annotate: Move session handling out of __cmd_annotate() Namhyung Kim
2014-08-13 11:48 ` Jiri Olsa [this message]
2014-08-19 6:03 ` Namhyung Kim
2014-08-14 8:46 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-08-12 6:40 ` [PATCH 04/13] perf buildid-cache: Move session handling into cmd_buildid_cache() Namhyung Kim
2014-08-14 8:46 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-08-12 6:40 ` [PATCH 05/13] perf inject: Move session handling out of __cmd_inject() Namhyung Kim
2014-08-14 8:46 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-08-12 6:40 ` [PATCH 06/13] perf kmem: Move session handling out of __cmd_kmem() Namhyung Kim
2014-08-14 8:46 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-08-12 6:40 ` [PATCH 07/13] perf kvm: Move call to symbol__init() after creating session Namhyung Kim
2014-08-14 8:47 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-08-12 6:40 ` [PATCH 08/13] perf lock: " Namhyung Kim
2014-08-14 8:47 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-08-12 6:40 ` [PATCH 09/13] perf sched: " Namhyung Kim
2014-08-14 8:47 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-08-12 6:40 ` [PATCH 10/13] perf script: " Namhyung Kim
2014-08-14 8:47 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-08-12 6:40 ` [PATCH 11/13] perf timechart: " Namhyung Kim
2014-08-14 8:48 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-08-12 6:40 ` [PATCH 12/13] perf trace: " Namhyung Kim
2014-08-14 8:48 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-08-12 6:40 ` [PATCH 13/13] perf tools: Check recorded kernel version when finding vmlinux Namhyung Kim
2014-08-14 8:48 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-08-13 12:49 ` [PATCHSET 00/13] perf tools: Fix vmlinux search path initialization Jiri Olsa
[not found] <5413EFA5.4020706@gmail.com>
2014-09-13 7:52 ` [PATCH 03/13] perf annotate: Move session handling out of __cmd_annotate() taeung
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=20140813114822.GD2370@krava.brq.redhat.com \
--to=jolsa@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=dsahern@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=minchan@kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.com \
--cc=namhyung@kernel.org \
--cc=paulus@samba.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
Powered by JetHome