xref: /aosp_15_r20/external/libtraceevent/Documentation/libtraceevent-page_size.txt (revision 436bf2bcd5202612ffffe471bbcc1f277cc8d28e)
1libtraceevent(3)
2================
3
4NAME
5----
6tep_get_page_size, tep_set_page_size, tep_get_sub_buffer_data_size, tep_get_sub_buffer_size - Get / set the size of a memory page on
7the machine, where the trace is generated
8
9SYNOPSIS
10--------
11[verse]
12--
13*#include <event-parse.h>*
14
15int *tep_get_page_size*(struct tep_handle pass:[*]_tep_);
16void *tep_set_page_size*(struct tep_handle pass:[*]_tep_, int _page_size_);
17int *tep_get_sub_buffer_size*(struct tep_handle pass:[*]_tep_);
18int *tep_get_sub_buffer_data_size*(struct tep_handle pass:[*]_tep_);
19int *tep_get_sub_buffer_commit_offset*(struct tep_handle pass:[*]_tep_);
20--
21
22DESCRIPTION
23-----------
24The *tep_get_page_size()* function returns the size of a memory page on
25the machine, where the trace is generated. The _tep_ argument is trace
26event parser context.
27
28The *tep_set_page_size()* function stores in the _tep_ context the size of a
29memory page on the machine, where the trace is generated.
30The _tep_ argument is trace event parser context.
31The _page_size_ argument is the size of a memory page, in bytes.
32
33The *tep_get_sub_buffer_size()* returns the size of each "sub buffer" of the
34ring buffer. The Linux kernel ring buffer is broken up into sections called
35sub buffers. This returns the size of those buffers.
36
37The *tep_get_sub_buffer_data_size()* returns the size of just the data portion
38of the sub buffers.
39
40The *tep_get_sub_buffer_commit_offset()* returns the offset on the sub buffer
41that holds the committed portion of data. This number contains the index from
42the data portion of the sub buffer that is the end of the last element on the
43sub buffer.
44
45RETURN VALUE
46------------
47The *tep_get_page_size()* function returns size of the memory page, in bytes.
48
49The *tep_get_sub_buffer_size()* function returns the number of bytes each sub
50buffer is made up of.
51
52The *tep_get_sub_buffer_commit_offset()* function returns the location on the
53sub buffer that contains the index of the last element.
54
55EXAMPLE
56-------
57[source,c]
58--
59#include <unistd.h>
60#include <event-parse.h>
61...
62struct tep_handle *tep = tep_alloc();
63...
64	int page_size = getpagesize();
65
66	tep_set_page_size(tep, page_size);
67
68	printf("The page size for this machine is %d\n", tep_get_page_size(tep));
69
70--
71
72FILES
73-----
74[verse]
75--
76*event-parse.h*
77	Header file to include in order to have access to the library APIs.
78*-ltraceevent*
79	Linker switch to add when building a program that uses the library.
80--
81
82SEE ALSO
83--------
84*libtraceevent*(3), *trace-cmd*(1)
85
86AUTHOR
87------
88[verse]
89--
90*Steven Rostedt* <[email protected]>, author of *libtraceevent*.
91*Tzvetomir Stoyanov* <[email protected]>, author of this man page.
92--
93REPORTING BUGS
94--------------
95Report bugs to  <[email protected]>
96
97LICENSE
98-------
99libtraceevent is Free Software licensed under the GNU LGPL 2.1
100
101RESOURCES
102---------
103https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/
104