2 * LTT core in-kernel infrastructure.
4 * Copyright 2006 - Mathieu Desnoyers mathieu.desnoyers@polymtl.ca
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.
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.
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
21 #include <ust/kernelcompat.h>
22 #include "tracercore.h"
24 /* Traces structures */
25 struct ltt_traces ltt_traces
= {
26 .setup_head
= LIST_HEAD_INIT(ltt_traces
.setup_head
),
27 .head
= LIST_HEAD_INIT(ltt_traces
.head
),
30 /* Traces list writer locking */
31 static DEFINE_MUTEX(ltt_traces_mutex
);
33 void ltt_lock_traces(void)
35 mutex_lock(<t_traces_mutex
);
38 void ltt_unlock_traces(void)
40 mutex_unlock(<t_traces_mutex
);
43 //ust// DEFINE_PER_CPU(unsigned int, ltt_nesting);
44 //ust// EXPORT_PER_CPU_SYMBOL(ltt_nesting);
45 __thread
int ltt_nesting
;
47 int ltt_run_filter_default(void *trace
, uint16_t eID
)
52 /* This function pointer is protected by a trace activation check */
53 ltt_run_filter_functor ltt_run_filter
= ltt_run_filter_default
;
55 void ltt_filter_register(ltt_run_filter_functor func
)
57 ltt_run_filter
= func
;
60 void ltt_filter_unregister(void)
62 ltt_run_filter
= ltt_run_filter_default
;