From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
To: David Ahern <dsahern@gmail.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Ingo Molnar <mingo@kernel.org>,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
lkml <linux-kernel@vger.kernel.org>,
"Steven Rostedt (Red Hat)" <rostedt@goodmis.org>,
Oleg Nesterov <oleg@redhat.com>,
"David A. Long" <dave.long@linaro.org>,
systemtap@sourceware.org, yrl.pp-manager.tt@hitachi.com,
Namhyung Kim <namhyung@kernel.org>
Subject: Re: [PATCH -tip v2 1/2] [CLEANUP] perf-probe: Expand given path to absolute path
Date: Thu, 26 Dec 2013 11:22:48 -0300 [thread overview]
Message-ID: <20131226142248.GE30980@ghostprotocols.net> (raw)
In-Reply-To: <52BC39D6.3090908@gmail.com>
Em Thu, Dec 26, 2013 at 09:14:46AM -0500, David Ahern escreveu:
> On 12/26/13, 12:41 AM, Masami Hiramatsu wrote:
> >@@ -180,7 +181,20 @@ static int opt_set_target(const struct option *opt, const char *str,
> > else
> > return ret;
> >
> >- params.target = str;
> >+ /* Expand given path to absolute path, except for modulename */
> >+ if (params.uprobes || strchr(str, '/')) {
> >+ tmp = realpath(str, NULL);
> >+ if (!tmp) {
> >+ pr_warning("Failed to find the path of %s.\n",
> >+ str);
>
> That error message will be misleading if it is generated. How about:
> Failed to get the absolute path of %s: %d\n", str, errno.
Changed it to:
pr_warning("Failed to get the absolute path of %s: %m\n", str);
> >+ return ret;
> >+ }
> >+ } else {
> >+ tmp = strdup(str);
> >+ if (!tmp)
> >+ return -ENOMEM;
> >+ }
> >+ params.target = tmp;
>
> When is params.target freed?
> David
next prev parent reply other threads:[~2013-12-26 14:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-26 5:41 [PATCH -tip v2 0/2] perf-probe: Dwarf support for uprobes Masami Hiramatsu
2013-12-26 5:41 ` [PATCH -tip v2 1/2] [CLEANUP] perf-probe: Expand given path to absolute path Masami Hiramatsu
2013-12-26 14:14 ` David Ahern
2013-12-26 14:22 ` Arnaldo Carvalho de Melo [this message]
2013-12-27 6:14 ` Masami Hiramatsu
2013-12-27 14:20 ` David Ahern
2013-12-27 17:49 ` Arnaldo Carvalho de Melo
2013-12-27 19:25 ` Arnaldo Carvalho de Melo
2014-01-12 18:39 ` [tip:perf/core] perf probe: " tip-bot for Masami Hiramatsu
2013-12-26 5:41 ` [PATCH -tip v2 2/2] perf-probe: Support basic dwarf-based operations on uprobe events Masami Hiramatsu
2013-12-26 14:38 ` David Ahern
2013-12-26 18:38 ` Arnaldo Carvalho de Melo
2013-12-27 6:52 ` Masami Hiramatsu
2014-01-12 18:39 ` [tip:perf/core] perf probe: " tip-bot for Masami Hiramatsu
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=20131226142248.GE30980@ghostprotocols.net \
--to=acme@ghostprotocols.net \
--cc=dave.long@linaro.org \
--cc=dsahern@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=oleg@redhat.com \
--cc=rostedt@goodmis.org \
--cc=srikar@linux.vnet.ibm.com \
--cc=systemtap@sourceware.org \
--cc=yrl.pp-manager.tt@hitachi.com \
/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