Linux Kernel
3.7.1
|
#include <stdarg.h>
#include <regex.h>
Go to the source code of this file.
Data Structures | |
struct | pevent_record |
struct | trace_seq |
struct | plugin_option |
struct | format_field |
struct | format |
struct | print_arg_atom |
struct | print_arg_string |
struct | print_arg_field |
struct | print_flag_sym |
struct | print_arg_typecast |
struct | print_arg_flags |
struct | print_arg_symbol |
struct | print_arg_hex |
struct | print_arg_dynarray |
struct | print_arg_op |
struct | print_arg_func |
struct | print_arg |
struct | print_fmt |
struct | event_format |
struct | pevent |
struct | filter_arg_boolean |
struct | filter_arg_field |
struct | filter_arg_value |
struct | filter_arg_op |
struct | filter_arg_exp |
struct | filter_arg_num |
struct | filter_arg_str |
struct | filter_arg |
struct | filter_type |
struct | event_filter |
Typedefs | |
typedef int(* | pevent_event_handler_func )(struct trace_seq *s, struct pevent_record *record, struct event_format *event, void *context) |
typedef int(* | pevent_plugin_load_func )(struct pevent *pevent) |
typedef int(* | pevent_plugin_unload_func )(void) |
typedef unsigned long long(* | pevent_func_handler )(struct trace_seq *s, unsigned long long *args) |
#define __maybe_unused __attribute__((unused)) |
Definition at line 28 of file event-parse.h.
Definition at line 153 of file event-parse.h.
#define _PE | ( | __code, | |
__str | |||
) | PEVENT_ERRNO__ ## __code |
Definition at line 358 of file event-parse.h.
Definition at line 509 of file event-parse.h.
Definition at line 510 of file event-parse.h.
#define DEBUG_RECORD 0 |
Definition at line 39 of file event-parse.h.
#define FILTER_MATCH 1 |
Definition at line 803 of file event-parse.h.
#define FILTER_MISS 0 |
Definition at line 802 of file event-parse.h.
#define FILTER_NOEXIST -1 |
Definition at line 801 of file event-parse.h.
#define FILTER_NONE -2 |
Definition at line 800 of file event-parse.h.
Definition at line 154 of file event-parse.h.
#define NSECS_PER_SEC 1000000000ULL |
Definition at line 160 of file event-parse.h.
#define NSECS_PER_USEC 1000ULL |
Definition at line 161 of file event-parse.h.
#define PEVENT_ERRORS |
Definition at line 348 of file event-parse.h.
#define PEVENT_PLUGIN_ALIAS pevent_plugin_alias |
Definition at line 152 of file event-parse.h.
#define PEVENT_PLUGIN_ALIAS_NAME MAKE_STR(PEVENT_PLUGIN_ALIAS) |
Definition at line 158 of file event-parse.h.
#define PEVENT_PLUGIN_LOADER pevent_plugin_loader |
Definition at line 149 of file event-parse.h.
#define PEVENT_PLUGIN_LOADER_NAME MAKE_STR(PEVENT_PLUGIN_LOADER) |
Definition at line 155 of file event-parse.h.
#define PEVENT_PLUGIN_OPTIONS pevent_plugin_options |
Definition at line 151 of file event-parse.h.
#define PEVENT_PLUGIN_OPTIONS_NAME MAKE_STR(PEVENT_PLUGIN_OPTIONS) |
Definition at line 157 of file event-parse.h.
#define PEVENT_PLUGIN_UNLOADER pevent_plugin_unloader |
Definition at line 150 of file event-parse.h.
#define PEVENT_PLUGIN_UNLOADER_NAME MAKE_STR(PEVENT_PLUGIN_UNLOADER) |
Definition at line 156 of file event-parse.h.
#define TRACE_SEQ_BUF_SIZE 4096 |
Definition at line 35 of file event-parse.h.
typedef int(* pevent_event_handler_func)(struct trace_seq *s, struct pevent_record *record, struct event_format *event, void *context) |
Definition at line 93 of file event-parse.h.
Definition at line 332 of file event-parse.h.
Definition at line 98 of file event-parse.h.
Definition at line 99 of file event-parse.h.
anonymous enum |
EVENT_FL_ISFTRACE | |
EVENT_FL_ISPRINT | |
EVENT_FL_ISBPRINT | |
EVENT_FL_ISFUNCENT | |
EVENT_FL_ISFUNCRET | |
EVENT_FL_FAILED |
Definition at line 304 of file event-parse.h.
enum event_sort_type |
Definition at line 314 of file event-parse.h.
enum event_type |
EVENT_ERROR | |
EVENT_NONE | |
EVENT_SPACE | |
EVENT_NEWLINE | |
EVENT_OP | |
EVENT_DELIM | |
EVENT_ITEM | |
EVENT_DQUOTE | |
EVENT_SQUOTE |
Definition at line 320 of file event-parse.h.
enum filter_arg_type |
FILTER_ARG_NONE | |
FILTER_ARG_BOOLEAN | |
FILTER_ARG_VALUE | |
FILTER_ARG_FIELD | |
FILTER_ARG_EXP | |
FILTER_ARG_OP | |
FILTER_ARG_NUM | |
FILTER_ARG_STR |
Definition at line 712 of file event-parse.h.
enum filter_boolean_type |
Definition at line 672 of file event-parse.h.
enum filter_cmp_type |
FILTER_CMP_NONE | |
FILTER_CMP_EQ | |
FILTER_CMP_NE | |
FILTER_CMP_GT | |
FILTER_CMP_LT | |
FILTER_CMP_GE | |
FILTER_CMP_LE | |
FILTER_CMP_MATCH | |
FILTER_CMP_NOT_MATCH | |
FILTER_CMP_REGEX | |
FILTER_CMP_NOT_REGEX |
Definition at line 683 of file event-parse.h.
enum filter_exp_type |
FILTER_EXP_NONE | |
FILTER_EXP_ADD | |
FILTER_EXP_SUB | |
FILTER_EXP_MUL | |
FILTER_EXP_DIV | |
FILTER_EXP_MOD | |
FILTER_EXP_RSHIFT | |
FILTER_EXP_LSHIFT | |
FILTER_EXP_AND | |
FILTER_EXP_OR | |
FILTER_EXP_XOR | |
FILTER_EXP_NOT |
Definition at line 697 of file event-parse.h.
enum filter_op_type |
Definition at line 677 of file event-parse.h.
enum filter_trivial_type |
Definition at line 805 of file event-parse.h.
enum filter_value_type |
Definition at line 723 of file event-parse.h.
enum format_flags |
FIELD_IS_ARRAY | |
FIELD_IS_POINTER | |
FIELD_IS_SIGNED | |
FIELD_IS_STRING | |
FIELD_IS_DYNAMIC | |
FIELD_IS_LONG | |
FIELD_IS_FLAG | |
FIELD_IS_SYMBOLIC |
Definition at line 163 of file event-parse.h.
enum pevent_errno |
Definition at line 359 of file event-parse.h.
enum pevent_flag |
Definition at line 344 of file event-parse.h.
enum pevent_func_arg_type |
PEVENT_FUNC_ARG_VOID | |
PEVENT_FUNC_ARG_INT | |
PEVENT_FUNC_ARG_LONG | |
PEVENT_FUNC_ARG_STRING | |
PEVENT_FUNC_ARG_PTR | |
PEVENT_FUNC_ARG_MAX_TYPES |
Definition at line 335 of file event-parse.h.
enum print_arg_type |
PRINT_NULL | |
PRINT_ATOM | |
PRINT_FIELD | |
PRINT_FLAGS | |
PRINT_SYMBOL | |
PRINT_HEX | |
PRINT_TYPE | |
PRINT_STRING | |
PRINT_BSTRING | |
PRINT_DYNAMIC_ARRAY | |
PRINT_OP | |
PRINT_FUNC |
Definition at line 255 of file event-parse.h.
enum trace_flag_type |
Definition at line 520 of file event-parse.h.
pevent_alloc - create a pevent handle
Definition at line 5478 of file event-parse.c.
pevent_buffer_init - init buffer for parsing : buffer to parse : the size of the buffer
For use with pevent_read_token(), this initializes the internal buffer that pevent_read_token() will parse.
Definition at line 108 of file event-parse.c.
|
read |
void pevent_data_lat_fmt | ( | struct pevent * | pevent, |
struct trace_seq * | s, | ||
struct pevent_record * | record | ||
) |
pevent_data_lat_fmt - parse the data for the latency format : a handle to the pevent : the trace_seq to write to : the record to read from
This parses out the Latency format (interrupts disabled, need rescheduling, in hard/soft interrupt, preempt count and lock depth) and places it into the trace_seq.
Definition at line 4254 of file event-parse.c.
int pevent_data_pid | ( | struct pevent * | pevent, |
struct pevent_record * | rec | ||
) |
int pevent_data_type | ( | struct pevent * | pevent, |
struct pevent_record * | rec | ||
) |
|
read |
|
read |
int pevent_event_filtered | ( | struct event_filter * | filter, |
int | event_id | ||
) |
pevent_event_filtered - return true if event has filter : filter struct with filter information : event id to test if filter exists
Returns 1 if filter found for otherwise 0;
Definition at line 1852 of file parse-filter.c.
void pevent_event_info | ( | struct trace_seq * | s, |
struct event_format * | event, | ||
struct pevent_record * | record | ||
) |
int pevent_filter_add_filter_str | ( | struct event_filter * | filter, |
const char * | filter_str, | ||
char ** | error_str | ||
) |
pevent_filter_add_filter_str - add a new filter : the event filter to add to : the filter string that contains the filter : string containing reason for failed filter
Returns 0 if the filter was successfully added -1 if there was an error.
On error, if points to a string pointer, it is set to the reason that the filter failed. This string must be freed with "free".
Definition at line 1174 of file parse-filter.c.
|
read |
pevent_filter_alloc - create a new event filter : The pevent that this filter is associated with
Definition at line 182 of file parse-filter.c.
void pevent_filter_clear_trivial | ( | struct event_filter * | filter, |
enum filter_trivial_type | type | ||
) |
pevent_filter_clear_trivial - clear TRUE and FALSE filters : the filter to remove trivial filters from : remove only true, false, or both
Removes filters that only contain a TRUE or FALES boolean arg.
Definition at line 1487 of file parse-filter.c.
int pevent_filter_compare | ( | struct event_filter * | filter1, |
struct event_filter * | filter2 | ||
) |
pevent_filter_compare - compare two filters and return if they are the same : Filter to compare with : Filter to compare with
Returns: 1 if the two filters hold the same content. 0 if they do not.
Definition at line 2252 of file parse-filter.c.
int pevent_filter_copy | ( | struct event_filter * | dest, |
struct event_filter * | source | ||
) |
pevent_filter_copy - copy a filter using another filter - the filter to copy to - the filter to copy from
Returns 0 on success and -1 if not all filters were copied
Definition at line 1404 of file parse-filter.c.
int pevent_filter_event_has_trivial | ( | struct event_filter * | filter, |
int | event_id, | ||
enum filter_trivial_type | type | ||
) |
pevent_filter_event_has_trivial - return true event contains trivial filter : the filter with the information : the id of the event to test : trivial type to test for (TRUE, FALSE, EITHER)
Returns 1 if the event contains a matching trivial type otherwise 0.
Definition at line 1541 of file parse-filter.c.
void pevent_filter_free | ( | struct event_filter * | filter | ) |
Definition at line 1343 of file parse-filter.c.
char* pevent_filter_make_string | ( | struct event_filter * | filter, |
int | event_id | ||
) |
pevent_filter_make_string - return a string showing the filter : filter struct with filter information : the event id to return the filter string with
Returns a string that displays the filter contents. This string must be freed with free(str). NULL is returned if no filter is found.
Definition at line 2228 of file parse-filter.c.
int pevent_filter_match | ( | struct event_filter * | filter, |
struct pevent_record * | record | ||
) |
pevent_filter_match - test if a record matches a filter : filter struct with filter information : the record to test against the filter
Returns: 1 - filter found for event and matches 0 - filter found for event and does not match -1 - no filter found for 's event -2 - if no filters exist
Definition at line 1876 of file parse-filter.c.
int pevent_filter_remove_event | ( | struct event_filter * | filter, |
int | event_id | ||
) |
void pevent_filter_reset | ( | struct event_filter * | filter | ) |
pevent_filter_reset - clear all filters in a filter : the event filter to reset
Removes all filters from a filter and resets it.
Definition at line 1331 of file parse-filter.c.
|
read |
Definition at line 2976 of file event-parse.c.
|
read |
Definition at line 2931 of file event-parse.c.
|
read |
pevent_find_event - find an event by given id : a handle to the pevent : the id of the event
Returns an event that has a given .
Definition at line 3132 of file event-parse.c.
|
read |
Definition at line 3165 of file event-parse.c.
|
read |
Definition at line 2953 of file event-parse.c.
pevent_find_function - find a function by a given address : handle for the pevent : the address to find the function with
Returns a pointer to the function stored that has the given address. Note, the address does not have to be exact, it will select the function that would contain the address.
Definition at line 421 of file event-parse.c.
pevent_find_function_address - find a function address by a given address : handle for the pevent : the address to find the function with
Returns the address the function starts at. This can be used in conjunction with pevent_find_function to print both the function name and the function offset.
Definition at line 442 of file event-parse.c.
pevent_free - free a pevent handle : the pevent handle to free
Definition at line 5529 of file event-parse.c.
void pevent_free_format | ( | struct event_format * | event | ) |
Definition at line 5512 of file event-parse.c.
pevent_free_token - free a token returned by pevent_read_token : the token to free
Definition at line 1062 of file event-parse.c.
int pevent_get_any_field_val | ( | struct trace_seq * | s, |
struct event_format * | event, | ||
const char * | name, | ||
struct pevent_record * | record, | ||
unsigned long long * | val, | ||
int | err | ||
) |
Definition at line 5244 of file event-parse.c.
int pevent_get_common_field_val | ( | struct trace_seq * | s, |
struct event_format * | event, | ||
const char * | name, | ||
struct pevent_record * | record, | ||
unsigned long long * | val, | ||
int | err | ||
) |
Definition at line 5219 of file event-parse.c.
void* pevent_get_field_raw | ( | struct trace_seq * | s, |
struct event_format * | event, | ||
const char * | name, | ||
struct pevent_record * | record, | ||
int * | len, | ||
int | err | ||
) |
Definition at line 5147 of file event-parse.c.
int pevent_get_field_val | ( | struct trace_seq * | s, |
struct event_format * | event, | ||
const char * | name, | ||
struct pevent_record * | record, | ||
unsigned long long * | val, | ||
int | err | ||
) |
Definition at line 5194 of file event-parse.c.
Definition at line 61 of file event-parse.c.
Definition at line 66 of file event-parse.c.
|
read |
Definition at line 4515 of file event-parse.c.
enum pevent_errno pevent_parse_event | ( | struct pevent * | pevent, |
const char * | buf, | ||
unsigned long | size, | ||
const char * | sys | ||
) |
pevent_parse_event - parse the event format : the handle to the pevent : the buffer storing the event format string : the size of : the system the event belongs to
This parses the event format and creates an event structure to quickly parse raw data for a given event.
These files currently come from:
/sys/kernel/debug/tracing/events/.../.../format
Definition at line 5041 of file event-parse.c.
enum pevent_errno pevent_parse_format | ( | struct event_format ** | eventp, |
const char * | buf, | ||
unsigned long | size, | ||
const char * | sys | ||
) |
pevent_parse_format - parse the event format : the buffer storing the event format string : the size of : the system the event belongs to
This parses the event format and creates an event structure to quickly parse raw data for a given event.
These files currently come from:
/sys/kernel/debug/tracing/events/.../.../format
Definition at line 5021 of file event-parse.c.
int pevent_parse_header_page | ( | struct pevent * | pevent, |
char * | buf, | ||
unsigned long | size, | ||
int | long_size | ||
) |
pevent_parse_header_page - parse the data stored in the header page : the handle to the pevent : the buffer storing the header page format string : the size of : the long size to use if there is no header
This parses the header page format for information on the ring buffer used. The should be copied from
/sys/kernel/debug/tracing/events/header_page
Definition at line 4807 of file event-parse.c.
pevent_peek_char - peek at the next character that will be read
Returns the next character read, or -1 if end of buffer.
Definition at line 805 of file event-parse.c.
pevent_pid_is_registered - return if a pid has a cmdline registered : handle for the pevent : The pid to check if it has a cmdline registered with.
Returns 1 if the pid has a cmdline mapped to it 0 otherwise.
Definition at line 206 of file event-parse.c.
void pevent_print_event | ( | struct pevent * | pevent, |
struct trace_seq * | s, | ||
struct pevent_record * | record | ||
) |
Definition at line 4408 of file event-parse.c.
pevent_print_funcs - print out the stored functions : handle for the pevent
This prints out the stored functions.
Definition at line 504 of file event-parse.c.
int pevent_print_num_field | ( | struct trace_seq * | s, |
const char * | fmt, | ||
struct event_format * | event, | ||
const char * | name, | ||
struct pevent_record * | record, | ||
int | err | ||
) |
Definition at line 5269 of file event-parse.c.
pevent_print_printk - print out the stored strings : handle for the pevent
This prints the string formats that were stored.
Definition at line 635 of file event-parse.c.
enum event_type pevent_read_token | ( | char ** | tok | ) |
Definition at line 5488 of file event-parse.c.
int pevent_register_event_handler | ( | struct pevent * | pevent, |
int | id, | ||
char * | sys_name, | ||
char * | event_name, | ||
pevent_event_handler_func | func, | ||
void * | context | ||
) |
pevent_register_event_handler - register a way to parse an event : the handle to the pevent : the id of the event to register : the system name the event belongs to : the name of the event : the function to call to parse the event information : the data to be passed to
This function allows a developer to override the parsing of a given event. If for some reason the default print format is not sufficient, this function will register a function for an event to be used to parse the data instead.
If is >= 0, then it is used to find the event. else and are used.
Definition at line 5414 of file event-parse.c.
int pevent_register_function | ( | struct pevent * | pevent, |
char * | func, | ||
unsigned long long | addr, | ||
char * | mod | ||
) |
pevent_register_function - register a function with a given address : handle for the pevent : the function name to register : the address the function starts at : the kernel module the function may be in (NULL for none)
This registers a function name with an address and module. The passed in is duplicated.
Definition at line 463 of file event-parse.c.
int pevent_register_print_function | ( | struct pevent * | pevent, |
pevent_func_handler | func, | ||
enum pevent_func_arg_type | ret_type, | ||
char * | name, | ||
... | |||
) |
Definition at line 5320 of file event-parse.c.
pevent_register_print_string - register a string by its address : handle for the pevent : the string format to register : the address the string was located at
This registers a string by the address it was stored in the kernel. The passed in is duplicated.
Definition at line 603 of file event-parse.c.
Definition at line 5073 of file event-parse.c.
Definition at line 5612 of file event-parse.c.
int pevent_update_trivial | ( | struct event_filter * | dest, |
struct event_filter * | source, | ||
enum filter_trivial_type | type | ||
) |
pevent_update_trivial - update the trivial filters with the given filter - the filter to update - the filter as the source of the update - the type of trivial filter to update.
Scan dest for trivial events matching to replace with the source.
Returns 0 on success and -1 if there was a problem updating, but events may have still been updated on error.
Definition at line 1430 of file parse-filter.c.
Definition at line 196 of file trace-seq.c.
Definition at line 195 of file trace_output.c.
trace_seq_puts - trace sequence printing of simple string : trace sequence descriptor : simple string to record
The tracer may use either the sequence operations or its own copy to user routines. This function records a simple string into a special buffer () for later retrieval by a sequencer or other mechanism.
Definition at line 177 of file trace_output.c.
Definition at line 188 of file trace-seq.c.