From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753594AbcAGXQM (ORCPT ); Thu, 7 Jan 2016 18:16:12 -0500 Received: from mail-lb0-f179.google.com ([209.85.217.179]:34968 "EHLO mail-lb0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752189AbcAGXQL (ORCPT ); Thu, 7 Jan 2016 18:16:11 -0500 Date: Fri, 8 Jan 2016 00:16:00 +0100 From: Marcin =?utf-8?Q?=C5=9Alusarz?= To: Namhyung Kim Cc: LKML , Arnaldo Carvalho de Melo Subject: Re: [PATCH] perf tools: handle spaces in file names obtained from /proc/pid/maps Message-ID: <20160107231600.GA21372@marcin-Inspiron-7720> References: <20160101030321.GA2217@marcin-Inspiron-7720> <20160104012528.GA5950@danjae.kornet> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160104012528.GA5950@danjae.kornet> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 04, 2016 at 10:25:28AM +0900, Namhyung Kim wrote: > Hi Marcin, > > On Fri, Jan 01, 2016 at 04:03:21AM +0100, Marcin Ślusarz wrote: > > Steam frequently puts game binaries in folders with spaces. > > > > Note: "(deleted)" markers are now treated as part of the file name. > > > > It probably worked before 6064803313bad9ae4cae233a9d56678adb2b6e7c > > ("perf tools: Use sscanf for parsing /proc/pid/maps"). > > > > Signed-off-by: Marcin Ślusarz > > Cc: Namhyung Kim > > Cc: Arnaldo Carvalho de Melo > > --- > > tools/perf/util/event.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c > > index 8b10621..ff17fe6 100644 > > --- a/tools/perf/util/event.c > > +++ b/tools/perf/util/event.c > > @@ -274,7 +274,7 @@ int perf_event__synthesize_mmap_events(struct perf_tool *tool, > > strcpy(execname, ""); > > > > /* 00400000-0040c000 r-xp 00000000 fd:01 41038 /bin/cat */ > > - n = sscanf(bf, "%"PRIx64"-%"PRIx64" %s %"PRIx64" %x:%x %u %s\n", > > + n = sscanf(bf, "%"PRIx64"-%"PRIx64" %s %"PRIx64" %x:%x %u %[^\n]s\n", > > Is the last 's' necessary? Nope. It should not be there. --- From: Marcin Ślusarz Subject: [PATCH v2] perf tools: handle spaces in file names obtained from /proc/pid/maps Steam frequently puts game binaries in folders with spaces. Note: "(deleted)" markers are now treated as part of the file name. It probably worked before 6064803313bad9ae4cae233a9d56678adb2b6e7c ("perf tools: Use sscanf for parsing /proc/pid/maps"). Signed-off-by: Marcin Ślusarz Cc: Namhyung Kim Cc: Arnaldo Carvalho de Melo --- tools/perf/util/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 8b10621..956187b 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c @@ -274,7 +274,7 @@ int perf_event__synthesize_mmap_events(struct perf_tool *tool, strcpy(execname, ""); /* 00400000-0040c000 r-xp 00000000 fd:01 41038 /bin/cat */ - n = sscanf(bf, "%"PRIx64"-%"PRIx64" %s %"PRIx64" %x:%x %u %s\n", + n = sscanf(bf, "%"PRIx64"-%"PRIx64" %s %"PRIx64" %x:%x %u %[^\n]\n", &event->mmap2.start, &event->mmap2.len, prot, &event->mmap2.pgoff, &event->mmap2.maj, &event->mmap2.min, -- 2.1.4