diff options
-rw-r--r-- | parse-events.c | 10 | ||||
-rw-r--r-- | parse-events.h | 3 | ||||
-rw-r--r-- | trace-input.c | 2 |
3 files changed, 9 insertions, 6 deletions
diff --git a/parse-events.c b/parse-events.c index 30d3ea0..0600973 100644 --- a/parse-events.c +++ b/parse-events.c | |||
@@ -3536,13 +3536,15 @@ static void parse_header_field(const char *field, | |||
3536 | * @pevent: the handle to the pevent | 3536 | * @pevent: the handle to the pevent |
3537 | * @buf: the buffer storing the header page format string | 3537 | * @buf: the buffer storing the header page format string |
3538 | * @size: the size of @buf | 3538 | * @size: the size of @buf |
3539 | * @long_size: the long size to use if there is no header | ||
3539 | * | 3540 | * |
3540 | * This parses the header page format for information on the | 3541 | * This parses the header page format for information on the |
3541 | * ring buffer used. The @buf should be copied from | 3542 | * ring buffer used. The @buf should be copied from |
3542 | * | 3543 | * |
3543 | * /sys/kernel/debug/tracing/events/header_page | 3544 | * /sys/kernel/debug/tracing/events/header_page |
3544 | */ | 3545 | */ |
3545 | int pevent_parse_header_page(struct pevent *pevent, char *buf, unsigned long size) | 3546 | int pevent_parse_header_page(struct pevent *pevent, char *buf, unsigned long size, |
3547 | int long_size) | ||
3546 | { | 3548 | { |
3547 | if (!size) { | 3549 | if (!size) { |
3548 | /* | 3550 | /* |
@@ -3550,10 +3552,10 @@ int pevent_parse_header_page(struct pevent *pevent, char *buf, unsigned long siz | |||
3550 | * Sorry but we just use what we find here in user space. | 3552 | * Sorry but we just use what we find here in user space. |
3551 | */ | 3553 | */ |
3552 | pevent->header_page_ts_size = sizeof(long long); | 3554 | pevent->header_page_ts_size = sizeof(long long); |
3553 | pevent->header_page_size_size = sizeof(long); | 3555 | pevent->header_page_size_size = long_size; |
3554 | pevent->header_page_data_offset = sizeof(long long) + sizeof(long); | 3556 | pevent->header_page_data_offset = sizeof(long long) + long_size; |
3555 | pevent->old_format = 1; | 3557 | pevent->old_format = 1; |
3556 | return 0; | 3558 | return -1; |
3557 | } | 3559 | } |
3558 | init_input_buf(buf, size); | 3560 | init_input_buf(buf, size); |
3559 | 3561 | ||
diff --git a/parse-events.h b/parse-events.h index 00bdc44..92f174e 100644 --- a/parse-events.h +++ b/parse-events.h | |||
@@ -352,7 +352,8 @@ int pevent_pid_is_registered(struct pevent *pevent, int pid); | |||
352 | void pevent_print_event(struct pevent *pevent, struct trace_seq *s, | 352 | void pevent_print_event(struct pevent *pevent, struct trace_seq *s, |
353 | struct record *record); | 353 | struct record *record); |
354 | 354 | ||
355 | int pevent_parse_header_page(struct pevent *pevent, char *buf, unsigned long size); | 355 | int pevent_parse_header_page(struct pevent *pevent, char *buf, unsigned long size, |
356 | int long_size); | ||
356 | 357 | ||
357 | int pevent_parse_event(struct pevent *pevent, char *buf, unsigned long size, char *sys); | 358 | int pevent_parse_event(struct pevent *pevent, char *buf, unsigned long size, char *sys); |
358 | 359 | ||
diff --git a/trace-input.c b/trace-input.c index d00d8c9..c55e94f 100644 --- a/trace-input.c +++ b/trace-input.c | |||
@@ -200,7 +200,7 @@ static int read_header_files(struct tracecmd_input *handle) | |||
200 | if (do_read_check(handle, header, size)) | 200 | if (do_read_check(handle, header, size)) |
201 | goto failed_read; | 201 | goto failed_read; |
202 | 202 | ||
203 | pevent_parse_header_page(pevent, header, size); | 203 | pevent_parse_header_page(pevent, header, size, handle->long_size); |
204 | free(header); | 204 | free(header); |
205 | 205 | ||
206 | /* | 206 | /* |