aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/trace-event-read.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/tools/perf/util/trace-event-read.c b/tools/perf/util/trace-event-read.c
index 644ad3b4edec..af215c0d2379 100644
--- a/tools/perf/util/trace-event-read.c
+++ b/tools/perf/util/trace-event-read.c
@@ -43,7 +43,7 @@ int file_bigendian;
43int host_bigendian; 43int host_bigendian;
44static int long_size; 44static int long_size;
45 45
46static ssize_t calc_data_size; 46static ssize_t trace_data_size;
47static bool repipe; 47static bool repipe;
48 48
49static int __do_read(int fd, void *buf, int size) 49static int __do_read(int fd, void *buf, int size)
@@ -83,8 +83,7 @@ static int do_read(void *data, int size)
83 return -1; 83 return -1;
84 } 84 }
85 85
86 if (calc_data_size) 86 trace_data_size += r;
87 calc_data_size += r;
88 87
89 return r; 88 return r;
90} 89}
@@ -155,8 +154,7 @@ static char *read_string(void)
155 break; 154 break;
156 } 155 }
157 156
158 if (calc_data_size) 157 trace_data_size += size;
159 calc_data_size += size;
160 158
161 str = malloc(size); 159 str = malloc(size);
162 if (str) 160 if (str)
@@ -356,9 +354,7 @@ ssize_t trace_report(int fd, struct pevent **ppevent, bool __repipe)
356 354
357 *ppevent = NULL; 355 *ppevent = NULL;
358 356
359 calc_data_size = 1;
360 repipe = __repipe; 357 repipe = __repipe;
361
362 input_fd = fd; 358 input_fd = fd;
363 359
364 if (do_read(buf, 3) < 0) 360 if (do_read(buf, 3) < 0)
@@ -417,8 +413,7 @@ ssize_t trace_report(int fd, struct pevent **ppevent, bool __repipe)
417 if (err) 413 if (err)
418 goto out; 414 goto out;
419 415
420 size = calc_data_size - 1; 416 size = trace_data_size;
421 calc_data_size = 0;
422 repipe = false; 417 repipe = false;
423 418
424 if (show_funcs) { 419 if (show_funcs) {