Back to home page

OSCL-LXR

 
 

    


0001 libtraceevent(3)
0002 ================
0003 
0004 NAME
0005 ----
0006 tep_get_header_page_size, tep_get_header_timestamp_size, tep_is_old_format -
0007 Get the data stored in the header page, in kernel context.
0008 
0009 SYNOPSIS
0010 --------
0011 [verse]
0012 --
0013 *#include <event-parse.h>*
0014 
0015 int *tep_get_header_page_size*(struct tep_handle pass:[*]_tep_);
0016 int *tep_get_header_timestamp_size*(struct tep_handle pass:[*]_tep_);
0017 bool *tep_is_old_format*(struct tep_handle pass:[*]_tep_);
0018 --
0019 DESCRIPTION
0020 -----------
0021 These functions retrieve information from kernel context, stored in tracefs
0022 events/header_page. Old kernels do not have header page info, so default values
0023 from user space context are used.
0024 
0025 The _tep_get_header_page_size()_ function returns the size of a long integer,
0026 in kernel context. The _tep_ argument is trace event parser context.
0027 This information is retrieved from tracefs events/header_page, "commit" field.
0028 
0029 The _tep_get_header_timestamp_size()_ function returns the size of timestamps,
0030 in kernel context. The _tep_ argument is trace event parser context. This
0031 information is retrieved from tracefs events/header_page, "timestamp" field.
0032 
0033 The _tep_is_old_format()_ function returns true if the kernel predates
0034 the addition of events/header_page, otherwise it returns false.
0035 
0036 RETURN VALUE
0037 ------------
0038 The _tep_get_header_page_size()_ function returns the size of a long integer,
0039 in bytes.
0040 
0041 The _tep_get_header_timestamp_size()_ function returns the size of timestamps,
0042 in bytes.
0043 
0044 The _tep_is_old_format()_ function returns true, if an old kernel is used to
0045 generate the tracing data, which has no event/header_page. If the kernel is new,
0046 or _tep_ is NULL, false is returned.
0047 
0048 EXAMPLE
0049 -------
0050 [source,c]
0051 --
0052 #include <event-parse.h>
0053 ...
0054 struct tep_handle *tep = tep_alloc();
0055 ...
0056         int longsize;
0057         int timesize;
0058         bool old;
0059 
0060         longsize = tep_get_header_page_size(tep);
0061         timesize = tep_get_header_timestamp_size(tep);
0062         old = tep_is_old_format(tep);
0063 
0064         printf ("%s kernel is used to generate the tracing data.\n",
0065                 old?"Old":"New");
0066         printf("The size of a long integer is %d bytes.\n", longsize);
0067         printf("The timestamps size is %d bytes.\n", timesize);
0068 ...
0069 --
0070 
0071 FILES
0072 -----
0073 [verse]
0074 --
0075 *event-parse.h*
0076         Header file to include in order to have access to the library APIs.
0077 *-ltraceevent*
0078         Linker switch to add when building a program that uses the library.
0079 --
0080 
0081 SEE ALSO
0082 --------
0083 _libtraceevent(3)_, _trace-cmd(1)_
0084 
0085 AUTHOR
0086 ------
0087 [verse]
0088 --
0089 *Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*.
0090 *Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page.
0091 --
0092 REPORTING BUGS
0093 --------------
0094 Report bugs to  <linux-trace-devel@vger.kernel.org>
0095 
0096 LICENSE
0097 -------
0098 libtraceevent is Free Software licensed under the GNU LGPL 2.1
0099 
0100 RESOURCES
0101 ---------
0102 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git