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.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 4c9aaa1f688a..c8c784c430b6 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -117,9 +117,24 @@ static int record__process_auxtrace(struct perf_tool *tool,
117 size_t len1, void *data2, size_t len2) 117 size_t len1, void *data2, size_t len2)
118{ 118{
119 struct record *rec = container_of(tool, struct record, tool); 119 struct record *rec = container_of(tool, struct record, tool);
120 struct perf_data_file *file = &rec->file;
120 size_t padding; 121 size_t padding;
121 u8 pad[8] = {0}; 122 u8 pad[8] = {0};
122 123
124 if (!perf_data_file__is_pipe(file)) {
125 off_t file_offset;
126 int fd = perf_data_file__fd(file);
127 int err;
128
129 file_offset = lseek(fd, 0, SEEK_CUR);
130 if (file_offset == -1)
131 return -1;
132 err = auxtrace_index__auxtrace_event(&rec->session->auxtrace_index,
133 event, file_offset);
134 if (err)
135 return err;
136 }
137
123 /* event.auxtrace.size includes padding, see __auxtrace_mmap__read() */ 138 /* event.auxtrace.size includes padding, see __auxtrace_mmap__read() */
124 padding = (len1 + len2) & 7; 139 padding = (len1 + len2) & 7;
125 if (padding) 140 if (padding)