perf tools: handle spaces in file names obtained from /proc/pid/maps
PATCH 1/1 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").
--- tools/perf/util/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/event.c +1 -1
@@ -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", &event->mmap2.start, &event->mmap2.len, prot, &event->mmap2.pgoff, &event->mmap2.maj, &event->mmap2.min,
Signature · 1 line
2.1.4
Namhyung Kim
maintainerHi Marcin,
Quoted 19 lines · Marcin Ślusarz
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 <[email protected]>Cc Namhyung Kim <[email protected]>Cc Arnaldo Carvalho de Melo <[email protected]>--- tools/perf/util/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/util/event.c +0
-0
tools/perf/util/event.c int perf_event__synthesize_mmap_events(struct perf_tool *tool, · line 277
Quoted 5 lines
tools/perf/util/event.c +1
-1@@ -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?
Thanks,
Namhyung
Quoted 6 lines
tools/perf/util/event.c +0
-0&event->mmap2.start, &event->mmap2.len, prot, &event->mmap2.pgoff, &event->mmap2.maj, &event->mmap2.min,Signature · 1 line
2.1.4
Quoted 24 lines · Namhyung Kim
Hi Marcin,
Quoted 21 lines · Marcin Ślusarz
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 <[email protected]>Cc Namhyung Kim <[email protected]>Cc Arnaldo Carvalho de Melo <[email protected]>--- tools/perf/util/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/util/event.c +0
-0@@ -274,7 +274,7 @@ int perf_event__synthesize_mmap_events(struct perf_tool *tool,strcpy (execname,"" );
Quoted 5 lines
tools/perf/util/event.c int perf_event__synthesize_mmap_events(struct perf_tool *tool, · line 277
Quoted 3 lines
tools/perf/util/event.c +1
-1/* 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 <[email protected]>
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").
--- tools/perf/util/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/event.c +1 -1
@@ -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,
Signature · 1 line
2.1.4
Quoted 5 lines
From: Marcin Ślusarz <[email protected]>
Subject: [PATCH v2] perf tools: handle spaces in file names obtained from/proc/pid/mapsSteam frequently puts game binaries in folders with spaces.
Quoted 7 lines
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 <[email protected]>Cc Arnaldo Carvalho de Melo <[email protected]>
Thanks,
Namhyung
Quoted 20 lines
--- tools/perf/util/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/util/event.c +1
-1@@ -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,Signature · 1 line
2.1.4
PATCH v2 1/1 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").
--- tools/perf/util/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/event.c +1 -1
@@ -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,
Signature · 1 line
2.1.4
Quoted 10 lines · Marcin Ślusarz
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 <[email protected]>Acked-by Namhyung Kim <[email protected]>Cc Arnaldo Carvalho de Melo <[email protected]>
Gentle ping ;)
Quoted 20 lines
--- tools/perf/util/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/util/event.c +1
-1@@ -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,Signature · 1 line
2.1.4
Arnaldo Carvalho de Melo
AppliedEm Thu, Feb 04, 2016 at 11:39:25PM +0100, Marcin Ślusarz escreveu:
Quoted 5 lines · Marcin Ślusarz
Quoted 4 lines
Steam frequently puts game binaries in folders with spaces.
Note: "(deleted)" markers are now treated as part of the file name.
Quoted 8 lines
Quoted 6 lines
It probably worked before
6064803313bad9ae4cae233a9d56678adb2b6e7c("perf tools: Use sscanf for parsing/proc/pid/maps").Signed-off-by Marcin Ślusarz <[email protected]>Acked-by Namhyung Kim <[email protected]>Cc Arnaldo Carvalho de Melo <[email protected]>Gentle ping ;)
Thanks for being gentle, appreciated ;-)
Applied to perf/core,
- Arnaldo
Quoted 20 lines
Quoted 20 lines
--- tools/perf/util/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/util/event.c +1
-1@@ -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,Signature · 1 line
2.1.4
tip-bot for Marcin Ślusarz
merge botperf tools: handle spaces in file names obtained from /proc/pid/maps
Commit-ID: 89fee59b504f86925894fcc9ba79d5c933842f93 Gitweb: http://git.kernel.org/tip/89fee59b504f86925894fcc9ba79d5c933842f93 Author: Marcin Ślusarz <[email protected]> AuthorDate: Tue, 19 Jan 2016 20:03:03 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Fri, 5 Feb 2016 09:39:56 -0300
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.
--- tools/perf/util/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/event.c +1 -1
@@ -282,7 +282,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,