1libtraceevent(3) 2================ 3 4NAME 5---- 6tep_read_number - Reads a number from raw data. 7 8SYNOPSIS 9-------- 10[verse] 11-- 12*#include <event-parse.h>* 13 14unsigned long long *tep_read_number*(struct tep_handle pass:[*]_tep_, const void pass:[*]_ptr_, int _size_); 15-- 16 17DESCRIPTION 18----------- 19The _tep_read_number()_ function reads an integer from raw data, taking into 20account the endianness of the raw data and the current host. The _tep_ argument 21is the trace event parser context. The _ptr_ is a pointer to the raw data, where 22the integer is, and the _size_ is the size of the integer. 23 24RETURN VALUE 25------------ 26The _tep_read_number()_ function returns the integer in the byte order of 27the current host. In case of an error, 0 is returned. 28 29EXAMPLE 30------- 31[source,c] 32-- 33#include <event-parse.h> 34... 35struct tep_handle *tep = tep_alloc(); 36... 37void process_record(struct tep_record *record) 38{ 39 int offset = 24; 40 int data = tep_read_number(tep, record->data + offset, 4); 41 42 /* Read the 4 bytes at the offset 24 of data as an integer */ 43} 44... 45-- 46 47FILES 48----- 49[verse] 50-- 51*event-parse.h* 52 Header file to include in order to have access to the library APIs. 53*-ltraceevent* 54 Linker switch to add when building a program that uses the library. 55-- 56 57SEE ALSO 58-------- 59_libtraceevent(3)_, _trace-cmd(1)_ 60 61AUTHOR 62------ 63[verse] 64-- 65*Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*. 66*Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page. 67-- 68REPORTING BUGS 69-------------- 70Report bugs to <linux-trace-devel@vger.kernel.org> 71 72LICENSE 73------- 74libtraceevent is Free Software licensed under the GNU LGPL 2.1 75 76RESOURCES 77--------- 78https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 79