Lines Matching +full:open +full:- +full:source
1 libperf-sampling(7)
5 ----
6 libperf-sampling - sampling interface
10 -----------
19 [source,bash]
20 --
21 $ gcc -o sampling sampling.c -lperf
32 --
39 - creates events
40 - adds them to the event list
41 - opens and enables events through the event list
42 - sleeps for 3 seconds
43 - disables events
44 - reads and displays recorded samples
45 - destroys the event list
49 [source,c]
50 --
61 --
68 [source,c]
69 --
78 --
82 [source,c]
83 --
92 --
98 [source,c]
99 --
103 45 return -1;
105 --
109 [source,c]
110 --
116 --
120 [source,c]
121 --
129 --
131 Configure event list with the cpus map and open event:
133 [source,c]
134 --
139 66 fprintf(stderr, "failed to open evlist\n");
142 --
144 Once the events list is open, we can create memory maps AKA perf ring buffers:
146 [source,c]
147 --
153 --
162 [source,c]
163 --
167 --
171 [source,c]
172 --
186 --
190 [source,c]
191 --
196 89 array = event->sample.array;
214 --
220 [source,c]
221 --
228 --
231 --------------
232 Report bugs to <linux-perf-[email protected]>.
235 -------
239 ---------
243 --------
244 libperf(3), libperf-counting(7)