From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22618 invoked by alias); 26 Dec 2013 14:22:57 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 22610 invoked by uid 89); 26 Dec 2013 14:22:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qe0-f43.google.com Received: from mail-qe0-f43.google.com (HELO mail-qe0-f43.google.com) (209.85.128.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 26 Dec 2013 14:22:56 +0000 Received: by mail-qe0-f43.google.com with SMTP id jy17so7987358qeb.2 for ; Thu, 26 Dec 2013 06:22:54 -0800 (PST) X-Received: by 10.224.65.65 with SMTP id h1mr67878809qai.104.1388067774091; Thu, 26 Dec 2013 06:22:54 -0800 (PST) Received: from zoo.ghostprotocols.net ([177.135.9.158]) by mx.google.com with ESMTPSA id nz10sm38066618qeb.10.2013.12.26.06.22.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Dec 2013 06:22:53 -0800 (PST) Received: by zoo.ghostprotocols.net (Postfix, from userid 1000) id 526E61E1446; Thu, 26 Dec 2013 11:22:48 -0300 (BRT) Date: Thu, 26 Dec 2013 14:22:00 -0000 From: Arnaldo Carvalho de Melo To: David Ahern Cc: Masami Hiramatsu , Ingo Molnar , Srikar Dronamraju , lkml , "Steven Rostedt (Red Hat)" , Oleg Nesterov , "David A. Long" , systemtap@sourceware.org, yrl.pp-manager.tt@hitachi.com, Namhyung Kim Subject: Re: [PATCH -tip v2 1/2] [CLEANUP] perf-probe: Expand given path to absolute path Message-ID: <20131226142248.GE30980@ghostprotocols.net> References: <20131226054148.22364.25224.stgit@kbuild-fedora.novalocal> <20131226054150.22364.12187.stgit@kbuild-fedora.novalocal> <52BC39D6.3090908@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52BC39D6.3090908@gmail.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013-q4/txt/msg00513.txt.bz2 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