auxtrace.h 20 KB

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