| 1 | /* |
| 2 | * Copyright (C) 2005,2006 Mathieu Desnoyers (mathieu.desnoyers@polymtl.ca) |
| 3 | * |
| 4 | * This contains the core definitions for the Linux Trace Toolkit. |
| 5 | * |
| 6 | * Dual LGPL v2.1/GPL v2 license. |
| 7 | */ |
| 8 | |
| 9 | #ifndef LTT_TRACER_CORE_H |
| 10 | #define LTT_TRACER_CORE_H |
| 11 | |
| 12 | #include <linux/list.h> |
| 13 | #include <linux/percpu.h> |
| 14 | #include <linux/ltt-core.h> |
| 15 | |
| 16 | /* ltt's root dir in debugfs */ |
| 17 | #define LTT_ROOT "ltt" |
| 18 | |
| 19 | /* |
| 20 | * All modifications of ltt_traces must be done by ltt-tracer.c, while holding |
| 21 | * the semaphore. Only reading of this information can be done elsewhere, with |
| 22 | * the RCU mechanism : the preemption must be disabled while reading the |
| 23 | * list. |
| 24 | */ |
| 25 | struct ltt_traces { |
| 26 | struct list_head setup_head; /* Pre-allocated traces list */ |
| 27 | struct list_head head; /* Allocated Traces list */ |
| 28 | unsigned int num_active_traces; /* Number of active traces */ |
| 29 | } ____cacheline_aligned; |
| 30 | |
| 31 | extern struct ltt_traces ltt_traces; |
| 32 | |
| 33 | /* |
| 34 | * get dentry of ltt's root dir |
| 35 | */ |
| 36 | struct dentry *get_ltt_root(void); |
| 37 | |
| 38 | void put_ltt_root(void); |
| 39 | |
| 40 | /* Keep track of trap nesting inside LTT */ |
| 41 | DECLARE_PER_CPU(unsigned int, ltt_nesting); |
| 42 | |
| 43 | typedef int (*ltt_run_filter_functor)(void *trace, uint16_t eID); |
| 44 | |
| 45 | extern ltt_run_filter_functor ltt_run_filter; |
| 46 | |
| 47 | extern void ltt_filter_register(ltt_run_filter_functor func); |
| 48 | extern void ltt_filter_unregister(void); |
| 49 | |
| 50 | #endif /* LTT_TRACER_CORE_H */ |