diff options
-rw-r--r-- | tools/perf/builtin-record.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index a177a591b52c..e1dfef24887f 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -202,8 +202,12 @@ static void pid_synthesize_comm_event(pid_t pid, int full) | |||
202 | 202 | ||
203 | fd = open(filename, O_RDONLY); | 203 | fd = open(filename, O_RDONLY); |
204 | if (fd < 0) { | 204 | if (fd < 0) { |
205 | fprintf(stderr, "couldn't open %s\n", filename); | 205 | /* |
206 | exit(EXIT_FAILURE); | 206 | * We raced with a task exiting - just return: |
207 | */ | ||
208 | if (verbose) | ||
209 | fprintf(stderr, "couldn't open %s\n", filename); | ||
210 | return; | ||
207 | } | 211 | } |
208 | if (read(fd, bf, sizeof(bf)) < 0) { | 212 | if (read(fd, bf, sizeof(bf)) < 0) { |
209 | fprintf(stderr, "couldn't read %s\n", filename); | 213 | fprintf(stderr, "couldn't read %s\n", filename); |
@@ -273,8 +277,12 @@ static void pid_synthesize_mmap_samples(pid_t pid) | |||
273 | 277 | ||
274 | fp = fopen(filename, "r"); | 278 | fp = fopen(filename, "r"); |
275 | if (fp == NULL) { | 279 | if (fp == NULL) { |
276 | fprintf(stderr, "couldn't open %s\n", filename); | 280 | /* |
277 | exit(EXIT_FAILURE); | 281 | * We raced with a task exiting - just return: |
282 | */ | ||
283 | if (verbose) | ||
284 | fprintf(stderr, "couldn't open %s\n", filename); | ||
285 | return; | ||
278 | } | 286 | } |
279 | while (1) { | 287 | while (1) { |
280 | char bf[BUFSIZ], *pbf = bf; | 288 | char bf[BUFSIZ], *pbf = bf; |