1LIBTRACEEVENT(3) libtraceevent Manual LIBTRACEEVENT(3)
2
3
4
6 tep_read_number - Reads a number from raw data.
7
9 #include <event-parse.h>
10
11 unsigned long long tep_read_number(struct tep_handle *tep, const void *ptr, int size);
12
14 The tep_read_number() function reads an integer from raw data, taking
15 into account the endianness of the raw data and the current host. The
16 tep argument is the trace event parser context. The ptr is a pointer to
17 the raw data, where the integer is, and the size is the size of the
18 integer.
19
21 The tep_read_number() function returns the integer in the byte order of
22 the current host. In case of an error, 0 is returned.
23
25 #include <event-parse.h>
26 ...
27 struct tep_handle *tep = tep_alloc();
28 ...
29 void process_record(struct tep_record *record)
30 {
31 int offset = 24;
32 int data = tep_read_number(tep, record->data + offset, 4);
33
34 /* Read the 4 bytes at the offset 24 of data as an integer */
35 }
36 ...
37
39 event-parse.h
40 Header file to include in order to have access to the library APIs.
41 -ltraceevent
42 Linker switch to add when building a program that uses the library.
43
45 libtraceevent(3), trace-cmd(1)
46
48 Steven Rostedt <rostedt@goodmis.org[1]>, author of libtraceevent.
49 Tzvetomir Stoyanov <tz.stoyanov@gmail.com[2]>, author of this man page.
50
52 Report bugs to <linux-trace-devel@vger.kernel.org[3]>
53
55 libtraceevent is Free Software licensed under the GNU LGPL 2.1
56
58 https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/
59
61 1. rostedt@goodmis.org
62 mailto:rostedt@goodmis.org
63
64 2. tz.stoyanov@gmail.com
65 mailto:tz.stoyanov@gmail.com
66
67 3. linux-trace-devel@vger.kernel.org
68 mailto:linux-trace-devel@vger.kernel.org
69
70
71
72libtraceevent 1.5.3 04/15/2022 LIBTRACEEVENT(3)