auxtrace.h (6b652de2b27c0a4020ce0e8f277e782b6af76096) auxtrace.h (1b36c03e356936d62abbe2accaae1573d3b66f14)
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 *

--- 304 unchanged lines hidden (view full) ---

313 int (*parse_snapshot_options)(struct auxtrace_record *itr,
314 struct record_opts *opts,
315 const char *str);
316 u64 (*reference)(struct auxtrace_record *itr);
317 int (*read_finish)(struct auxtrace_record *itr, int idx);
318 unsigned int alignment;
319};
320
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 *

--- 304 unchanged lines hidden (view full) ---

313 int (*parse_snapshot_options)(struct auxtrace_record *itr,
314 struct record_opts *opts,
315 const char *str);
316 u64 (*reference)(struct auxtrace_record *itr);
317 int (*read_finish)(struct auxtrace_record *itr, int idx);
318 unsigned int alignment;
319};
320
321/**
322 * struct addr_filter - address filter.
323 * @list: list node
324 * @range: true if it is a range filter
325 * @start: true if action is 'filter' or 'start'
326 * @action: 'filter', 'start' or 'stop' ('tracestop' is accepted but converted
327 * to 'stop')
328 * @sym_from: symbol name for the filter address
329 * @sym_to: symbol name that determines the filter size
330 * @sym_from_idx: selects n'th from symbols with the same name (0 means global
331 * and less than 0 means symbol must be unique)
332 * @sym_to_idx: same as @sym_from_idx but for @sym_to
333 * @addr: filter address
334 * @size: filter region size (for range filters)
335 * @filename: DSO file name or NULL for the kernel
336 * @str: allocated string that contains the other string members
337 */
338struct addr_filter {
339 struct list_head list;
340 bool range;
341 bool start;
342 const char *action;
343 const char *sym_from;
344 const char *sym_to;
345 int sym_from_idx;
346 int sym_to_idx;
347 u64 addr;
348 u64 size;
349 const char *filename;
350 char *str;
351};
352
353/**
354 * struct addr_filters - list of address filters.
355 * @head: list of address filters
356 * @cnt: number of address filters
357 */
358struct addr_filters {
359 struct list_head head;
360 int cnt;
361};
362
321#ifdef HAVE_AUXTRACE_SUPPORT
322
323/*
324 * In snapshot mode the mmapped page is read-only which makes using
325 * __sync_val_compare_and_swap() problematic. However, snapshot mode expects
326 * the buffer is not updated while the snapshot is made (e.g. Intel PT disables
327 * the event) so there is not a race anyway.
328 */

--- 148 unchanged lines hidden (view full) ---

477 int unset);
478void itrace_synth_opts__set_default(struct itrace_synth_opts *synth_opts);
479
480size_t perf_event__fprintf_auxtrace_error(union perf_event *event, FILE *fp);
481void perf_session__auxtrace_error_inc(struct perf_session *session,
482 union perf_event *event);
483void events_stats__auxtrace_error_warn(const struct events_stats *stats);
484
363#ifdef HAVE_AUXTRACE_SUPPORT
364
365/*
366 * In snapshot mode the mmapped page is read-only which makes using
367 * __sync_val_compare_and_swap() problematic. However, snapshot mode expects
368 * the buffer is not updated while the snapshot is made (e.g. Intel PT disables
369 * the event) so there is not a race anyway.
370 */

--- 148 unchanged lines hidden (view full) ---

519 int unset);
520void itrace_synth_opts__set_default(struct itrace_synth_opts *synth_opts);
521
522size_t perf_event__fprintf_auxtrace_error(union perf_event *event, FILE *fp);
523void perf_session__auxtrace_error_inc(struct perf_session *session,
524 union perf_event *event);
525void events_stats__auxtrace_error_warn(const struct events_stats *stats);
526
527void addr_filters__init(struct addr_filters *filts);
528void addr_filters__exit(struct addr_filters *filts);
529int addr_filters__parse_bare_filter(struct addr_filters *filts,
530 const char *filter);
531int auxtrace_parse_filters(struct perf_evlist *evlist);
532
485static inline int auxtrace__process_event(struct perf_session *session,
486 union perf_event *event,
487 struct perf_sample *sample,
488 struct perf_tool *tool)
489{
490 if (!session->auxtrace)
491 return 0;
492

--- 142 unchanged lines hidden (view full) ---

635 return -EINVAL;
636}
637
638static inline
639void auxtrace_index__free(struct list_head *head __maybe_unused)
640{
641}
642
533static inline int auxtrace__process_event(struct perf_session *session,
534 union perf_event *event,
535 struct perf_sample *sample,
536 struct perf_tool *tool)
537{
538 if (!session->auxtrace)
539 return 0;
540

--- 142 unchanged lines hidden (view full) ---

683 return -EINVAL;
684}
685
686static inline
687void auxtrace_index__free(struct list_head *head __maybe_unused)
688{
689}
690
691static inline
692int auxtrace_parse_filters(struct perf_evlist *evlist __maybe_unused)
693{
694 return 0;
695}
696
643int auxtrace_mmap__mmap(struct auxtrace_mmap *mm,
644 struct auxtrace_mmap_params *mp,
645 void *userpg, int fd);
646void auxtrace_mmap__munmap(struct auxtrace_mmap *mm);
647void auxtrace_mmap_params__init(struct auxtrace_mmap_params *mp,
648 off_t auxtrace_offset,
649 unsigned int auxtrace_pages,
650 bool auxtrace_overwrite);
651void auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp,
652 struct perf_evlist *evlist, int idx,
653 bool per_cpu);
654
655#endif
656
657#endif
697int auxtrace_mmap__mmap(struct auxtrace_mmap *mm,
698 struct auxtrace_mmap_params *mp,
699 void *userpg, int fd);
700void auxtrace_mmap__munmap(struct auxtrace_mmap *mm);
701void auxtrace_mmap_params__init(struct auxtrace_mmap_params *mp,
702 off_t auxtrace_offset,
703 unsigned int auxtrace_pages,
704 bool auxtrace_overwrite);
705void auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp,
706 struct perf_evlist *evlist, int idx,
707 bool per_cpu);
708
709#endif
710
711#endif