0001 libtraceevent(3)
0002 ================
0003
0004 NAME
0005 ----
0006 libtraceevent - Linux kernel trace event library
0007
0008 SYNOPSIS
0009 --------
0010 [verse]
0011 --
0012 *#include <event-parse.h>*
0013
0014 Management of tep handler data structure and access of its members:
0015 struct tep_handle pass:[*]*tep_alloc*(void);
0016 void *tep_free*(struct tep_handle pass:[*]_tep_);
0017 void *tep_ref*(struct tep_handle pass:[*]_tep_);
0018 void *tep_unref*(struct tep_handle pass:[*]_tep_);
0019 int *tep_get_ref*(struct tep_handle pass:[*]_tep_);
0020 void *tep_set_flag*(struct tep_handle pass:[*]_tep_, enum tep_flag _flag_);
0021 void *tep_clear_flag*(struct tep_handle pass:[*]_tep_, enum tep_flag _flag_);
0022 bool *tep_test_flag*(struct tep_handle pass:[*]_tep_, enum tep_flag _flags_);
0023 int *tep_get_cpus*(struct tep_handle pass:[*]_tep_);
0024 void *tep_set_cpus*(struct tep_handle pass:[*]_tep_, int _cpus_);
0025 int *tep_get_long_size*(strucqt tep_handle pass:[*]_tep_);
0026 void *tep_set_long_size*(struct tep_handle pass:[*]_tep_, int _long_size_);
0027 int *tep_get_page_size*(struct tep_handle pass:[*]_tep_);
0028 void *tep_set_page_size*(struct tep_handle pass:[*]_tep_, int _page_size_);
0029 int *tep_get_header_page_size*(struct tep_handle pass:[*]_tep_);
0030 int *tep_get_header_timestamp_size*(struct tep_handle pass:[*]_tep_);
0031 bool *tep_is_old_format*(struct tep_handle pass:[*]_tep_);
0032 int *tep_strerror*(struct tep_handle pass:[*]_tep_, enum tep_errno _errnum_, char pass:[*]_buf_, size_t _buflen_);
0033
0034 Register / unregister APIs:
0035 int *tep_register_function*(struct tep_handle pass:[*]_tep_, char pass:[*]_name_, unsigned long long _addr_, char pass:[*]_mod_);
0036 int *tep_register_event_handler*(struct tep_handle pass:[*]_tep_, int _id_, const char pass:[*]_sys_name_, const char pass:[*]_event_name_, tep_event_handler_func _func_, void pass:[*]_context_);
0037 int *tep_unregister_event_handler*(struct tep_handle pass:[*]tep, int id, const char pass:[*]sys_name, const char pass:[*]event_name, tep_event_handler_func func, void pass:[*]_context_);
0038 int *tep_register_print_string*(struct tep_handle pass:[*]_tep_, const char pass:[*]_fmt_, unsigned long long _addr_);
0039 int *tep_register_print_function*(struct tep_handle pass:[*]_tep_, tep_func_handler _func_, enum tep_func_arg_type _ret_type_, char pass:[*]_name_, _..._);
0040 int *tep_unregister_print_function*(struct tep_handle pass:[*]_tep_, tep_func_handler _func_, char pass:[*]_name_);
0041
0042 Plugins management:
0043 struct tep_plugin_list pass:[*]*tep_load_plugins*(struct tep_handle pass:[*]_tep_);
0044 void *tep_unload_plugins*(struct tep_plugin_list pass:[*]_plugin_list_, struct tep_handle pass:[*]_tep_);
0045 char pass:[*]pass:[*]*tep_plugin_list_options*(void);
0046 void *tep_plugin_free_options_list*(char pass:[*]pass:[*]_list_);
0047 int *tep_plugin_add_options*(const char pass:[*]_name_, struct tep_plugin_option pass:[*]_options_);
0048 void *tep_plugin_remove_options*(struct tep_plugin_option pass:[*]_options_);
0049 void *tep_print_plugins*(struct trace_seq pass:[*]_s_, const char pass:[*]_prefix_, const char pass:[*]_suffix_, const struct tep_plugin_list pass:[*]_list_);
0050
0051 Event related APIs:
0052 struct tep_event pass:[*]*tep_get_event*(struct tep_handle pass:[*]_tep_, int _index_);
0053 struct tep_event pass:[*]*tep_get_first_event*(struct tep_handle pass:[*]_tep_);
0054 int *tep_get_events_count*(struct tep_handle pass:[*]_tep_);
0055 struct tep_event pass:[*]pass:[*]*tep_list_events*(struct tep_handle pass:[*]_tep_, enum tep_event_sort_type _sort_type_);
0056 struct tep_event pass:[*]pass:[*]*tep_list_events_copy*(struct tep_handle pass:[*]_tep_, enum tep_event_sort_type _sort_type_);
0057 void *tep_print_event*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_record pass:[*]_record_, const char pass:[*]_fmt_, _..._);
0058
0059 Event finding:
0060 struct tep_event pass:[*]*tep_find_event*(struct tep_handle pass:[*]_tep_, int _id_);
0061 struct tep_event pass:[*]*tep_find_event_by_name*(struct tep_handle pass:[*]_tep_, const char pass:[*]_sys_, const char pass:[*]_name_);
0062 struct tep_event pass:[*]*tep_find_event_by_record*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_record_);
0063
0064 Parsing of event files:
0065 int *tep_parse_header_page*(struct tep_handle pass:[*]_tep_, char pass:[*]_buf_, unsigned long _size_, int _long_size_);
0066 enum tep_errno *tep_parse_event*(struct tep_handle pass:[*]_tep_, const char pass:[*]_buf_, unsigned long _size_, const char pass:[*]_sys_);
0067 enum tep_errno *tep_parse_format*(struct tep_handle pass:[*]_tep_, struct tep_event pass:[*]pass:[*]_eventp_, const char pass:[*]_buf_, unsigned long _size_, const char pass:[*]_sys_);
0068
0069 APIs related to fields from event's format files:
0070 struct tep_format_field pass:[*]pass:[*]*tep_event_common_fields*(struct tep_event pass:[*]_event_);
0071 struct tep_format_field pass:[*]pass:[*]*tep_event_fields*(struct tep_event pass:[*]_event_);
0072 void pass:[*]*tep_get_field_raw*(struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, int pass:[*]_len_, int _err_);
0073 int *tep_get_field_val*(struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, unsigned long long pass:[*]_val_, int _err_);
0074 int *tep_get_common_field_val*(struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, unsigned long long pass:[*]_val_, int _err_);
0075 int *tep_get_any_field_val*(struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, unsigned long long pass:[*]_val_, int _err_);
0076 int *tep_read_number_field*(struct tep_format_field pass:[*]_field_, const void pass:[*]_data_, unsigned long long pass:[*]_value_);
0077
0078 Event fields printing:
0079 void *tep_print_field*(struct trace_seq pass:[*]_s_, void pass:[*]_data_, struct tep_format_field pass:[*]_field_);
0080 void *tep_print_fields*(struct trace_seq pass:[*]_s_, void pass:[*]_data_, int _size_, struct tep_event pass:[*]_event_);
0081 int *tep_print_num_field*(struct trace_seq pass:[*]_s_, const char pass:[*]_fmt_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, int _err_);
0082 int *tep_print_func_field*(struct trace_seq pass:[*]_s_, const char pass:[*]_fmt_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, int _err_);
0083
0084 Event fields finding:
0085 struct tep_format_field pass:[*]*tep_find_common_field*(struct tep_event pass:[*]_event_, const char pass:[*]_name_);
0086 struct tep_format_field pass:[*]*tep_find_field*(struct tep_event_ormat pass:[*]_event_, const char pass:[*]_name_);
0087 struct tep_format_field pass:[*]*tep_find_any_field*(struct tep_event pass:[*]_event_, const char pass:[*]_name_);
0088
0089 Functions resolver:
0090 int *tep_set_function_resolver*(struct tep_handle pass:[*]_tep_, tep_func_resolver_t pass:[*]_func_, void pass:[*]_priv_);
0091 void *tep_reset_function_resolver*(struct tep_handle pass:[*]_tep_);
0092 const char pass:[*]*tep_find_function*(struct tep_handle pass:[*]_tep_, unsigned long long _addr_);
0093 unsigned long long *tep_find_function_address*(struct tep_handle pass:[*]_tep_, unsigned long long _addr_);
0094
0095 Filter management:
0096 struct tep_event_filter pass:[*]*tep_filter_alloc*(struct tep_handle pass:[*]_tep_);
0097 enum tep_errno *tep_filter_add_filter_str*(struct tep_event_filter pass:[*]_filter_, const char pass:[*]_filter_str_);
0098 enum tep_errno *tep_filter_match*(struct tep_event_filter pass:[*]_filter_, struct tep_record pass:[*]_record_);
0099 int *tep_filter_strerror*(struct tep_event_filter pass:[*]_filter_, enum tep_errno _err_, char pass:[*]buf, size_t _buflen_);
0100 int *tep_event_filtered*(struct tep_event_filter pass:[*]_filter_, int _event_id_);
0101 void *tep_filter_reset*(struct tep_event_filter pass:[*]_filter_);
0102 void *tep_filter_free*(struct tep_event_filter pass:[*]_filter_);
0103 char pass:[*]*tep_filter_make_string*(struct tep_event_filter pass:[*]_filter_, int _event_id_);
0104 int *tep_filter_remove_event*(struct tep_event_filter pass:[*]_filter_, int _event_id_);
0105 int *tep_filter_copy*(struct tep_event_filter pass:[*]_dest_, struct tep_event_filter pass:[*]_source_);
0106 int *tep_filter_compare*(struct tep_event_filter pass:[*]_filter1_, struct tep_event_filter pass:[*]_filter2_);
0107
0108 Parsing various data from the records:
0109 int *tep_data_type*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_rec_);
0110 int *tep_data_pid*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_rec_);
0111 int *tep_data_preempt_count*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_rec_);
0112 int *tep_data_flags*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_rec_);
0113
0114 Command and task related APIs:
0115 const char pass:[*]*tep_data_comm_from_pid*(struct tep_handle pass:[*]_tep_, int _pid_);
0116 struct cmdline pass:[*]*tep_data_pid_from_comm*(struct tep_handle pass:[*]_tep_, const char pass:[*]_comm_, struct cmdline pass:[*]_next_);
0117 int *tep_register_comm*(struct tep_handle pass:[*]_tep_, const char pass:[*]_comm_, int _pid_);
0118 int *tep_override_comm*(struct tep_handle pass:[*]_tep_, const char pass:[*]_comm_, int _pid_);
0119 bool *tep_is_pid_registered*(struct tep_handle pass:[*]_tep_, int _pid_);
0120 int *tep_cmdline_pid*(struct tep_handle pass:[*]_tep_, struct cmdline pass:[*]_cmdline_);
0121
0122 Endian related APIs:
0123 int *tep_is_bigendian*(void);
0124 unsigned long long *tep_read_number*(struct tep_handle pass:[*]_tep_, const void pass:[*]_ptr_, int _size_);
0125 bool *tep_is_file_bigendian*(struct tep_handle pass:[*]_tep_);
0126 void *tep_set_file_bigendian*(struct tep_handle pass:[*]_tep_, enum tep_endian _endian_);
0127 bool *tep_is_local_bigendian*(struct tep_handle pass:[*]_tep_);
0128 void *tep_set_local_bigendian*(struct tep_handle pass:[*]_tep_, enum tep_endian _endian_);
0129
0130 Trace sequences:
0131 *#include <trace-seq.h>*
0132 void *trace_seq_init*(struct trace_seq pass:[*]_s_);
0133 void *trace_seq_reset*(struct trace_seq pass:[*]_s_);
0134 void *trace_seq_destroy*(struct trace_seq pass:[*]_s_);
0135 int *trace_seq_printf*(struct trace_seq pass:[*]_s_, const char pass:[*]_fmt_, ...);
0136 int *trace_seq_vprintf*(struct trace_seq pass:[*]_s_, const char pass:[*]_fmt_, va_list _args_);
0137 int *trace_seq_puts*(struct trace_seq pass:[*]_s_, const char pass:[*]_str_);
0138 int *trace_seq_putc*(struct trace_seq pass:[*]_s_, unsigned char _c_);
0139 void *trace_seq_terminate*(struct trace_seq pass:[*]_s_);
0140 int *trace_seq_do_fprintf*(struct trace_seq pass:[*]_s_, FILE pass:[*]_fp_);
0141 int *trace_seq_do_printf*(struct trace_seq pass:[*]_s_);
0142 --
0143
0144 DESCRIPTION
0145 -----------
0146 The libtraceevent(3) library provides APIs to access kernel tracepoint events,
0147 located in the tracefs file system under the events directory.
0148
0149 ENVIRONMENT
0150 -----------
0151 [verse]
0152 --
0153 TRACEEVENT_PLUGIN_DIR
0154 Additional plugin directory. All shared object files, located in this directory will be loaded as traceevent plugins.
0155 --
0156
0157 FILES
0158 -----
0159 [verse]
0160 --
0161 *event-parse.h*
0162 Header file to include in order to have access to the library APIs.
0163 *trace-seq.h*
0164 Header file to include in order to have access to trace sequences related APIs.
0165 Trace sequences are used to allow a function to call several other functions
0166 to create a string of data to use.
0167 *-ltraceevent*
0168 Linker switch to add when building a program that uses the library.
0169 --
0170
0171 SEE ALSO
0172 --------
0173 _trace-cmd(1)_
0174
0175 AUTHOR
0176 ------
0177 [verse]
0178 --
0179 *Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*.
0180 *Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page.
0181 --
0182 REPORTING BUGS
0183 --------------
0184 Report bugs to <linux-trace-devel@vger.kernel.org>
0185
0186 LICENSE
0187 -------
0188 libtraceevent is Free Software licensed under the GNU LGPL 2.1
0189
0190 RESOURCES
0191 ---------
0192 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git