FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
maplog.c File Reference
+ Include dependency graph for maplog.c:

Go to the source code of this file.

Functions

__clib_export int clib_maplog_init (clib_maplog_init_args_t *a)
 Initialize a maplog object. More...
 
void clib_maplog_update_header (clib_maplog_main_t *mm)
 Update a mapped log header file. More...
 
__clib_export void clib_maplog_close (clib_maplog_main_t *mm)
 Close a mapped log, and update the log header file. More...
 
__clib_export u8format_maplog_header (u8 *s, va_list *args)
 format a log header More...
 
__clib_export int clib_maplog_process (char *file_basename, void *fp_arg)
 Process a complete maplog. More...
 

Function Documentation

◆ clib_maplog_close()

__clib_export void clib_maplog_close ( clib_maplog_main_t mm)

Close a mapped log, and update the log header file.

Unmap the current log segments. Read the log header. Update the number of records, and number of files

Parameters
[in/out]mm mapped log object

Definition at line 299 of file maplog.c.

+ Here is the call graph for this function:

◆ clib_maplog_init()

__clib_export int clib_maplog_init ( clib_maplog_init_args_t a)

Initialize a maplog object.

Compute record and file size parameters Create and map two log segments to seed the process

Parameters
[in/out]a init args structure
Returns
0 => success, <0 => failure

Definition at line 28 of file maplog.c.

+ Here is the call graph for this function:

◆ clib_maplog_process()

__clib_export int clib_maplog_process ( char *  file_basename,
void *  fp_arg 
)

Process a complete maplog.

Reads the maplog header. Map and process all log segments in order. Calls the callback function once per file with a record count.

Note: if the file header isn't updated by calling clib_maplog_close(), it will appear to have an infinite number of records in an infinite number of files.

So long as the callback function understands that possibility

  • by simply ignoring NULL records - the scheme still works...
Parameters
[in]file_basenameSame basename supplied to clib_maplog_init
[in]fp_argCallback function pointer

Definition at line 384 of file maplog.c.

+ Here is the call graph for this function:

◆ clib_maplog_update_header()

void clib_maplog_update_header ( clib_maplog_main_t mm)

Update a mapped log header file.

Read the log header. Update the number of records, and number of files

Parameters
[in/out]mm mapped log object

Definition at line 246 of file maplog.c.

+ Here is the caller graph for this function:

◆ format_maplog_header()

__clib_export u8* format_maplog_header ( u8 s,
va_list *  args 
)

format a log header

Usage: s = format (0, "%U", format_maplog_header(), headerp, verbose);

Parameters
[in]hclib_maplog_header_t pointer
[in]verboseself-explanatory

Definition at line 335 of file maplog.c.