aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-record.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r--tools/perf/builtin-record.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 378b85b731a7..4869050e7194 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -238,6 +238,7 @@ static struct perf_event_header finished_round_event = {
238 238
239static int record__mmap_read_all(struct record *rec) 239static int record__mmap_read_all(struct record *rec)
240{ 240{
241 u64 bytes_written = rec->bytes_written;
241 int i; 242 int i;
242 int rc = 0; 243 int rc = 0;
243 244
@@ -250,7 +251,11 @@ static int record__mmap_read_all(struct record *rec)
250 } 251 }
251 } 252 }
252 253
253 if (perf_header__has_feat(&rec->session->header, HEADER_TRACING_DATA)) 254 /*
255 * Mark the round finished in case we wrote
256 * at least one event.
257 */
258 if (bytes_written != rec->bytes_written)
254 rc = record__write(rec, &finished_round_event, sizeof(finished_round_event)); 259 rc = record__write(rec, &finished_round_event, sizeof(finished_round_event));
255 260
256out: 261out: