auxtrace.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. /*
  2. * auxtrace.h: AUX area trace support
  3. * Copyright (c) 2013-2015, Intel Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms and conditions of the GNU General Public License,
  7. * version 2, as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. */
  15. #ifndef __PERF_AUXTRACE_H
  16. #define __PERF_AUXTRACE_H
  17. #include <sys/types.h>
  18. #include <stdbool.h>
  19. #include <stddef.h>
  20. #include <linux/list.h>
  21. #include <linux/perf_event.h>
  22. #include <linux/types.h>
  23. #include "../perf.h"
  24. #include "event.h"
  25. #include "session.h"
  26. #include "debug.h"
  27. union perf_event;
  28. struct perf_session;
  29. struct perf_evlist;
  30. struct perf_tool;
  31. struct option;
  32. struct record_opts;
  33. struct auxtrace_info_event;
  34. struct events_stats;
  35. enum auxtrace_type {
  36. PERF_AUXTRACE_UNKNOWN,
  37. PERF_AUXTRACE_INTEL_PT,
  38. PERF_AUXTRACE_INTEL_BTS,
  39. };
  40. enum itrace_period_type {
  41. PERF_ITRACE_PERIOD_INSTRUCTIONS,
  42. PERF_ITRACE_PERIOD_TICKS,
  43. PERF_ITRACE_PERIOD_NANOSECS,
  44. };
  45. /**
  46. * struct itrace_synth_opts - AUX area tracing synthesis options.
  47. * @set: indicates whether or not options have been set
  48. * @inject: indicates the event (not just the sample) must be fully synthesized
  49. * because 'perf inject' will write it out
  50. * @instructions: whether to synthesize 'instructions' events
  51. * @branches: whether to synthesize 'branches' events
  52. * @transactions: whether to synthesize events for transactions
  53. * @errors: whether to synthesize decoder error events
  54. * @dont_decode: whether to skip decoding entirely
  55. * @log: write a decoding log
  56. * @calls: limit branch samples to calls (can be combined with @returns)
  57. * @returns: limit branch samples to returns (can be combined with @calls)
  58. * @callchain: add callchain to 'instructions' events
  59. * @callchain_sz: maximum callchain size
  60. * @period: 'instructions' events period
  61. * @period_type: 'instructions' events period type
  62. */
  63. struct itrace_synth_opts {
  64. bool set;
  65. bool inject;
  66. bool instructions;
  67. bool branches;
  68. bool transactions;
  69. bool errors;
  70. bool dont_decode;
  71. bool log;
  72. bool calls;
  73. bool returns;
  74. bool callchain;
  75. unsigned int callchain_sz;
  76. unsigned long long period;
  77. enum itrace_period_type period_type;
  78. };
  79. /**
  80. * struct auxtrace_index_entry - indexes a AUX area tracing event within a
  81. * perf.data file.
  82. * @file_offset: offset within the perf.data file
  83. * @sz: size of the event
  84. */
  85. struct auxtrace_index_entry {
  86. u64 file_offset;
  87. u64 sz;
  88. };
  89. #define PERF_AUXTRACE_INDEX_ENTRY_COUNT 256
  90. /**
  91. * struct auxtrace_index - index of AUX area tracing events within a perf.data
  92. * file.
  93. * @list: linking a number of arrays of entries
  94. * @nr: number of entries
  95. * @entries: array of entries
  96. */
  97. struct auxtrace_index {
  98. struct list_head list;
  99. size_t nr;
  100. struct auxtrace_index_entry entries[PERF_AUXTRACE_INDEX_ENTRY_COUNT];
  101. };
  102. /**
  103. * struct auxtrace - session callbacks to allow AUX area data decoding.
  104. * @process_event: lets the decoder see all session events
  105. * @flush_events: process any remaining data
  106. * @free_events: free resources associated with event processing
  107. * @free: free resources associated with the session
  108. */
  109. struct auxtrace {
  110. int (*process_event)(struct perf_session *session,
  111. union perf_event *event,
  112. struct perf_sample *sample,
  113. struct perf_tool *tool);
  114. int (*process_auxtrace_event)(struct perf_session *session,
  115. union perf_event *event,
  116. struct perf_tool *tool);
  117. int (*flush_events)(struct perf_session *session,
  118. struct perf_tool *tool);
  119. void (*free_events)(struct perf_session *session);
  120. void (*free)(struct perf_session *session);
  121. };
  122. /**
  123. * struct auxtrace_buffer - a buffer containing AUX area tracing data.
  124. * @list: buffers are queued in a list held by struct auxtrace_queue
  125. * @size: size of the buffer in bytes
  126. * @pid: in per-thread mode, the pid this buffer is associated with
  127. * @tid: in per-thread mode, the tid this buffer is associated with
  128. * @cpu: in per-cpu mode, the cpu this buffer is associated with
  129. * @data: actual buffer data (can be null if the data has not been loaded)
  130. * @data_offset: file offset at which the buffer can be read
  131. * @mmap_addr: mmap address at which the buffer can be read
  132. * @mmap_size: size of the mmap at @mmap_addr
  133. * @data_needs_freeing: @data was malloc'd so free it when it is no longer
  134. * needed
  135. * @consecutive: the original data was split up and this buffer is consecutive
  136. * to the previous buffer
  137. * @offset: offset as determined by aux_head / aux_tail members of struct
  138. * perf_event_mmap_page
  139. * @reference: an implementation-specific reference determined when the data is
  140. * recorded
  141. * @buffer_nr: used to number each buffer
  142. * @use_size: implementation actually only uses this number of bytes
  143. * @use_data: implementation actually only uses data starting at this address
  144. */
  145. struct auxtrace_buffer {
  146. struct list_head list;
  147. size_t size;
  148. pid_t pid;
  149. pid_t tid;
  150. int cpu;
  151. void *data;
  152. off_t data_offset;
  153. void *mmap_addr;
  154. size_t mmap_size;
  155. bool data_needs_freeing;
  156. bool consecutive;
  157. u64 offset;
  158. u64 reference;
  159. u64 buffer_nr;
  160. size_t use_size;
  161. void *use_data;
  162. };
  163. /**
  164. * struct auxtrace_queue - a queue of AUX area tracing data buffers.
  165. * @head: head of buffer list
  166. * @tid: in per-thread mode, the tid this queue is associated with
  167. * @cpu: in per-cpu mode, the cpu this queue is associated with
  168. * @set: %true once this queue has been dedicated to a specific thread or cpu
  169. * @priv: implementation-specific data
  170. */
  171. struct auxtrace_queue {
  172. struct list_head head;
  173. pid_t tid;
  174. int cpu;
  175. bool set;
  176. void *priv;
  177. };
  178. /**
  179. * struct auxtrace_queues - an array of AUX area tracing queues.
  180. * @queue_array: array of queues
  181. * @nr_queues: number of queues
  182. * @new_data: set whenever new data is queued
  183. * @populated: queues have been fully populated using the auxtrace_index
  184. * @next_buffer_nr: used to number each buffer
  185. */
  186. struct auxtrace_queues {
  187. struct auxtrace_queue *queue_array;
  188. unsigned int nr_queues;
  189. bool new_data;
  190. bool populated;
  191. u64 next_buffer_nr;
  192. };
  193. /**
  194. * struct auxtrace_heap_item - element of struct auxtrace_heap.
  195. * @queue_nr: queue number
  196. * @ordinal: value used for sorting (lowest ordinal is top of the heap) expected
  197. * to be a timestamp
  198. */
  199. struct auxtrace_heap_item {
  200. unsigned int queue_nr;
  201. u64 ordinal;
  202. };
  203. /**
  204. * struct auxtrace_heap - a heap suitable for sorting AUX area tracing queues.
  205. * @heap_array: the heap
  206. * @heap_cnt: the number of elements in the heap
  207. * @heap_sz: maximum number of elements (grows as needed)
  208. */
  209. struct auxtrace_heap {
  210. struct auxtrace_heap_item *heap_array;
  211. unsigned int heap_cnt;
  212. unsigned int heap_sz;
  213. };
  214. /**
  215. * struct auxtrace_mmap - records an mmap of the auxtrace buffer.
  216. * @base: address of mapped area
  217. * @userpg: pointer to buffer's perf_event_mmap_page
  218. * @mask: %0 if @len is not a power of two, otherwise (@len - %1)
  219. * @len: size of mapped area
  220. * @prev: previous aux_head
  221. * @idx: index of this mmap
  222. * @tid: tid for a per-thread mmap (also set if there is only 1 tid on a per-cpu
  223. * mmap) otherwise %0
  224. * @cpu: cpu number for a per-cpu mmap otherwise %-1
  225. */
  226. struct auxtrace_mmap {
  227. void *base;
  228. void *userpg;
  229. size_t mask;
  230. size_t len;
  231. u64 prev;
  232. int idx;
  233. pid_t tid;
  234. int cpu;
  235. };
  236. /**
  237. * struct auxtrace_mmap_params - parameters to set up struct auxtrace_mmap.
  238. * @mask: %0 if @len is not a power of two, otherwise (@len - %1)
  239. * @offset: file offset of mapped area
  240. * @len: size of mapped area
  241. * @prot: mmap memory protection
  242. * @idx: index of this mmap
  243. * @tid: tid for a per-thread mmap (also set if there is only 1 tid on a per-cpu
  244. * mmap) otherwise %0
  245. * @cpu: cpu number for a per-cpu mmap otherwise %-1
  246. */
  247. struct auxtrace_mmap_params {
  248. size_t mask;
  249. off_t offset;
  250. size_t len;
  251. int prot;
  252. int idx;
  253. pid_t tid;
  254. int cpu;
  255. };
  256. /**
  257. * struct auxtrace_record - callbacks for recording AUX area data.
  258. * @recording_options: validate and process recording options
  259. * @info_priv_size: return the size of the private data in auxtrace_info_event
  260. * @info_fill: fill-in the private data in auxtrace_info_event
  261. * @free: free this auxtrace record structure
  262. * @snapshot_start: starting a snapshot
  263. * @snapshot_finish: finishing a snapshot
  264. * @find_snapshot: find data to snapshot within auxtrace mmap
  265. * @parse_snapshot_options: parse snapshot options
  266. * @reference: provide a 64-bit reference number for auxtrace_event
  267. * @read_finish: called after reading from an auxtrace mmap
  268. */
  269. struct auxtrace_record {
  270. int (*recording_options)(struct auxtrace_record *itr,
  271. struct perf_evlist *evlist,
  272. struct record_opts *opts);
  273. size_t (*info_priv_size)(struct auxtrace_record *itr);
  274. int (*info_fill)(struct auxtrace_record *itr,
  275. struct perf_session *session,
  276. struct auxtrace_info_event *auxtrace_info,
  277. size_t priv_size);
  278. void (*free)(struct auxtrace_record *itr);
  279. int (*snapshot_start)(struct auxtrace_record *itr);
  280. int (*snapshot_finish)(struct auxtrace_record *itr);
  281. int (*find_snapshot)(struct auxtrace_record *itr, int idx,
  282. struct auxtrace_mmap *mm, unsigned char *data,
  283. u64 *head, u64 *old);
  284. int (*parse_snapshot_options)(struct auxtrace_record *itr,
  285. struct record_opts *opts,
  286. const char *str);
  287. u64 (*reference)(struct auxtrace_record *itr);
  288. int (*read_finish)(struct auxtrace_record *itr, int idx);
  289. unsigned int alignment;
  290. };
  291. #ifdef HAVE_AUXTRACE_SUPPORT
  292. /*
  293. * In snapshot mode the mmapped page is read-only which makes using
  294. * __sync_val_compare_and_swap() problematic. However, snapshot mode expects
  295. * the buffer is not updated while the snapshot is made (e.g. Intel PT disables
  296. * the event) so there is not a race anyway.
  297. */
  298. static inline u64 auxtrace_mmap__read_snapshot_head(struct auxtrace_mmap *mm)
  299. {
  300. struct perf_event_mmap_page *pc = mm->userpg;
  301. u64 head = ACCESS_ONCE(pc->aux_head);
  302. /* Ensure all reads are done after we read the head */
  303. rmb();
  304. return head;
  305. }
  306. static inline u64 auxtrace_mmap__read_head(struct auxtrace_mmap *mm)
  307. {
  308. struct perf_event_mmap_page *pc = mm->userpg;
  309. #if BITS_PER_LONG == 64 || !defined(HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT)
  310. u64 head = ACCESS_ONCE(pc->aux_head);
  311. #else
  312. u64 head = __sync_val_compare_and_swap(&pc->aux_head, 0, 0);
  313. #endif
  314. /* Ensure all reads are done after we read the head */
  315. rmb();
  316. return head;
  317. }
  318. static inline void auxtrace_mmap__write_tail(struct auxtrace_mmap *mm, u64 tail)
  319. {
  320. struct perf_event_mmap_page *pc = mm->userpg;
  321. #if BITS_PER_LONG != 64 && defined(HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT)
  322. u64 old_tail;
  323. #endif
  324. /* Ensure all reads are done before we write the tail out */
  325. mb();
  326. #if BITS_PER_LONG == 64 || !defined(HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT)
  327. pc->aux_tail = tail;
  328. #else
  329. do {
  330. old_tail = __sync_val_compare_and_swap(&pc->aux_tail, 0, 0);
  331. } while (!__sync_bool_compare_and_swap(&pc->aux_tail, old_tail, tail));
  332. #endif
  333. }
  334. int auxtrace_mmap__mmap(struct auxtrace_mmap *mm,
  335. struct auxtrace_mmap_params *mp,
  336. void *userpg, int fd);
  337. void auxtrace_mmap__munmap(struct auxtrace_mmap *mm);
  338. void auxtrace_mmap_params__init(struct auxtrace_mmap_params *mp,
  339. off_t auxtrace_offset,
  340. unsigned int auxtrace_pages,
  341. bool auxtrace_overwrite);
  342. void auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp,
  343. struct perf_evlist *evlist, int idx,
  344. bool per_cpu);
  345. typedef int (*process_auxtrace_t)(struct perf_tool *tool,
  346. union perf_event *event, void *data1,
  347. size_t len1, void *data2, size_t len2);
  348. int auxtrace_mmap__read(struct auxtrace_mmap *mm, struct auxtrace_record *itr,
  349. struct perf_tool *tool, process_auxtrace_t fn);
  350. int auxtrace_mmap__read_snapshot(struct auxtrace_mmap *mm,
  351. struct auxtrace_record *itr,
  352. struct perf_tool *tool, process_auxtrace_t fn,
  353. size_t snapshot_size);
  354. int auxtrace_queues__init(struct auxtrace_queues *queues);
  355. int auxtrace_queues__add_event(struct auxtrace_queues *queues,
  356. struct perf_session *session,
  357. union perf_event *event, off_t data_offset,
  358. struct auxtrace_buffer **buffer_ptr);
  359. void auxtrace_queues__free(struct auxtrace_queues *queues);
  360. int auxtrace_queues__process_index(struct auxtrace_queues *queues,
  361. struct perf_session *session);
  362. struct auxtrace_buffer *auxtrace_buffer__next(struct auxtrace_queue *queue,
  363. struct auxtrace_buffer *buffer);
  364. void *auxtrace_buffer__get_data(struct auxtrace_buffer *buffer, int fd);
  365. void auxtrace_buffer__put_data(struct auxtrace_buffer *buffer);
  366. void auxtrace_buffer__drop_data(struct auxtrace_buffer *buffer);
  367. void auxtrace_buffer__free(struct auxtrace_buffer *buffer);
  368. int auxtrace_heap__add(struct auxtrace_heap *heap, unsigned int queue_nr,
  369. u64 ordinal);
  370. void auxtrace_heap__pop(struct auxtrace_heap *heap);
  371. void auxtrace_heap__free(struct auxtrace_heap *heap);
  372. struct auxtrace_cache_entry {
  373. struct hlist_node hash;
  374. u32 key;
  375. };
  376. struct auxtrace_cache *auxtrace_cache__new(unsigned int bits, size_t entry_size,
  377. unsigned int limit_percent);
  378. void auxtrace_cache__free(struct auxtrace_cache *auxtrace_cache);
  379. void *auxtrace_cache__alloc_entry(struct auxtrace_cache *c);
  380. void auxtrace_cache__free_entry(struct auxtrace_cache *c, void *entry);
  381. int auxtrace_cache__add(struct auxtrace_cache *c, u32 key,
  382. struct auxtrace_cache_entry *entry);
  383. void *auxtrace_cache__lookup(struct auxtrace_cache *c, u32 key);
  384. struct auxtrace_record *auxtrace_record__init(struct perf_evlist *evlist,
  385. int *err);
  386. int auxtrace_parse_snapshot_options(struct auxtrace_record *itr,
  387. struct record_opts *opts,
  388. const char *str);
  389. int auxtrace_record__options(struct auxtrace_record *itr,
  390. struct perf_evlist *evlist,
  391. struct record_opts *opts);
  392. size_t auxtrace_record__info_priv_size(struct auxtrace_record *itr);
  393. int auxtrace_record__info_fill(struct auxtrace_record *itr,
  394. struct perf_session *session,
  395. struct auxtrace_info_event *auxtrace_info,
  396. size_t priv_size);
  397. void auxtrace_record__free(struct auxtrace_record *itr);
  398. int auxtrace_record__snapshot_start(struct auxtrace_record *itr);
  399. int auxtrace_record__snapshot_finish(struct auxtrace_record *itr);
  400. int auxtrace_record__find_snapshot(struct auxtrace_record *itr, int idx,
  401. struct auxtrace_mmap *mm,
  402. unsigned char *data, u64 *head, u64 *old);
  403. u64 auxtrace_record__reference(struct auxtrace_record *itr);
  404. int auxtrace_index__auxtrace_event(struct list_head *head, union perf_event *event,
  405. off_t file_offset);
  406. int auxtrace_index__write(int fd, struct list_head *head);
  407. int auxtrace_index__process(int fd, u64 size, struct perf_session *session,
  408. bool needs_swap);
  409. void auxtrace_index__free(struct list_head *head);
  410. void auxtrace_synth_error(struct auxtrace_error_event *auxtrace_error, int type,
  411. int code, int cpu, pid_t pid, pid_t tid, u64 ip,
  412. const char *msg);
  413. int perf_event__synthesize_auxtrace_info(struct auxtrace_record *itr,
  414. struct perf_tool *tool,
  415. struct perf_session *session,
  416. perf_event__handler_t process);
  417. int perf_event__process_auxtrace_info(struct perf_tool *tool,
  418. union perf_event *event,
  419. struct perf_session *session);
  420. s64 perf_event__process_auxtrace(struct perf_tool *tool,
  421. union perf_event *event,
  422. struct perf_session *session);
  423. int perf_event__process_auxtrace_error(struct perf_tool *tool,
  424. union perf_event *event,
  425. struct perf_session *session);
  426. int itrace_parse_synth_opts(const struct option *opt, const char *str,
  427. int unset);
  428. void itrace_synth_opts__set_default(struct itrace_synth_opts *synth_opts);
  429. size_t perf_event__fprintf_auxtrace_error(union perf_event *event, FILE *fp);
  430. void perf_session__auxtrace_error_inc(struct perf_session *session,
  431. union perf_event *event);
  432. void events_stats__auxtrace_error_warn(const struct events_stats *stats);
  433. static inline int auxtrace__process_event(struct perf_session *session,
  434. union perf_event *event,
  435. struct perf_sample *sample,
  436. struct perf_tool *tool)
  437. {
  438. if (!session->auxtrace)
  439. return 0;
  440. return session->auxtrace->process_event(session, event, sample, tool);
  441. }
  442. static inline int auxtrace__flush_events(struct perf_session *session,
  443. struct perf_tool *tool)
  444. {
  445. if (!session->auxtrace)
  446. return 0;
  447. return session->auxtrace->flush_events(session, tool);
  448. }
  449. static inline void auxtrace__free_events(struct perf_session *session)
  450. {
  451. if (!session->auxtrace)
  452. return;
  453. return session->auxtrace->free_events(session);
  454. }
  455. static inline void auxtrace__free(struct perf_session *session)
  456. {
  457. if (!session->auxtrace)
  458. return;
  459. return session->auxtrace->free(session);
  460. }
  461. #else
  462. static inline struct auxtrace_record *
  463. auxtrace_record__init(struct perf_evlist *evlist __maybe_unused,
  464. int *err __maybe_unused)
  465. {
  466. *err = 0;
  467. return NULL;
  468. }
  469. static inline
  470. void auxtrace_record__free(struct auxtrace_record *itr __maybe_unused)
  471. {
  472. }
  473. static inline int
  474. perf_event__synthesize_auxtrace_info(struct auxtrace_record *itr __maybe_unused,
  475. struct perf_tool *tool __maybe_unused,
  476. struct perf_session *session __maybe_unused,
  477. perf_event__handler_t process __maybe_unused)
  478. {
  479. return -EINVAL;
  480. }
  481. static inline
  482. int auxtrace_record__options(struct auxtrace_record *itr __maybe_unused,
  483. struct perf_evlist *evlist __maybe_unused,
  484. struct record_opts *opts __maybe_unused)
  485. {
  486. return 0;
  487. }
  488. #define perf_event__process_auxtrace_info 0
  489. #define perf_event__process_auxtrace 0
  490. #define perf_event__process_auxtrace_error 0
  491. static inline
  492. void perf_session__auxtrace_error_inc(struct perf_session *session
  493. __maybe_unused,
  494. union perf_event *event
  495. __maybe_unused)
  496. {
  497. }
  498. static inline
  499. void events_stats__auxtrace_error_warn(const struct events_stats *stats
  500. __maybe_unused)
  501. {
  502. }
  503. static inline
  504. int itrace_parse_synth_opts(const struct option *opt __maybe_unused,
  505. const char *str __maybe_unused,
  506. int unset __maybe_unused)
  507. {
  508. pr_err("AUX area tracing not supported\n");
  509. return -EINVAL;
  510. }
  511. static inline
  512. int auxtrace_parse_snapshot_options(struct auxtrace_record *itr __maybe_unused,
  513. struct record_opts *opts __maybe_unused,
  514. const char *str)
  515. {
  516. if (!str)
  517. return 0;
  518. pr_err("AUX area tracing not supported\n");
  519. return -EINVAL;
  520. }
  521. static inline
  522. int auxtrace__process_event(struct perf_session *session __maybe_unused,
  523. union perf_event *event __maybe_unused,
  524. struct perf_sample *sample __maybe_unused,
  525. struct perf_tool *tool __maybe_unused)
  526. {
  527. return 0;
  528. }
  529. static inline
  530. int auxtrace__flush_events(struct perf_session *session __maybe_unused,
  531. struct perf_tool *tool __maybe_unused)
  532. {
  533. return 0;
  534. }
  535. static inline
  536. void auxtrace__free_events(struct perf_session *session __maybe_unused)
  537. {
  538. }
  539. static inline
  540. void auxtrace_cache__free(struct auxtrace_cache *auxtrace_cache __maybe_unused)
  541. {
  542. }
  543. static inline
  544. void auxtrace__free(struct perf_session *session __maybe_unused)
  545. {
  546. }
  547. static inline
  548. int auxtrace_index__write(int fd __maybe_unused,
  549. struct list_head *head __maybe_unused)
  550. {
  551. return -EINVAL;
  552. }
  553. static inline
  554. int auxtrace_index__process(int fd __maybe_unused,
  555. u64 size __maybe_unused,
  556. struct perf_session *session __maybe_unused,
  557. bool needs_swap __maybe_unused)
  558. {
  559. return -EINVAL;
  560. }
  561. static inline
  562. void auxtrace_index__free(struct list_head *head __maybe_unused)
  563. {
  564. }
  565. int auxtrace_mmap__mmap(struct auxtrace_mmap *mm,
  566. struct auxtrace_mmap_params *mp,
  567. void *userpg, int fd);
  568. void auxtrace_mmap__munmap(struct auxtrace_mmap *mm);
  569. void auxtrace_mmap_params__init(struct auxtrace_mmap_params *mp,
  570. off_t auxtrace_offset,
  571. unsigned int auxtrace_pages,
  572. bool auxtrace_overwrite);
  573. void auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp,
  574. struct perf_evlist *evlist, int idx,
  575. bool per_cpu);
  576. #endif
  577. #endif