Back to home page

OSCL-LXR

 
 

    


0001 libtraceevent(3)
0002 ================
0003 
0004 NAME
0005 ----
0006 tep_read_number - Reads a number from raw data.
0007 
0008 SYNOPSIS
0009 --------
0010 [verse]
0011 --
0012 *#include <event-parse.h>*
0013 
0014 unsigned long long *tep_read_number*(struct tep_handle pass:[*]_tep_, const void pass:[*]_ptr_, int _size_);
0015 --
0016 
0017 DESCRIPTION
0018 -----------
0019 The _tep_read_number()_ function reads an integer from raw data, taking into
0020 account the endianness of the raw data and the current host. The _tep_ argument
0021 is the trace event parser context. The _ptr_ is a pointer to the raw data, where
0022 the integer is, and the _size_ is the size of the integer.
0023 
0024 RETURN VALUE
0025 ------------
0026 The _tep_read_number()_ function returns the integer in the byte order of
0027 the current host. In case of an error, 0 is returned.
0028 
0029 EXAMPLE
0030 -------
0031 [source,c]
0032 --
0033 #include <event-parse.h>
0034 ...
0035 struct tep_handle *tep = tep_alloc();
0036 ...
0037 void process_record(struct tep_record *record)
0038 {
0039         int offset = 24;
0040         int data = tep_read_number(tep, record->data + offset, 4);
0041 
0042         /* Read the 4 bytes at the offset 24 of data as an integer */
0043 }
0044 ...
0045 --
0046 
0047 FILES
0048 -----
0049 [verse]
0050 --
0051 *event-parse.h*
0052         Header file to include in order to have access to the library APIs.
0053 *-ltraceevent*
0054         Linker switch to add when building a program that uses the library.
0055 --
0056 
0057 SEE ALSO
0058 --------
0059 _libtraceevent(3)_, _trace-cmd(1)_
0060 
0061 AUTHOR
0062 ------
0063 [verse]
0064 --
0065 *Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*.
0066 *Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page.
0067 --
0068 REPORTING BUGS
0069 --------------
0070 Report bugs to  <linux-trace-devel@vger.kernel.org>
0071 
0072 LICENSE
0073 -------
0074 libtraceevent is Free Software licensed under the GNU LGPL 2.1
0075 
0076 RESOURCES
0077 ---------
0078 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git