| 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 | * This library is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU Lesser General Public |
| 8 | * License as published by the Free Software Foundation; either |
| 9 | * version 2.1 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This library is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * Lesser General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Lesser General Public |
| 17 | * License along with this library; if not, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 | */ |
| 20 | |
| 21 | #ifndef UST_TRACERCORE_H |
| 22 | #define UST_TRACERCORE_H |
| 23 | |
| 24 | #include <ust/kcompat/kcompat.h> |
| 25 | #include <ust/core.h> |
| 26 | #include <urcu/list.h> |
| 27 | |
| 28 | /* |
| 29 | * All modifications of ltt_traces must be done by ltt-tracer.c, while holding |
| 30 | * the semaphore. Only reading of this information can be done elsewhere, with |
| 31 | * the RCU mechanism : the preemption must be disabled while reading the |
| 32 | * list. |
| 33 | */ |
| 34 | struct ltt_traces { |
| 35 | struct cds_list_head setup_head; /* Pre-allocated traces list */ |
| 36 | struct cds_list_head head; /* Allocated Traces list */ |
| 37 | unsigned int num_active_traces; /* Number of active traces */ |
| 38 | } ____cacheline_aligned; |
| 39 | |
| 40 | extern struct ltt_traces ltt_traces; |
| 41 | |
| 42 | /* Keep track of trap nesting inside LTT */ |
| 43 | extern __thread int ltt_nesting; |
| 44 | |
| 45 | typedef int (*ltt_run_filter_functor)(void *trace, uint16_t eID); |
| 46 | //typedef int (*ltt_run_filter_functor)(void *, __u16); |
| 47 | |
| 48 | extern ltt_run_filter_functor ltt_run_filter; |
| 49 | |
| 50 | extern void ltt_filter_register(ltt_run_filter_functor func); |
| 51 | extern void ltt_filter_unregister(void); |
| 52 | |
| 53 | #endif /* UST_TRACERCORE_H */ |