Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: LGPL-2.1
0002 /*
0003  * Copyright (C) 2009, 2010 Red Hat Inc, Steven Rostedt <srostedt@redhat.com>
0004  *
0005  */
0006 
0007 #ifndef _PARSE_EVENTS_INT_H
0008 #define _PARSE_EVENTS_INT_H
0009 
0010 struct tep_cmdline;
0011 struct cmdline_list;
0012 struct func_map;
0013 struct func_list;
0014 struct event_handler;
0015 struct func_resolver;
0016 struct tep_plugins_dir;
0017 
0018 #define __hidden __attribute__((visibility ("hidden")))
0019 
0020 struct tep_handle {
0021     int ref_count;
0022 
0023     int header_page_ts_offset;
0024     int header_page_ts_size;
0025     int header_page_size_offset;
0026     int header_page_size_size;
0027     int header_page_data_offset;
0028     int header_page_data_size;
0029     int header_page_overwrite;
0030 
0031     enum tep_endian file_bigendian;
0032     enum tep_endian host_bigendian;
0033 
0034     int old_format;
0035 
0036     int cpus;
0037     int long_size;
0038     int page_size;
0039 
0040     struct tep_cmdline *cmdlines;
0041     struct cmdline_list *cmdlist;
0042     int cmdline_count;
0043 
0044     struct func_map *func_map;
0045     struct func_resolver *func_resolver;
0046     struct func_list *funclist;
0047     unsigned int func_count;
0048 
0049     struct printk_map *printk_map;
0050     struct printk_list *printklist;
0051     unsigned int printk_count;
0052 
0053     struct tep_event **events;
0054     int nr_events;
0055     struct tep_event **sort_events;
0056     enum tep_event_sort_type last_type;
0057 
0058     int type_offset;
0059     int type_size;
0060 
0061     int pid_offset;
0062     int pid_size;
0063 
0064     int pc_offset;
0065     int pc_size;
0066 
0067     int flags_offset;
0068     int flags_size;
0069 
0070     int ld_offset;
0071     int ld_size;
0072 
0073     int test_filters;
0074 
0075     int flags;
0076 
0077     struct tep_format_field *bprint_ip_field;
0078     struct tep_format_field *bprint_fmt_field;
0079     struct tep_format_field *bprint_buf_field;
0080 
0081     struct event_handler *handlers;
0082     struct tep_function_handler *func_handlers;
0083 
0084     /* cache */
0085     struct tep_event *last_event;
0086 
0087     struct tep_plugins_dir *plugins_dir;
0088 };
0089 
0090 enum tep_print_parse_type {
0091     PRINT_FMT_STRING,
0092     PRINT_FMT_ARG_DIGIT,
0093     PRINT_FMT_ARG_POINTER,
0094     PRINT_FMT_ARG_STRING,
0095 };
0096 
0097 struct tep_print_parse {
0098     struct tep_print_parse  *next;
0099 
0100     char                *format;
0101     int             ls;
0102     enum tep_print_parse_type   type;
0103     struct tep_print_arg        *arg;
0104     struct tep_print_arg        *len_as_arg;
0105 };
0106 
0107 void free_tep_event(struct tep_event *event);
0108 void free_tep_format_field(struct tep_format_field *field);
0109 void free_tep_plugin_paths(struct tep_handle *tep);
0110 
0111 unsigned short data2host2(struct tep_handle *tep, unsigned short data);
0112 unsigned int data2host4(struct tep_handle *tep, unsigned int data);
0113 unsigned long long data2host8(struct tep_handle *tep, unsigned long long data);
0114 
0115 /* access to the internal parser */
0116 int peek_char(void);
0117 void init_input_buf(const char *buf, unsigned long long size);
0118 unsigned long long get_input_buf_ptr(void);
0119 const char *get_input_buf(void);
0120 enum tep_event_type read_token(char **tok);
0121 void free_token(char *tok);
0122 
0123 #endif /* _PARSE_EVENTS_INT_H */