FD.io VPP  v20.05.1-6-gf53edbc3b
Vector Packet Processing
elog.c File Reference
+ Include dependency graph for elog.c:

Go to the source code of this file.

Functions

static void elog_lock (elog_main_t *em)
 
static void elog_unlock (elog_main_t *em)
 
void * elog_event_data (elog_main_t *em, elog_event_type_t *type, elog_track_t *track, u64 cpu_time)
 
static void new_event_type (elog_main_t *em, uword i)
 
static uword find_or_create_type (elog_main_t *em, elog_event_type_t *t)
 
word elog_event_type_register (elog_main_t *em, elog_event_type_t *t)
 register an event type More...
 
word elog_track_register (elog_main_t *em, elog_track_t *t)
 register an event track More...
 
static uword parse_2digit_decimal (char *p, uword *number)
 
static u8fixed_format (u8 *s, char *fmt, char *result, uword *result_len)
 
u8format_elog_event (u8 *s, va_list *va)
 
u8format_elog_track_name (u8 *s, va_list *va)
 
u8format_elog_track (u8 *s, va_list *args)
 
void elog_time_now (elog_time_stamp_t *et)
 
static i64 elog_time_stamp_diff_os_nsec (elog_time_stamp_t *t1, elog_time_stamp_t *t2)
 
static i64 elog_time_stamp_diff_cpu (elog_time_stamp_t *t1, elog_time_stamp_t *t2)
 
static f64 elog_nsec_per_clock (elog_main_t *em)
 
void elog_alloc (elog_main_t *em, u32 n_events)
 
void elog_init (elog_main_t *em, u32 n_events)
 
static uword elog_event_range (elog_main_t *em, uword *lo)
 
elog_event_telog_peek_events (elog_main_t *em)
 convert event ring events to events, and return them as a vector. More...
 
u32 elog_string (elog_main_t *em, char *fmt,...)
 add a string to the event-log string table More...
 
elog_event_telog_get_events (elog_main_t *em)
 convert event ring events to events, and return them as a vector. More...
 
static void maybe_fix_string_table_offset (elog_event_t *e, elog_event_type_t *t, u32 offset)
 
static int elog_cmp (void *a1, void *a2)
 
void elog_merge (elog_main_t *dst, u8 *dst_tag, elog_main_t *src, u8 *src_tag, f64 align_tweak)
 
static void serialize_elog_event (serialize_main_t *m, va_list *va)
 
static void unserialize_elog_event (serialize_main_t *m, va_list *va)
 
static void serialize_elog_event_type (serialize_main_t *m, va_list *va)
 
static void unserialize_elog_event_type (serialize_main_t *m, va_list *va)
 
static void serialize_elog_track (serialize_main_t *m, va_list *va)
 
static void unserialize_elog_track (serialize_main_t *m, va_list *va)
 
static void serialize_elog_time_stamp (serialize_main_t *m, va_list *va)
 
static void unserialize_elog_time_stamp (serialize_main_t *m, va_list *va)
 
void serialize_elog_main (serialize_main_t *m, va_list *va)
 
void unserialize_elog_main (serialize_main_t *m, va_list *va)
 

Variables

static char * elog_serialize_magic = "elog v0"
 

Function Documentation

◆ elog_alloc()

void elog_alloc ( elog_main_t em,
u32  n_events 
)

Definition at line 479 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ elog_cmp()

static int elog_cmp ( void *  a1,
void *  a2 
)
static

Definition at line 661 of file elog.c.

+ Here is the caller graph for this function:

◆ elog_event_data()

void* elog_event_data ( elog_main_t em,
elog_event_type_t type,
elog_track_t track,
u64  cpu_time 
)

Definition at line 65 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ elog_event_range()

static uword elog_event_range ( elog_main_t em,
uword lo 
)
static

Definition at line 516 of file elog.c.

+ Here is the caller graph for this function:

◆ elog_event_type_register()

word elog_event_type_register ( elog_main_t em,
elog_event_type_t t 
)

register an event type

Parameters
emelog_main_t *
telog_event_type_t * event to register
Returns
type index
Warning
Typically not called directly

Definition at line 104 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ elog_get_events()

elog_event_t* elog_get_events ( elog_main_t em)

convert event ring events to events, and return them as a vector.

Parameters
emelog_main_t *
Returns
event vector with timestamps in f64 seconds
Note
sets em->events to resulting vector.

Definition at line 606 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ elog_init()

void elog_init ( elog_main_t em,
u32  n_events 
)

Definition at line 493 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ elog_lock()

static void elog_lock ( elog_main_t em)
inlinestatic

Definition at line 47 of file elog.c.

+ Here is the caller graph for this function:

◆ elog_merge()

void elog_merge ( elog_main_t dst,
u8 dst_tag,
elog_main_t src,
u8 src_tag,
f64  align_tweak 
)

Definition at line 679 of file elog.c.

+ Here is the call graph for this function:

◆ elog_nsec_per_clock()

static f64 elog_nsec_per_clock ( elog_main_t em)
inlinestatic

Definition at line 470 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ elog_peek_events()

elog_event_t* elog_peek_events ( elog_main_t em)

convert event ring events to events, and return them as a vector.

Parameters
emelog_main_t *
Returns
event vector with timestamps in f64 seconds
Note
no side effects

Definition at line 537 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ elog_string()

u32 elog_string ( elog_main_t em,
char *  format,
  ... 
)

add a string to the event-log string table

Often combined with hashing and the T4 elog format specifier to display complex strings in offline tooling

Parameters
emelog_main_t *
formatchar *
VARARGS
Returns
u32 index to add to event log

Definition at line 562 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ elog_time_now()

void elog_time_now ( elog_time_stamp_t et)

Definition at line 431 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ elog_time_stamp_diff_cpu()

static i64 elog_time_stamp_diff_cpu ( elog_time_stamp_t t1,
elog_time_stamp_t t2 
)
inlinestatic

Definition at line 464 of file elog.c.

+ Here is the caller graph for this function:

◆ elog_time_stamp_diff_os_nsec()

static i64 elog_time_stamp_diff_os_nsec ( elog_time_stamp_t t1,
elog_time_stamp_t t2 
)
inlinestatic

Definition at line 458 of file elog.c.

+ Here is the caller graph for this function:

◆ elog_track_register()

word elog_track_register ( elog_main_t em,
elog_track_t t 
)

register an event track

Parameters
emelog_main_t *
telog_track_t * track to register
Returns
track index
Note
this function is often called directly

Definition at line 198 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ elog_unlock()

static void elog_unlock ( elog_main_t em)
inlinestatic

Definition at line 55 of file elog.c.

+ Here is the caller graph for this function:

◆ find_or_create_type()

static uword find_or_create_type ( elog_main_t em,
elog_event_type_t t 
)
static

Definition at line 85 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fixed_format()

static u8* fixed_format ( u8 s,
char *  fmt,
char *  result,
uword result_len 
)
static

Definition at line 249 of file elog.c.

+ Here is the caller graph for this function:

◆ format_elog_event()

u8* format_elog_event ( u8 s,
va_list *  va 
)

Definition at line 296 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_elog_track()

u8* format_elog_track ( u8 s,
va_list *  args 
)

Definition at line 408 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_elog_track_name()

u8* format_elog_track_name ( u8 s,
va_list *  va 
)

Definition at line 399 of file elog.c.

+ Here is the call graph for this function:

◆ maybe_fix_string_table_offset()

static void maybe_fix_string_table_offset ( elog_event_t e,
elog_event_type_t t,
u32  offset 
)
static

Definition at line 614 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ new_event_type()

static void new_event_type ( elog_main_t em,
uword  i 
)
static

Definition at line 72 of file elog.c.

+ Here is the caller graph for this function:

◆ parse_2digit_decimal()

static uword parse_2digit_decimal ( char *  p,
uword number 
)
static

Definition at line 222 of file elog.c.

+ Here is the caller graph for this function:

◆ serialize_elog_event()

static void serialize_elog_event ( serialize_main_t m,
va_list *  va 
)
static

Definition at line 846 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_elog_event_type()

static void serialize_elog_event_type ( serialize_main_t m,
va_list *  va 
)
static

Definition at line 1011 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_elog_main()

void serialize_elog_main ( serialize_main_t m,
va_list *  va 
)

Definition at line 1092 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_elog_time_stamp()

static void serialize_elog_time_stamp ( serialize_main_t m,
va_list *  va 
)
static

Definition at line 1074 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_elog_track()

static void serialize_elog_track ( serialize_main_t m,
va_list *  va 
)
static

Definition at line 1050 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unserialize_elog_event()

static void unserialize_elog_event ( serialize_main_t m,
va_list *  va 
)
static

Definition at line 907 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unserialize_elog_event_type()

static void unserialize_elog_event_type ( serialize_main_t m,
va_list *  va 
)
static

Definition at line 1030 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unserialize_elog_main()

void unserialize_elog_main ( serialize_main_t m,
va_list *  va 
)

Definition at line 1126 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unserialize_elog_time_stamp()

static void unserialize_elog_time_stamp ( serialize_main_t m,
va_list *  va 
)
static

Definition at line 1082 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unserialize_elog_track()

static void unserialize_elog_track ( serialize_main_t m,
va_list *  va 
)
static

Definition at line 1062 of file elog.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ elog_serialize_magic

char* elog_serialize_magic = "elog v0"
static

Definition at line 1089 of file elog.c.