Tzvetomir Stoyanov | bb3dd7e | 2018-10-05 12:22:25 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: LGPL-2.1 |
| 2 | /* |
| 3 | * Copyright (C) 2009, 2010 Red Hat Inc, Steven Rostedt <srostedt@redhat.com> |
| 4 | * |
| 5 | */ |
| 6 | |
| 7 | #ifndef _PARSE_EVENTS_INT_H |
| 8 | #define _PARSE_EVENTS_INT_H |
| 9 | |
Tzvetomir Stoyanov | 2e4318a | 2018-11-30 23:08:09 -0500 | [diff] [blame] | 10 | struct tep_cmdline; |
Tzvetomir Stoyanov | bb3dd7e | 2018-10-05 12:22:25 -0400 | [diff] [blame] | 11 | struct cmdline_list; |
| 12 | struct func_map; |
| 13 | struct func_list; |
| 14 | struct event_handler; |
| 15 | struct func_resolver; |
Tzvetomir Stoyanov (VMware) | 4d70cae | 2020-07-02 14:53:49 -0400 | [diff] [blame] | 16 | struct tep_plugins_dir; |
Tzvetomir Stoyanov | bb3dd7e | 2018-10-05 12:22:25 -0400 | [diff] [blame] | 17 | |
Tzvetomir Stoyanov (VMware) | a41c321 | 2020-09-30 14:07:33 +0300 | [diff] [blame] | 18 | #define __hidden __attribute__((visibility ("hidden"))) |
| 19 | |
Tzvetomir Stoyanov | bb3dd7e | 2018-10-05 12:22:25 -0400 | [diff] [blame] | 20 | struct tep_handle { |
| 21 | int ref_count; |
| 22 | |
| 23 | int header_page_ts_offset; |
| 24 | int header_page_ts_size; |
| 25 | int header_page_size_offset; |
| 26 | int header_page_size_size; |
| 27 | int header_page_data_offset; |
| 28 | int header_page_data_size; |
| 29 | int header_page_overwrite; |
| 30 | |
| 31 | enum tep_endian file_bigendian; |
| 32 | enum tep_endian host_bigendian; |
| 33 | |
Tzvetomir Stoyanov | bb3dd7e | 2018-10-05 12:22:25 -0400 | [diff] [blame] | 34 | int old_format; |
| 35 | |
| 36 | int cpus; |
| 37 | int long_size; |
| 38 | int page_size; |
| 39 | |
Tzvetomir Stoyanov | 2e4318a | 2018-11-30 23:08:09 -0500 | [diff] [blame] | 40 | struct tep_cmdline *cmdlines; |
Tzvetomir Stoyanov | bb3dd7e | 2018-10-05 12:22:25 -0400 | [diff] [blame] | 41 | struct cmdline_list *cmdlist; |
| 42 | int cmdline_count; |
| 43 | |
| 44 | struct func_map *func_map; |
| 45 | struct func_resolver *func_resolver; |
| 46 | struct func_list *funclist; |
| 47 | unsigned int func_count; |
| 48 | |
| 49 | struct printk_map *printk_map; |
| 50 | struct printk_list *printklist; |
| 51 | unsigned int printk_count; |
| 52 | |
Tzvetomir Stoyanov | 97fbf3f | 2018-11-30 10:44:07 -0500 | [diff] [blame] | 53 | struct tep_event **events; |
Tzvetomir Stoyanov | bb3dd7e | 2018-10-05 12:22:25 -0400 | [diff] [blame] | 54 | int nr_events; |
Tzvetomir Stoyanov | 97fbf3f | 2018-11-30 10:44:07 -0500 | [diff] [blame] | 55 | struct tep_event **sort_events; |
Tzvetomir Stoyanov | bb3dd7e | 2018-10-05 12:22:25 -0400 | [diff] [blame] | 56 | enum tep_event_sort_type last_type; |
| 57 | |
| 58 | int type_offset; |
| 59 | int type_size; |
| 60 | |
| 61 | int pid_offset; |
| 62 | int pid_size; |
| 63 | |
| 64 | int pc_offset; |
| 65 | int pc_size; |
| 66 | |
| 67 | int flags_offset; |
| 68 | int flags_size; |
| 69 | |
| 70 | int ld_offset; |
| 71 | int ld_size; |
| 72 | |
Tzvetomir Stoyanov | bb3dd7e | 2018-10-05 12:22:25 -0400 | [diff] [blame] | 73 | int test_filters; |
| 74 | |
| 75 | int flags; |
| 76 | |
| 77 | struct tep_format_field *bprint_ip_field; |
| 78 | struct tep_format_field *bprint_fmt_field; |
| 79 | struct tep_format_field *bprint_buf_field; |
| 80 | |
| 81 | struct event_handler *handlers; |
| 82 | struct tep_function_handler *func_handlers; |
| 83 | |
| 84 | /* cache */ |
Tzvetomir Stoyanov | 97fbf3f | 2018-11-30 10:44:07 -0500 | [diff] [blame] | 85 | struct tep_event *last_event; |
Tzvetomir Stoyanov (VMware) | 4d70cae | 2020-07-02 14:53:49 -0400 | [diff] [blame] | 86 | |
| 87 | struct tep_plugins_dir *plugins_dir; |
Tzvetomir Stoyanov | bb3dd7e | 2018-10-05 12:22:25 -0400 | [diff] [blame] | 88 | }; |
| 89 | |
Tzvetomir Stoyanov (VMware) | e7a9088 | 2020-07-02 14:53:51 -0400 | [diff] [blame] | 90 | enum tep_print_parse_type { |
Tzvetomir Stoyanov (VMware) | 602e29f | 2020-07-21 21:16:49 -0400 | [diff] [blame] | 91 | PRINT_FMT_STRING, |
Tzvetomir Stoyanov (VMware) | e7a9088 | 2020-07-02 14:53:51 -0400 | [diff] [blame] | 92 | PRINT_FMT_ARG_DIGIT, |
| 93 | PRINT_FMT_ARG_POINTER, |
| 94 | PRINT_FMT_ARG_STRING, |
| 95 | }; |
| 96 | |
| 97 | struct tep_print_parse { |
| 98 | struct tep_print_parse *next; |
| 99 | |
| 100 | char *format; |
| 101 | int ls; |
| 102 | enum tep_print_parse_type type; |
| 103 | struct tep_print_arg *arg; |
| 104 | struct tep_print_arg *len_as_arg; |
| 105 | }; |
| 106 | |
Tzvetomir Stoyanov (VMware) | a41c321 | 2020-09-30 14:07:33 +0300 | [diff] [blame] | 107 | void free_tep_event(struct tep_event *event); |
| 108 | void free_tep_format_field(struct tep_format_field *field); |
| 109 | void free_tep_plugin_paths(struct tep_handle *tep); |
Tzvetomir Stoyanov | 6cd99d2 | 2018-11-30 10:44:10 -0500 | [diff] [blame] | 110 | |
Tzvetomir Stoyanov (VMware) | a41c321 | 2020-09-30 14:07:33 +0300 | [diff] [blame] | 111 | unsigned short data2host2(struct tep_handle *tep, unsigned short data); |
| 112 | unsigned int data2host4(struct tep_handle *tep, unsigned int data); |
| 113 | unsigned long long data2host8(struct tep_handle *tep, unsigned long long data); |
| 114 | |
| 115 | /* access to the internal parser */ |
| 116 | int peek_char(void); |
| 117 | void init_input_buf(const char *buf, unsigned long long size); |
| 118 | unsigned long long get_input_buf_ptr(void); |
| 119 | const char *get_input_buf(void); |
| 120 | enum tep_event_type read_token(char **tok); |
| 121 | void free_token(char *tok); |
Tzvetomir Stoyanov | 6cd99d2 | 2018-11-30 10:44:10 -0500 | [diff] [blame] | 122 | |
Tzvetomir Stoyanov | bb3dd7e | 2018-10-05 12:22:25 -0400 | [diff] [blame] | 123 | #endif /* _PARSE_EVENTS_INT_H */ |