Back to home page

OSCL-LXR

 
 

    


0001 libtraceevent(3)
0002 ================
0003 
0004 NAME
0005 ----
0006 tep_parse_header_page - Parses the data stored in the header page.
0007 
0008 SYNOPSIS
0009 --------
0010 [verse]
0011 --
0012 *#include <event-parse.h>*
0013 
0014 int *tep_parse_header_page*(struct tep_handle pass:[*]_tep_, char pass:[*]_buf_, unsigned long _size_, int _long_size_);
0015 --
0016 
0017 DESCRIPTION
0018 -----------
0019 The _tep_parse_header_page()_ function parses the header page data from _buf_,
0020 and initializes the _tep_, trace event parser context, with it. The buffer
0021 _buf_ is with _size_, and is supposed to be copied from
0022 tracefs/events/header_page.
0023 
0024 Some old kernels do not have header page info, in this case the
0025 _tep_parse_header_page()_ function  can be called with _size_ equal to 0. The
0026 _tep_ context is initialized with default values. The _long_size_ can be used in
0027 this use case, to set the size of a long integer to be used.
0028 
0029 RETURN VALUE
0030 ------------
0031 The _tep_parse_header_page()_ function returns 0 in case of success, or -1
0032 in case of an error.
0033 
0034 EXAMPLE
0035 -------
0036 [source,c]
0037 --
0038 #include <event-parse.h>
0039 ...
0040 struct tep_handle *tep = tep_alloc();
0041 ...
0042 char *buf;
0043 int size;
0044 buf = read_file("/sys/kernel/tracing/events/header_page", &size);
0045 if (tep_parse_header_page(tep, buf, size, sizeof(unsigned long)) != 0) {
0046         /* Failed to parse the header page */
0047 }
0048 ...
0049 --
0050 
0051 FILES
0052 -----
0053 [verse]
0054 --
0055 *event-parse.h*
0056         Header file to include in order to have access to the library APIs.
0057 *-ltraceevent*
0058         Linker switch to add when building a program that uses the library.
0059 --
0060 
0061 SEE ALSO
0062 --------
0063 _libtraceevent(3)_, _trace-cmd(1)_
0064 
0065 AUTHOR
0066 ------
0067 [verse]
0068 --
0069 *Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*.
0070 *Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page.
0071 --
0072 REPORTING BUGS
0073 --------------
0074 Report bugs to  <linux-trace-devel@vger.kernel.org>
0075 
0076 LICENSE
0077 -------
0078 libtraceevent is Free Software licensed under the GNU LGPL 2.1
0079 
0080 RESOURCES
0081 ---------
0082 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git