0001
0002
0003
0004
0005
0006
0007 #ifndef __PERF_AUXTRACE_H
0008 #define __PERF_AUXTRACE_H
0009
0010 #include <sys/types.h>
0011 #include <errno.h>
0012 #include <stdbool.h>
0013 #include <stddef.h>
0014 #include <stdio.h> // FILE
0015 #include <linux/list.h>
0016 #include <linux/perf_event.h>
0017 #include <linux/types.h>
0018 #include <internal/cpumap.h>
0019 #include <asm/bitsperlong.h>
0020 #include <asm/barrier.h>
0021
0022 union perf_event;
0023 struct perf_session;
0024 struct evlist;
0025 struct evsel;
0026 struct perf_tool;
0027 struct mmap;
0028 struct perf_sample;
0029 struct option;
0030 struct record_opts;
0031 struct perf_record_auxtrace_error;
0032 struct perf_record_auxtrace_info;
0033 struct events_stats;
0034 struct perf_pmu;
0035
0036 enum auxtrace_error_type {
0037 PERF_AUXTRACE_ERROR_ITRACE = 1,
0038 PERF_AUXTRACE_ERROR_MAX
0039 };
0040
0041
0042 #define PERF_AUXTRACE_RECORD_ALIGNMENT 8
0043
0044 enum auxtrace_type {
0045 PERF_AUXTRACE_UNKNOWN,
0046 PERF_AUXTRACE_INTEL_PT,
0047 PERF_AUXTRACE_INTEL_BTS,
0048 PERF_AUXTRACE_CS_ETM,
0049 PERF_AUXTRACE_ARM_SPE,
0050 PERF_AUXTRACE_S390_CPUMSF,
0051 };
0052
0053 enum itrace_period_type {
0054 PERF_ITRACE_PERIOD_INSTRUCTIONS,
0055 PERF_ITRACE_PERIOD_TICKS,
0056 PERF_ITRACE_PERIOD_NANOSECS,
0057 };
0058
0059 #define AUXTRACE_ERR_FLG_OVERFLOW (1 << ('o' - 'a'))
0060 #define AUXTRACE_ERR_FLG_DATA_LOST (1 << ('l' - 'a'))
0061
0062 #define AUXTRACE_LOG_FLG_ALL_PERF_EVTS (1 << ('a' - 'a'))
0063 #define AUXTRACE_LOG_FLG_USE_STDOUT (1 << ('o' - 'a'))
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114 struct itrace_synth_opts {
0115 bool set;
0116 bool default_no_sample;
0117 bool inject;
0118 bool instructions;
0119 bool branches;
0120 bool transactions;
0121 bool ptwrites;
0122 bool pwr_events;
0123 bool other_events;
0124 bool intr_events;
0125 bool errors;
0126 bool dont_decode;
0127 bool log;
0128 bool calls;
0129 bool returns;
0130 bool callchain;
0131 bool add_callchain;
0132 bool thread_stack;
0133 bool last_branch;
0134 bool add_last_branch;
0135 bool approx_ipc;
0136 bool flc;
0137 bool llc;
0138 bool tlb;
0139 bool remote_access;
0140 bool mem;
0141 bool timeless_decoding;
0142 bool vm_time_correlation;
0143 bool vm_tm_corr_dry_run;
0144 char *vm_tm_corr_args;
0145 unsigned int callchain_sz;
0146 unsigned int last_branch_sz;
0147 unsigned long long period;
0148 enum itrace_period_type period_type;
0149 unsigned long initial_skip;
0150 unsigned long *cpu_bitmap;
0151 struct perf_time_interval *ptime_range;
0152 int range_num;
0153 unsigned int error_plus_flags;
0154 unsigned int error_minus_flags;
0155 unsigned int log_plus_flags;
0156 unsigned int log_minus_flags;
0157 unsigned int quick;
0158 };
0159
0160
0161
0162
0163
0164
0165
0166 struct auxtrace_index_entry {
0167 u64 file_offset;
0168 u64 sz;
0169 };
0170
0171 #define PERF_AUXTRACE_INDEX_ENTRY_COUNT 256
0172
0173
0174
0175
0176
0177
0178
0179
0180 struct auxtrace_index {
0181 struct list_head list;
0182 size_t nr;
0183 struct auxtrace_index_entry entries[PERF_AUXTRACE_INDEX_ENTRY_COUNT];
0184 };
0185
0186
0187
0188
0189
0190
0191
0192
0193
0194
0195
0196
0197 struct auxtrace {
0198 int (*process_event)(struct perf_session *session,
0199 union perf_event *event,
0200 struct perf_sample *sample,
0201 struct perf_tool *tool);
0202 int (*process_auxtrace_event)(struct perf_session *session,
0203 union perf_event *event,
0204 struct perf_tool *tool);
0205 int (*queue_data)(struct perf_session *session,
0206 struct perf_sample *sample, union perf_event *event,
0207 u64 data_offset);
0208 void (*dump_auxtrace_sample)(struct perf_session *session,
0209 struct perf_sample *sample);
0210 int (*flush_events)(struct perf_session *session,
0211 struct perf_tool *tool);
0212 void (*free_events)(struct perf_session *session);
0213 void (*free)(struct perf_session *session);
0214 bool (*evsel_is_auxtrace)(struct perf_session *session,
0215 struct evsel *evsel);
0216 };
0217
0218
0219
0220
0221
0222
0223
0224
0225
0226
0227
0228
0229
0230
0231
0232
0233
0234
0235
0236
0237
0238
0239
0240
0241 struct auxtrace_buffer {
0242 struct list_head list;
0243 size_t size;
0244 pid_t pid;
0245 pid_t tid;
0246 struct perf_cpu cpu;
0247 void *data;
0248 off_t data_offset;
0249 void *mmap_addr;
0250 size_t mmap_size;
0251 bool data_needs_freeing;
0252 bool consecutive;
0253 u64 offset;
0254 u64 reference;
0255 u64 buffer_nr;
0256 size_t use_size;
0257 void *use_data;
0258 };
0259
0260
0261
0262
0263
0264
0265
0266
0267
0268 struct auxtrace_queue {
0269 struct list_head head;
0270 pid_t tid;
0271 int cpu;
0272 bool set;
0273 void *priv;
0274 };
0275
0276
0277
0278
0279
0280
0281
0282
0283
0284 struct auxtrace_queues {
0285 struct auxtrace_queue *queue_array;
0286 unsigned int nr_queues;
0287 bool new_data;
0288 bool populated;
0289 u64 next_buffer_nr;
0290 };
0291
0292
0293
0294
0295
0296
0297
0298 struct auxtrace_heap_item {
0299 unsigned int queue_nr;
0300 u64 ordinal;
0301 };
0302
0303
0304
0305
0306
0307
0308
0309 struct auxtrace_heap {
0310 struct auxtrace_heap_item *heap_array;
0311 unsigned int heap_cnt;
0312 unsigned int heap_sz;
0313 };
0314
0315
0316
0317
0318
0319
0320
0321
0322
0323
0324
0325
0326
0327 struct auxtrace_mmap {
0328 void *base;
0329 void *userpg;
0330 size_t mask;
0331 size_t len;
0332 u64 prev;
0333 int idx;
0334 pid_t tid;
0335 int cpu;
0336 };
0337
0338
0339
0340
0341
0342
0343
0344
0345
0346
0347
0348
0349
0350
0351
0352
0353 struct auxtrace_mmap_params {
0354 size_t mask;
0355 off_t offset;
0356 size_t len;
0357 int prot;
0358 int idx;
0359 pid_t tid;
0360 bool mmap_needed;
0361 struct perf_cpu cpu;
0362 };
0363
0364
0365
0366
0367
0368
0369
0370
0371
0372
0373
0374
0375
0376
0377
0378
0379
0380
0381 struct auxtrace_record {
0382 int (*recording_options)(struct auxtrace_record *itr,
0383 struct evlist *evlist,
0384 struct record_opts *opts);
0385 size_t (*info_priv_size)(struct auxtrace_record *itr,
0386 struct evlist *evlist);
0387 int (*info_fill)(struct auxtrace_record *itr,
0388 struct perf_session *session,
0389 struct perf_record_auxtrace_info *auxtrace_info,
0390 size_t priv_size);
0391 void (*free)(struct auxtrace_record *itr);
0392 int (*snapshot_start)(struct auxtrace_record *itr);
0393 int (*snapshot_finish)(struct auxtrace_record *itr);
0394 int (*find_snapshot)(struct auxtrace_record *itr, int idx,
0395 struct auxtrace_mmap *mm, unsigned char *data,
0396 u64 *head, u64 *old);
0397 int (*parse_snapshot_options)(struct auxtrace_record *itr,
0398 struct record_opts *opts,
0399 const char *str);
0400 u64 (*reference)(struct auxtrace_record *itr);
0401 int (*read_finish)(struct auxtrace_record *itr, int idx);
0402 unsigned int alignment;
0403 unsigned int default_aux_sample_size;
0404 struct perf_pmu *pmu;
0405 struct evlist *evlist;
0406 };
0407
0408
0409
0410
0411
0412
0413
0414
0415
0416
0417
0418
0419
0420
0421
0422
0423
0424
0425 struct addr_filter {
0426 struct list_head list;
0427 bool range;
0428 bool start;
0429 const char *action;
0430 const char *sym_from;
0431 const char *sym_to;
0432 int sym_from_idx;
0433 int sym_to_idx;
0434 u64 addr;
0435 u64 size;
0436 const char *filename;
0437 char *str;
0438 };
0439
0440
0441
0442
0443
0444
0445 struct addr_filters {
0446 struct list_head head;
0447 int cnt;
0448 };
0449
0450 struct auxtrace_cache;
0451
0452 #ifdef HAVE_AUXTRACE_SUPPORT
0453
0454 u64 compat_auxtrace_mmap__read_head(struct auxtrace_mmap *mm);
0455 int compat_auxtrace_mmap__write_tail(struct auxtrace_mmap *mm, u64 tail);
0456
0457 static inline u64 auxtrace_mmap__read_head(struct auxtrace_mmap *mm,
0458 int kernel_is_64_bit __maybe_unused)
0459 {
0460 struct perf_event_mmap_page *pc = mm->userpg;
0461 u64 head;
0462
0463 #if BITS_PER_LONG == 32
0464 if (kernel_is_64_bit)
0465 return compat_auxtrace_mmap__read_head(mm);
0466 #endif
0467 head = READ_ONCE(pc->aux_head);
0468
0469
0470 smp_rmb();
0471 return head;
0472 }
0473
0474 static inline int auxtrace_mmap__write_tail(struct auxtrace_mmap *mm, u64 tail,
0475 int kernel_is_64_bit __maybe_unused)
0476 {
0477 struct perf_event_mmap_page *pc = mm->userpg;
0478
0479 #if BITS_PER_LONG == 32
0480 if (kernel_is_64_bit)
0481 return compat_auxtrace_mmap__write_tail(mm, tail);
0482 #endif
0483
0484 smp_mb();
0485 WRITE_ONCE(pc->aux_tail, tail);
0486 return 0;
0487 }
0488
0489 int auxtrace_mmap__mmap(struct auxtrace_mmap *mm,
0490 struct auxtrace_mmap_params *mp,
0491 void *userpg, int fd);
0492 void auxtrace_mmap__munmap(struct auxtrace_mmap *mm);
0493 void auxtrace_mmap_params__init(struct auxtrace_mmap_params *mp,
0494 off_t auxtrace_offset,
0495 unsigned int auxtrace_pages,
0496 bool auxtrace_overwrite);
0497 void auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp,
0498 struct evlist *evlist,
0499 struct evsel *evsel, int idx);
0500
0501 typedef int (*process_auxtrace_t)(struct perf_tool *tool,
0502 struct mmap *map,
0503 union perf_event *event, void *data1,
0504 size_t len1, void *data2, size_t len2);
0505
0506 int auxtrace_mmap__read(struct mmap *map, struct auxtrace_record *itr,
0507 struct perf_tool *tool, process_auxtrace_t fn);
0508
0509 int auxtrace_mmap__read_snapshot(struct mmap *map,
0510 struct auxtrace_record *itr,
0511 struct perf_tool *tool, process_auxtrace_t fn,
0512 size_t snapshot_size);
0513
0514 int auxtrace_queues__init(struct auxtrace_queues *queues);
0515 int auxtrace_queues__add_event(struct auxtrace_queues *queues,
0516 struct perf_session *session,
0517 union perf_event *event, off_t data_offset,
0518 struct auxtrace_buffer **buffer_ptr);
0519 struct auxtrace_queue *
0520 auxtrace_queues__sample_queue(struct auxtrace_queues *queues,
0521 struct perf_sample *sample,
0522 struct perf_session *session);
0523 int auxtrace_queues__add_sample(struct auxtrace_queues *queues,
0524 struct perf_session *session,
0525 struct perf_sample *sample, u64 data_offset,
0526 u64 reference);
0527 void auxtrace_queues__free(struct auxtrace_queues *queues);
0528 int auxtrace_queues__process_index(struct auxtrace_queues *queues,
0529 struct perf_session *session);
0530 int auxtrace_queue_data(struct perf_session *session, bool samples,
0531 bool events);
0532 struct auxtrace_buffer *auxtrace_buffer__next(struct auxtrace_queue *queue,
0533 struct auxtrace_buffer *buffer);
0534 void *auxtrace_buffer__get_data_rw(struct auxtrace_buffer *buffer, int fd, bool rw);
0535 static inline void *auxtrace_buffer__get_data(struct auxtrace_buffer *buffer, int fd)
0536 {
0537 return auxtrace_buffer__get_data_rw(buffer, fd, false);
0538 }
0539 void auxtrace_buffer__put_data(struct auxtrace_buffer *buffer);
0540 void auxtrace_buffer__drop_data(struct auxtrace_buffer *buffer);
0541 void auxtrace_buffer__free(struct auxtrace_buffer *buffer);
0542
0543 int auxtrace_heap__add(struct auxtrace_heap *heap, unsigned int queue_nr,
0544 u64 ordinal);
0545 void auxtrace_heap__pop(struct auxtrace_heap *heap);
0546 void auxtrace_heap__free(struct auxtrace_heap *heap);
0547
0548 struct auxtrace_cache_entry {
0549 struct hlist_node hash;
0550 u32 key;
0551 };
0552
0553 struct auxtrace_cache *auxtrace_cache__new(unsigned int bits, size_t entry_size,
0554 unsigned int limit_percent);
0555 void auxtrace_cache__free(struct auxtrace_cache *auxtrace_cache);
0556 void *auxtrace_cache__alloc_entry(struct auxtrace_cache *c);
0557 void auxtrace_cache__free_entry(struct auxtrace_cache *c, void *entry);
0558 int auxtrace_cache__add(struct auxtrace_cache *c, u32 key,
0559 struct auxtrace_cache_entry *entry);
0560 void auxtrace_cache__remove(struct auxtrace_cache *c, u32 key);
0561 void *auxtrace_cache__lookup(struct auxtrace_cache *c, u32 key);
0562
0563 struct auxtrace_record *auxtrace_record__init(struct evlist *evlist,
0564 int *err);
0565
0566 int auxtrace_parse_snapshot_options(struct auxtrace_record *itr,
0567 struct record_opts *opts,
0568 const char *str);
0569 int auxtrace_parse_sample_options(struct auxtrace_record *itr,
0570 struct evlist *evlist,
0571 struct record_opts *opts, const char *str);
0572 void auxtrace_regroup_aux_output(struct evlist *evlist);
0573 int auxtrace_record__options(struct auxtrace_record *itr,
0574 struct evlist *evlist,
0575 struct record_opts *opts);
0576 size_t auxtrace_record__info_priv_size(struct auxtrace_record *itr,
0577 struct evlist *evlist);
0578 int auxtrace_record__info_fill(struct auxtrace_record *itr,
0579 struct perf_session *session,
0580 struct perf_record_auxtrace_info *auxtrace_info,
0581 size_t priv_size);
0582 void auxtrace_record__free(struct auxtrace_record *itr);
0583 int auxtrace_record__snapshot_start(struct auxtrace_record *itr);
0584 int auxtrace_record__snapshot_finish(struct auxtrace_record *itr, bool on_exit);
0585 int auxtrace_record__find_snapshot(struct auxtrace_record *itr, int idx,
0586 struct auxtrace_mmap *mm,
0587 unsigned char *data, u64 *head, u64 *old);
0588 u64 auxtrace_record__reference(struct auxtrace_record *itr);
0589 int auxtrace_record__read_finish(struct auxtrace_record *itr, int idx);
0590
0591 int auxtrace_index__auxtrace_event(struct list_head *head, union perf_event *event,
0592 off_t file_offset);
0593 int auxtrace_index__write(int fd, struct list_head *head);
0594 int auxtrace_index__process(int fd, u64 size, struct perf_session *session,
0595 bool needs_swap);
0596 void auxtrace_index__free(struct list_head *head);
0597
0598 void auxtrace_synth_guest_error(struct perf_record_auxtrace_error *auxtrace_error, int type,
0599 int code, int cpu, pid_t pid, pid_t tid, u64 ip,
0600 const char *msg, u64 timestamp,
0601 pid_t machine_pid, int vcpu);
0602 void auxtrace_synth_error(struct perf_record_auxtrace_error *auxtrace_error, int type,
0603 int code, int cpu, pid_t pid, pid_t tid, u64 ip,
0604 const char *msg, u64 timestamp);
0605
0606 int perf_event__process_auxtrace_info(struct perf_session *session,
0607 union perf_event *event);
0608 s64 perf_event__process_auxtrace(struct perf_session *session,
0609 union perf_event *event);
0610 int perf_event__process_auxtrace_error(struct perf_session *session,
0611 union perf_event *event);
0612 int itrace_do_parse_synth_opts(struct itrace_synth_opts *synth_opts,
0613 const char *str, int unset);
0614 int itrace_parse_synth_opts(const struct option *opt, const char *str,
0615 int unset);
0616 void itrace_synth_opts__set_default(struct itrace_synth_opts *synth_opts,
0617 bool no_sample);
0618
0619 size_t perf_event__fprintf_auxtrace_error(union perf_event *event, FILE *fp);
0620 void perf_session__auxtrace_error_inc(struct perf_session *session,
0621 union perf_event *event);
0622 void events_stats__auxtrace_error_warn(const struct events_stats *stats);
0623
0624 void addr_filters__init(struct addr_filters *filts);
0625 void addr_filters__exit(struct addr_filters *filts);
0626 int addr_filters__parse_bare_filter(struct addr_filters *filts,
0627 const char *filter);
0628 int auxtrace_parse_filters(struct evlist *evlist);
0629
0630 int auxtrace__process_event(struct perf_session *session, union perf_event *event,
0631 struct perf_sample *sample, struct perf_tool *tool);
0632 void auxtrace__dump_auxtrace_sample(struct perf_session *session,
0633 struct perf_sample *sample);
0634 int auxtrace__flush_events(struct perf_session *session, struct perf_tool *tool);
0635 void auxtrace__free_events(struct perf_session *session);
0636 void auxtrace__free(struct perf_session *session);
0637 bool auxtrace__evsel_is_auxtrace(struct perf_session *session,
0638 struct evsel *evsel);
0639
0640 #define ITRACE_HELP \
0641 " i[period]: synthesize instructions events\n" \
0642 " b: synthesize branches events (branch misses for Arm SPE)\n" \
0643 " c: synthesize branches events (calls only)\n" \
0644 " r: synthesize branches events (returns only)\n" \
0645 " x: synthesize transactions events\n" \
0646 " w: synthesize ptwrite events\n" \
0647 " p: synthesize power events\n" \
0648 " o: synthesize other events recorded due to the use\n" \
0649 " of aux-output (refer to perf record)\n" \
0650 " I: synthesize interrupt or similar (asynchronous) events\n" \
0651 " (e.g. Intel PT Event Trace)\n" \
0652 " e[flags]: synthesize error events\n" \
0653 " each flag must be preceded by + or -\n" \
0654 " error flags are: o (overflow)\n" \
0655 " l (data lost)\n" \
0656 " d[flags]: create a debug log\n" \
0657 " each flag must be preceded by + or -\n" \
0658 " log flags are: a (all perf events)\n" \
0659 " o (output to stdout)\n" \
0660 " f: synthesize first level cache events\n" \
0661 " m: synthesize last level cache events\n" \
0662 " t: synthesize TLB events\n" \
0663 " a: synthesize remote access events\n" \
0664 " g[len]: synthesize a call chain (use with i or x)\n" \
0665 " G[len]: synthesize a call chain on existing event records\n" \
0666 " l[len]: synthesize last branch entries (use with i or x)\n" \
0667 " L[len]: synthesize last branch entries on existing event records\n" \
0668 " sNUMBER: skip initial number of events\n" \
0669 " q: quicker (less detailed) decoding\n" \
0670 " A: approximate IPC\n" \
0671 " Z: prefer to ignore timestamps (so-called \"timeless\" decoding)\n" \
0672 " PERIOD[ns|us|ms|i|t]: specify period to sample stream\n" \
0673 " concatenate multiple options. Default is ibxwpe or cewp\n"
0674
0675 static inline
0676 void itrace_synth_opts__set_time_range(struct itrace_synth_opts *opts,
0677 struct perf_time_interval *ptime_range,
0678 int range_num)
0679 {
0680 opts->ptime_range = ptime_range;
0681 opts->range_num = range_num;
0682 }
0683
0684 static inline
0685 void itrace_synth_opts__clear_time_range(struct itrace_synth_opts *opts)
0686 {
0687 opts->ptime_range = NULL;
0688 opts->range_num = 0;
0689 }
0690
0691 #else
0692 #include "debug.h"
0693
0694 static inline struct auxtrace_record *
0695 auxtrace_record__init(struct evlist *evlist __maybe_unused,
0696 int *err)
0697 {
0698 *err = 0;
0699 return NULL;
0700 }
0701
0702 static inline
0703 void auxtrace_record__free(struct auxtrace_record *itr __maybe_unused)
0704 {
0705 }
0706
0707 static inline
0708 int auxtrace_record__options(struct auxtrace_record *itr __maybe_unused,
0709 struct evlist *evlist __maybe_unused,
0710 struct record_opts *opts __maybe_unused)
0711 {
0712 return 0;
0713 }
0714
0715 static inline
0716 int perf_event__process_auxtrace_info(struct perf_session *session __maybe_unused,
0717 union perf_event *event __maybe_unused)
0718 {
0719 return 0;
0720 }
0721
0722 static inline
0723 s64 perf_event__process_auxtrace(struct perf_session *session __maybe_unused,
0724 union perf_event *event __maybe_unused)
0725 {
0726 return 0;
0727 }
0728
0729 static inline
0730 int perf_event__process_auxtrace_error(struct perf_session *session __maybe_unused,
0731 union perf_event *event __maybe_unused)
0732 {
0733 return 0;
0734 }
0735
0736 static inline
0737 void perf_session__auxtrace_error_inc(struct perf_session *session
0738 __maybe_unused,
0739 union perf_event *event
0740 __maybe_unused)
0741 {
0742 }
0743
0744 static inline
0745 void events_stats__auxtrace_error_warn(const struct events_stats *stats
0746 __maybe_unused)
0747 {
0748 }
0749
0750 static inline
0751 int itrace_do_parse_synth_opts(struct itrace_synth_opts *synth_opts __maybe_unused,
0752 const char *str __maybe_unused, int unset __maybe_unused)
0753 {
0754 pr_err("AUX area tracing not supported\n");
0755 return -EINVAL;
0756 }
0757
0758 static inline
0759 int itrace_parse_synth_opts(const struct option *opt __maybe_unused,
0760 const char *str __maybe_unused,
0761 int unset __maybe_unused)
0762 {
0763 pr_err("AUX area tracing not supported\n");
0764 return -EINVAL;
0765 }
0766
0767 static inline
0768 int auxtrace_parse_snapshot_options(struct auxtrace_record *itr __maybe_unused,
0769 struct record_opts *opts __maybe_unused,
0770 const char *str)
0771 {
0772 if (!str)
0773 return 0;
0774 pr_err("AUX area tracing not supported\n");
0775 return -EINVAL;
0776 }
0777
0778 static inline
0779 int auxtrace_parse_sample_options(struct auxtrace_record *itr __maybe_unused,
0780 struct evlist *evlist __maybe_unused,
0781 struct record_opts *opts __maybe_unused,
0782 const char *str)
0783 {
0784 if (!str)
0785 return 0;
0786 pr_err("AUX area tracing not supported\n");
0787 return -EINVAL;
0788 }
0789
0790 static inline
0791 void auxtrace_regroup_aux_output(struct evlist *evlist __maybe_unused)
0792 {
0793 }
0794
0795 static inline
0796 int auxtrace__process_event(struct perf_session *session __maybe_unused,
0797 union perf_event *event __maybe_unused,
0798 struct perf_sample *sample __maybe_unused,
0799 struct perf_tool *tool __maybe_unused)
0800 {
0801 return 0;
0802 }
0803
0804 static inline
0805 void auxtrace__dump_auxtrace_sample(struct perf_session *session __maybe_unused,
0806 struct perf_sample *sample __maybe_unused)
0807 {
0808 }
0809
0810 static inline
0811 int auxtrace__flush_events(struct perf_session *session __maybe_unused,
0812 struct perf_tool *tool __maybe_unused)
0813 {
0814 return 0;
0815 }
0816
0817 static inline
0818 void auxtrace__free_events(struct perf_session *session __maybe_unused)
0819 {
0820 }
0821
0822 static inline
0823 void auxtrace_cache__free(struct auxtrace_cache *auxtrace_cache __maybe_unused)
0824 {
0825 }
0826
0827 static inline
0828 void auxtrace__free(struct perf_session *session __maybe_unused)
0829 {
0830 }
0831
0832 static inline
0833 int auxtrace_index__write(int fd __maybe_unused,
0834 struct list_head *head __maybe_unused)
0835 {
0836 return -EINVAL;
0837 }
0838
0839 static inline
0840 int auxtrace_index__process(int fd __maybe_unused,
0841 u64 size __maybe_unused,
0842 struct perf_session *session __maybe_unused,
0843 bool needs_swap __maybe_unused)
0844 {
0845 return -EINVAL;
0846 }
0847
0848 static inline
0849 void auxtrace_index__free(struct list_head *head __maybe_unused)
0850 {
0851 }
0852
0853 static inline
0854 bool auxtrace__evsel_is_auxtrace(struct perf_session *session __maybe_unused,
0855 struct evsel *evsel __maybe_unused)
0856 {
0857 return false;
0858 }
0859
0860 static inline
0861 int auxtrace_parse_filters(struct evlist *evlist __maybe_unused)
0862 {
0863 return 0;
0864 }
0865
0866 int auxtrace_mmap__mmap(struct auxtrace_mmap *mm,
0867 struct auxtrace_mmap_params *mp,
0868 void *userpg, int fd);
0869 void auxtrace_mmap__munmap(struct auxtrace_mmap *mm);
0870 void auxtrace_mmap_params__init(struct auxtrace_mmap_params *mp,
0871 off_t auxtrace_offset,
0872 unsigned int auxtrace_pages,
0873 bool auxtrace_overwrite);
0874 void auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp,
0875 struct evlist *evlist,
0876 struct evsel *evsel, int idx);
0877
0878 #define ITRACE_HELP ""
0879
0880 static inline
0881 void itrace_synth_opts__set_time_range(struct itrace_synth_opts *opts
0882 __maybe_unused,
0883 struct perf_time_interval *ptime_range
0884 __maybe_unused,
0885 int range_num __maybe_unused)
0886 {
0887 }
0888
0889 static inline
0890 void itrace_synth_opts__clear_time_range(struct itrace_synth_opts *opts
0891 __maybe_unused)
0892 {
0893 }
0894
0895 #endif
0896
0897 #endif