event-parse-local.h 2.6 KB

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