Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
event-parse.h File Reference
#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
 

Macros

#define __maybe_unused   __attribute__((unused))
 
#define TRACE_SEQ_BUF_SIZE   4096
 
#define DEBUG_RECORD   0
 
#define PEVENT_PLUGIN_LOADER   pevent_plugin_loader
 
#define PEVENT_PLUGIN_UNLOADER   pevent_plugin_unloader
 
#define PEVENT_PLUGIN_OPTIONS   pevent_plugin_options
 
#define PEVENT_PLUGIN_ALIAS   pevent_plugin_alias
 
#define _MAKE_STR(x)   #x
 
#define MAKE_STR(x)   _MAKE_STR(x)
 
#define PEVENT_PLUGIN_LOADER_NAME   MAKE_STR(PEVENT_PLUGIN_LOADER)
 
#define PEVENT_PLUGIN_UNLOADER_NAME   MAKE_STR(PEVENT_PLUGIN_UNLOADER)
 
#define PEVENT_PLUGIN_OPTIONS_NAME   MAKE_STR(PEVENT_PLUGIN_OPTIONS)
 
#define PEVENT_PLUGIN_ALIAS_NAME   MAKE_STR(PEVENT_PLUGIN_ALIAS)
 
#define NSECS_PER_SEC   1000000000ULL
 
#define NSECS_PER_USEC   1000ULL
 
#define PEVENT_ERRORS
 
#define _PE(__code, __str)   PEVENT_ERRNO__ ## __code
 
#define data2host2(pevent, ptr)   __data2host2(pevent, *(unsigned short *)(ptr))
 
#define data2host4(pevent, ptr)   __data2host4(pevent, *(unsigned int *)(ptr))
 
#define data2host8(pevent, ptr)
 
#define FILTER_NONE   -2
 
#define FILTER_NOEXIST   -1
 
#define FILTER_MISS   0
 
#define FILTER_MATCH   1
 

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)
 

Enumerations

enum  format_flags {
  FIELD_IS_ARRAY = 1, FIELD_IS_POINTER = 2, FIELD_IS_SIGNED = 4, FIELD_IS_STRING = 8,
  FIELD_IS_DYNAMIC = 16, FIELD_IS_LONG = 32, FIELD_IS_FLAG = 64, FIELD_IS_SYMBOLIC = 128
}
 
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
}
 
enum  {
  EVENT_FL_ISFTRACE = 0x01, EVENT_FL_ISPRINT = 0x02, EVENT_FL_ISBPRINT = 0x04, EVENT_FL_ISFUNCENT = 0x10,
  EVENT_FL_ISFUNCRET = 0x20, EVENT_FL_FAILED = 0x80000000
}
 
enum  event_sort_type { EVENT_SORT_ID, EVENT_SORT_NAME, EVENT_SORT_SYSTEM }
 
enum  event_type {
  EVENT_ERROR, EVENT_NONE, EVENT_SPACE, EVENT_NEWLINE,
  EVENT_OP, EVENT_DELIM, EVENT_ITEM, EVENT_DQUOTE,
  EVENT_SQUOTE
}
 
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
}
 
enum  pevent_flag { PEVENT_NSEC_OUTPUT = 1 }
 
enum  pevent_errno { PEVENT_ERRNO__SUCCESS = 0, __PEVENT_ERRNO__START = -100000, PEVENT_ERRORS, __PEVENT_ERRNO__END }
 
enum  trace_flag_type {
  TRACE_FLAG_IRQS_OFF = 0x01, TRACE_FLAG_IRQS_NOSUPPORT = 0x02, TRACE_FLAG_NEED_RESCHED = 0x04, TRACE_FLAG_HARDIRQ = 0x08,
  TRACE_FLAG_SOFTIRQ = 0x10, TRACE_FLAG_IRQS_OFF = 0x01, TRACE_FLAG_IRQS_NOSUPPORT = 0x02, TRACE_FLAG_NEED_RESCHED = 0x04,
  TRACE_FLAG_HARDIRQ = 0x08, TRACE_FLAG_SOFTIRQ = 0x10, TRACE_FLAG_IRQS_OFF = 0x01, TRACE_FLAG_IRQS_NOSUPPORT = 0x02,
  TRACE_FLAG_NEED_RESCHED = 0x04, TRACE_FLAG_HARDIRQ = 0x08, TRACE_FLAG_SOFTIRQ = 0x10
}
 
enum  filter_boolean_type { FILTER_FALSE, FILTER_TRUE }
 
enum  filter_op_type { FILTER_OP_AND = 1, FILTER_OP_OR, FILTER_OP_NOT }
 
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
}
 
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
}
 
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
}
 
enum  filter_value_type { FILTER_NUMBER, FILTER_STRING, FILTER_CHAR }
 
enum  filter_trivial_type { FILTER_TRIVIAL_FALSE, FILTER_TRIVIAL_TRUE, FILTER_TRIVIAL_BOTH }
 

Functions

void trace_seq_init (struct trace_seq *s)
 
void trace_seq_destroy (struct trace_seq *s)
 
int trace_seq_printf (struct trace_seq *s, const char *fmt,...) __attribute__((format(printf
 
int int trace_seq_vprintf (struct trace_seq *s, const char *fmt, va_list args) __attribute__((format(printf
 
int int int trace_seq_puts (struct trace_seq *s, const char *str)
 
int trace_seq_putc (struct trace_seq *s, unsigned char c)
 
void trace_seq_terminate (struct trace_seq *s)
 
int trace_seq_do_printf (struct trace_seq *s)
 
int pevent_register_comm (struct pevent *pevent, const char *comm, int pid)
 
int pevent_register_function (struct pevent *pevent, char *name, unsigned long long addr, char *mod)
 
int pevent_register_print_string (struct pevent *pevent, char *fmt, unsigned long long addr)
 
int pevent_pid_is_registered (struct pevent *pevent, int pid)
 
void pevent_print_event (struct pevent *pevent, struct trace_seq *s, struct pevent_record *record)
 
int pevent_parse_header_page (struct pevent *pevent, char *buf, unsigned long size, int long_size)
 
enum pevent_errno pevent_parse_event (struct pevent *pevent, const char *buf, unsigned long size, const char *sys)
 
enum pevent_errno pevent_parse_format (struct event_format **eventp, const char *buf, unsigned long size, const char *sys)
 
void pevent_free_format (struct event_format *event)
 
voidpevent_get_field_raw (struct trace_seq *s, struct event_format *event, const char *name, struct pevent_record *record, int *len, int err)
 
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)
 
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)
 
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)
 
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)
 
int pevent_register_event_handler (struct pevent *pevent, int id, char *sys_name, char *event_name, pevent_event_handler_func func, void *context)
 
int pevent_register_print_function (struct pevent *pevent, pevent_func_handler func, enum pevent_func_arg_type ret_type, char *name,...)
 
struct format_fieldpevent_find_common_field (struct event_format *event, const char *name)
 
struct format_fieldpevent_find_field (struct event_format *event, const char *name)
 
struct format_fieldpevent_find_any_field (struct event_format *event, const char *name)
 
const charpevent_find_function (struct pevent *pevent, unsigned long long addr)
 
unsigned long long pevent_find_function_address (struct pevent *pevent, unsigned long long addr)
 
unsigned long long pevent_read_number (struct pevent *pevent, const void *ptr, int size)
 
int pevent_read_number_field (struct format_field *field, const void *data, unsigned long long *value)
 
struct event_formatpevent_find_event (struct pevent *pevent, int id)
 
struct event_formatpevent_find_event_by_name (struct pevent *pevent, const char *sys, const char *name)
 
void pevent_data_lat_fmt (struct pevent *pevent, struct trace_seq *s, struct pevent_record *record)
 
int pevent_data_type (struct pevent *pevent, struct pevent_record *rec)
 
struct event_formatpevent_data_event_from_type (struct pevent *pevent, int type)
 
int pevent_data_pid (struct pevent *pevent, struct pevent_record *rec)
 
const charpevent_data_comm_from_pid (struct pevent *pevent, int pid)
 
void pevent_event_info (struct trace_seq *s, struct event_format *event, struct pevent_record *record)
 
int pevent_strerror (struct pevent *pevent, enum pevent_errno errnum, char *buf, size_t buflen)
 
struct event_format ** pevent_list_events (struct pevent *pevent, enum event_sort_type)
 
struct format_field ** pevent_event_common_fields (struct event_format *event)
 
struct format_field ** pevent_event_fields (struct event_format *event)
 
struct peventpevent_alloc (void)
 
void pevent_free (struct pevent *pevent)
 
void pevent_ref (struct pevent *pevent)
 
void pevent_unref (struct pevent *pevent)
 
void pevent_buffer_init (const char *buf, unsigned long long size)
 
enum event_type pevent_read_token (char **tok)
 
void pevent_free_token (char *token)
 
int pevent_peek_char (void)
 
const charpevent_get_input_buf (void)
 
unsigned long long pevent_get_input_buf_ptr (void)
 
void pevent_print_funcs (struct pevent *pevent)
 
void pevent_print_printk (struct pevent *pevent)
 
struct event_filterpevent_filter_alloc (struct pevent *pevent)
 
int pevent_filter_add_filter_str (struct event_filter *filter, const char *filter_str, char **error_str)
 
int pevent_filter_match (struct event_filter *filter, struct pevent_record *record)
 
int pevent_event_filtered (struct event_filter *filter, int event_id)
 
void pevent_filter_reset (struct event_filter *filter)
 
void pevent_filter_clear_trivial (struct event_filter *filter, enum filter_trivial_type type)
 
void pevent_filter_free (struct event_filter *filter)
 
charpevent_filter_make_string (struct event_filter *filter, int event_id)
 
int pevent_filter_remove_event (struct event_filter *filter, int event_id)
 
int pevent_filter_event_has_trivial (struct event_filter *filter, int event_id, enum filter_trivial_type type)
 
int pevent_filter_copy (struct event_filter *dest, struct event_filter *source)
 
int pevent_update_trivial (struct event_filter *dest, struct event_filter *source, enum filter_trivial_type type)
 
int pevent_filter_compare (struct event_filter *filter1, struct event_filter *filter2)
 

Macro Definition Documentation

#define __maybe_unused   __attribute__((unused))

Definition at line 28 of file event-parse.h.

#define _MAKE_STR (   x)    #x

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.

#define data2host2 (   pevent,
  ptr 
)    __data2host2(pevent, *(unsigned short *)(ptr))

Definition at line 509 of file event-parse.h.

#define data2host4 (   pevent,
  ptr 
)    __data2host4(pevent, *(unsigned int *)(ptr))

Definition at line 510 of file event-parse.h.

#define data2host8 (   pevent,
  ptr 
)
Value:
({ \
unsigned long long __val; \
memcpy(&__val, (ptr), sizeof(unsigned long long)); \
__data2host8(pevent, __val); \
})

Definition at line 511 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.

#define MAKE_STR (   x)    _MAKE_STR(x)

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
Value:
_PE(MEM_ALLOC_FAILED, "failed to allocate memory"), \
_PE(PARSE_EVENT_FAILED, "failed to parse event"), \
_PE(READ_ID_FAILED, "failed to read event id"), \
_PE(READ_FORMAT_FAILED, "failed to read event format"), \
_PE(READ_PRINT_FAILED, "failed to read event print fmt"), \
_PE(OLD_FTRACE_ARG_FAILED,"failed to allocate field name for ftrace"),\
_PE(INVALID_ARG_TYPE, "invalid argument type")

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 Documentation

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.

typedef unsigned long long(* pevent_func_handler)(struct trace_seq *s, unsigned long long *args)

Definition at line 332 of file event-parse.h.

typedef int(* pevent_plugin_load_func)(struct pevent *pevent)

Definition at line 98 of file event-parse.h.

typedef int(* pevent_plugin_unload_func)(void)

Definition at line 99 of file event-parse.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
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.

Enumerator:
EVENT_SORT_ID 
EVENT_SORT_NAME 
EVENT_SORT_SYSTEM 

Definition at line 314 of file event-parse.h.

enum event_type
Enumerator:
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.

Enumerator:
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.

Enumerator:
FILTER_FALSE 
FILTER_TRUE 

Definition at line 672 of file event-parse.h.

Enumerator:
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.

Enumerator:
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.

Enumerator:
FILTER_OP_AND 
FILTER_OP_OR 
FILTER_OP_NOT 

Definition at line 677 of file event-parse.h.

Enumerator:
FILTER_TRIVIAL_FALSE 
FILTER_TRIVIAL_TRUE 
FILTER_TRIVIAL_BOTH 

Definition at line 805 of file event-parse.h.

Enumerator:
FILTER_NUMBER 
FILTER_STRING 
FILTER_CHAR 

Definition at line 723 of file event-parse.h.

Enumerator:
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.

Enumerator:
PEVENT_ERRNO__SUCCESS 
__PEVENT_ERRNO__START 
PEVENT_ERRORS 
__PEVENT_ERRNO__END 

Definition at line 359 of file event-parse.h.

Enumerator:
PEVENT_NSEC_OUTPUT 

Definition at line 344 of file event-parse.h.

Enumerator:
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.

Enumerator:
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.

Enumerator:
TRACE_FLAG_IRQS_OFF 
TRACE_FLAG_IRQS_NOSUPPORT 
TRACE_FLAG_NEED_RESCHED 
TRACE_FLAG_HARDIRQ 
TRACE_FLAG_SOFTIRQ 
TRACE_FLAG_IRQS_OFF 
TRACE_FLAG_IRQS_NOSUPPORT 
TRACE_FLAG_NEED_RESCHED 
TRACE_FLAG_HARDIRQ 
TRACE_FLAG_SOFTIRQ 
TRACE_FLAG_IRQS_OFF 
TRACE_FLAG_IRQS_NOSUPPORT 
TRACE_FLAG_NEED_RESCHED 
TRACE_FLAG_HARDIRQ 
TRACE_FLAG_SOFTIRQ 

Definition at line 520 of file event-parse.h.

Function Documentation

struct pevent* pevent_alloc ( void  )
read

pevent_alloc - create a pevent handle

Definition at line 5478 of file event-parse.c.

void pevent_buffer_init ( const char buf,
unsigned long long  size 
)

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.

const char* pevent_data_comm_from_pid ( struct pevent pevent,
int  pid 
)

pevent_data_comm_from_pid - return the command line from PID : a handle to the pevent : the PID of the task to search for

This returns a pointer to the command line that has the given .

Definition at line 4371 of file event-parse.c.

struct event_format* pevent_data_event_from_type ( struct pevent pevent,
int  type 
)
read

pevent_data_event_from_type - find the event by a given type : a handle to the pevent : the type of the event.

This returns the event form a given ;

Definition at line 4346 of file event-parse.c.

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 
)

pevent_data_pid - parse the PID from raw data : a handle to the pevent : the record to parse

This returns the PID from a raw data.

Definition at line 4358 of file event-parse.c.

int pevent_data_type ( struct pevent pevent,
struct pevent_record rec 
)

pevent_data_type - parse out the given event type : a handle to the pevent : the record to read from

This returns the event id from the .

Definition at line 4334 of file event-parse.c.

struct format_field** pevent_event_common_fields ( struct event_format event)
read

pevent_event_common_fields - return a list of common fields for an event : the event to return the common fields of.

Returns an allocated array of fields. The last item in the array is NULL. The array must be freed with free().

Definition at line 4600 of file event-parse.c.

struct format_field** pevent_event_fields ( struct event_format event)
read

pevent_event_fields - return a list of event specific fields for an event : the event to return the fields of.

Returns an allocated array of fields. The last item in the array is NULL. The array must be freed with free().

Definition at line 4614 of file event-parse.c.

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 
)

pevent_data_comm_from_pid - parse the data into the print format : the trace_seq to write to : the handle to the event : the record to read from

This parses the raw using the given information and writes the print format into the trace_seq.

Definition at line 4388 of file event-parse.c.

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.

struct event_filter* pevent_filter_alloc ( struct pevent pevent)
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 
)

pevent_filter_remove_event - remove a filter for an event : the event filter to remove from : the event to remove a filter for

Removes the filter saved for an event defined by from the .

Returns 1: if an event was removed 0: if the event was not found

Definition at line 1296 of file parse-filter.c.

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.

struct format_field* pevent_find_any_field ( struct event_format event,
const char name 
)
read

Definition at line 2976 of file event-parse.c.

struct format_field* pevent_find_common_field ( struct event_format event,
const char name 
)
read

Definition at line 2931 of file event-parse.c.

struct event_format* pevent_find_event ( struct pevent pevent,
int  id 
)
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.

struct event_format* pevent_find_event_by_name ( struct pevent pevent,
const char sys,
const char name 
)
read

Definition at line 3165 of file event-parse.c.

struct format_field* pevent_find_field ( struct event_format event,
const char name 
)
read

Definition at line 2953 of file event-parse.c.

const char* pevent_find_function ( struct pevent pevent,
unsigned long long  addr 
)

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.

unsigned long long pevent_find_function_address ( struct pevent pevent,
unsigned long long  addr 
)

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.

void pevent_free ( struct pevent pevent)

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.

void pevent_free_token ( char token)

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.

const char* pevent_get_input_buf ( void  )

Definition at line 61 of file event-parse.c.

unsigned long long pevent_get_input_buf_ptr ( void  )

Definition at line 66 of file event-parse.c.

struct event_format** pevent_list_events ( struct pevent pevent,
enum  event_sort_type 
)
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.

int pevent_peek_char ( void  )

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.

int pevent_pid_is_registered ( struct pevent pevent,
int  pid 
)

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.

void pevent_print_funcs ( struct pevent pevent)

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.

void pevent_print_printk ( struct pevent pevent)

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.

unsigned long long pevent_read_number ( struct pevent pevent,
const void ptr,
int  size 
)

pevent_read_number - read a number from data : handle for the pevent : the raw data : the size of the data that holds the number

Returns the number (converted to host) from the raw data.

Definition at line 2995 of file event-parse.c.

int pevent_read_number_field ( struct format_field field,
const void data,
unsigned long long value 
)

pevent_read_number_field - read a number from data : a handle to the field : the raw data to read : the value to place the number in

Reads raw data according to a field offset and size, and translates it into .

Returns 0 on success, -1 otherwise.

Definition at line 3024 of file event-parse.c.

enum event_type pevent_read_token ( char **  tok)

pevent_read_token - access to utilites to use the pevent parser : The token to return

This will parse tokens from the string given by pevent_init_data().

Returns the token type.

Definition at line 1053 of file event-parse.c.

void pevent_ref ( struct pevent pevent)

Definition at line 5488 of file event-parse.c.

int pevent_register_comm ( struct pevent pevent,
const char comm,
int  pid 
)

pevent_register_comm - register a pid / comm mapping : handle for the pevent : the command line to register : the pid to map the command line to

This adds a mapping to search for command line names with a given pid. The comm is duplicated.

Definition at line 284 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.

int pevent_register_print_string ( struct pevent pevent,
char fmt,
unsigned long long  addr 
)

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.

int pevent_strerror ( struct pevent pevent,
enum pevent_errno  errnum,
char buf,
size_t  buflen 
)

Definition at line 5073 of file event-parse.c.

void pevent_unref ( struct pevent pevent)

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.

void trace_seq_destroy ( struct trace_seq s)

trace_seq_destroy - free up memory of a trace_seq : a pointer to the trace_seq to free the buffer

Only frees the buffer, not the trace_seq struct itself.

Definition at line 58 of file trace-seq.c.

int trace_seq_do_printf ( struct trace_seq s)

Definition at line 196 of file trace-seq.c.

void trace_seq_init ( struct trace_seq s)

trace_seq_init - initialize the trace_seq structure : a pointer to the trace_seq structure to initialize

Definition at line 44 of file trace-seq.c.

int trace_seq_printf ( struct trace_seq s,
const char fmt,
  ... 
)
int trace_seq_putc ( struct trace_seq s,
unsigned char  c 
)

Definition at line 195 of file trace_output.c.

int int int trace_seq_puts ( struct trace_seq s,
const char str 
)

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.

void trace_seq_terminate ( struct trace_seq s)

Definition at line 188 of file trace-seq.c.

int int trace_seq_vprintf ( struct trace_seq s,
const char fmt,
va_list  args 
)