diff options
Diffstat (limited to 'trace-input.c')
-rw-r--r-- | trace-input.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/trace-input.c b/trace-input.c index 815d250..1c79843 100644 --- a/trace-input.c +++ b/trace-input.c | |||
@@ -82,6 +82,8 @@ struct tracecmd_input { | |||
82 | int ref; | 82 | int ref; |
83 | struct cpu_data *cpu_data; | 83 | struct cpu_data *cpu_data; |
84 | 84 | ||
85 | struct tracecmd_ftrace finfo; | ||
86 | |||
85 | /* file information */ | 87 | /* file information */ |
86 | size_t header_files_start; | 88 | size_t header_files_start; |
87 | size_t ftrace_files_start; | 89 | size_t ftrace_files_start; |
@@ -479,9 +481,6 @@ int tracecmd_read_headers(struct tracecmd_input *handle) | |||
479 | if (ret < 0) | 481 | if (ret < 0) |
480 | return -1; | 482 | return -1; |
481 | 483 | ||
482 | /* register default ftrace functions first */ | ||
483 | tracecmd_ftrace_overrides(handle); | ||
484 | |||
485 | return 0; | 484 | return 0; |
486 | } | 485 | } |
487 | 486 | ||
@@ -676,6 +675,11 @@ void free_record(struct record *record) | |||
676 | __free_record(record); | 675 | __free_record(record); |
677 | } | 676 | } |
678 | 677 | ||
678 | void tracecmd_record_ref(struct record *record) | ||
679 | { | ||
680 | record->ref_count++; | ||
681 | } | ||
682 | |||
679 | static void free_next(struct tracecmd_input *handle, int cpu) | 683 | static void free_next(struct tracecmd_input *handle, int cpu) |
680 | { | 684 | { |
681 | struct record *record = handle->cpu_data[cpu].next; | 685 | struct record *record = handle->cpu_data[cpu].next; |
@@ -1514,7 +1518,8 @@ read_again: | |||
1514 | if (index < 0) | 1518 | if (index < 0) |
1515 | die("negative index on cpu record %d", cpu); | 1519 | die("negative index on cpu record %d", cpu); |
1516 | 1520 | ||
1517 | if (index >= handle->cpu_data[cpu].page_size + pevent->header_page_data_offset) { | 1521 | if (index + (pevent->old_format ? 0 : 4) >= |
1522 | handle->cpu_data[cpu].page_size + pevent->header_page_data_offset) { | ||
1518 | if (get_next_page(handle, cpu)) | 1523 | if (get_next_page(handle, cpu)) |
1519 | return NULL; | 1524 | return NULL; |
1520 | return tracecmd_peek_data(handle, cpu); | 1525 | return tracecmd_peek_data(handle, cpu); |
@@ -1978,6 +1983,9 @@ struct tracecmd_input *tracecmd_alloc_fd(int fd) | |||
1978 | if (!handle->pevent) | 1983 | if (!handle->pevent) |
1979 | goto failed_read; | 1984 | goto failed_read; |
1980 | 1985 | ||
1986 | /* register default ftrace functions first */ | ||
1987 | tracecmd_ftrace_overrides(handle, &handle->finfo); | ||
1988 | |||
1981 | handle->plugin_list = tracecmd_load_plugins(handle->pevent); | 1989 | handle->plugin_list = tracecmd_load_plugins(handle->pevent); |
1982 | 1990 | ||
1983 | handle->pevent->file_bigendian = buf[0]; | 1991 | handle->pevent->file_bigendian = buf[0]; |