X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=libust%2Ftracercore.c;h=8d3dad605f0d9d2598a2dc1eae01ddd5e2058e3f;hb=HEAD;hp=3b571f1b99e3f2ef8a9ebcaa8a0a6c056fdd2f3e;hpb=b4512257eb71d0432554047acf6278dc42a15a75;p=ust.git diff --git a/libust/tracercore.c b/libust/tracercore.c index 3b571f1..8d3dad6 100644 --- a/libust/tracercore.c +++ b/libust/tracercore.c @@ -3,54 +3,43 @@ * * Copyright 2006 - Mathieu Desnoyers mathieu.desnoyers@polymtl.ca * - * Distributed under the GPL license + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -//ust// #include -//ust// #include -//ust// #include -//ust// #include -#include "kernelcompat.h" #include "tracercore.h" /* Traces structures */ struct ltt_traces ltt_traces = { - .setup_head = LIST_HEAD_INIT(ltt_traces.setup_head), - .head = LIST_HEAD_INIT(ltt_traces.head), + .setup_head = CDS_LIST_HEAD_INIT(ltt_traces.setup_head), + .head = CDS_LIST_HEAD_INIT(ltt_traces.head), }; -//ust// EXPORT_SYMBOL(ltt_traces); /* Traces list writer locking */ static DEFINE_MUTEX(ltt_traces_mutex); -/* dentry of ltt's root dir */ -//ust// static struct dentry *ltt_root_dentry; -//ust// struct dentry *get_ltt_root(void) -//ust// { -//ust// if (!ltt_root_dentry) { -//ust// ltt_root_dentry = debugfs_create_dir(LTT_ROOT, NULL); -//ust// if (!ltt_root_dentry) -//ust// printk(KERN_ERR "LTT : create ltt root dir failed\n"); -//ust// } -//ust// return ltt_root_dentry; -//ust// } -//ust// EXPORT_SYMBOL_GPL(get_ltt_root); - void ltt_lock_traces(void) { - mutex_lock(<t_traces_mutex); + pthread_mutex_lock(<t_traces_mutex); } -//ust// EXPORT_SYMBOL_GPL(ltt_lock_traces); void ltt_unlock_traces(void) { - mutex_unlock(<t_traces_mutex); + pthread_mutex_unlock(<t_traces_mutex); } -//ust// EXPORT_SYMBOL_GPL(ltt_unlock_traces); -//ust// DEFINE_PER_CPU(unsigned int, ltt_nesting); -//ust// EXPORT_PER_CPU_SYMBOL(ltt_nesting); -unsigned int ltt_nesting; +__thread int ltt_nesting; int ltt_run_filter_default(void *trace, uint16_t eID) { @@ -59,16 +48,13 @@ int ltt_run_filter_default(void *trace, uint16_t eID) /* This function pointer is protected by a trace activation check */ ltt_run_filter_functor ltt_run_filter = ltt_run_filter_default; -//ust// EXPORT_SYMBOL_GPL(ltt_run_filter); void ltt_filter_register(ltt_run_filter_functor func) { ltt_run_filter = func; } -//ust// EXPORT_SYMBOL_GPL(ltt_filter_register); void ltt_filter_unregister(void) { ltt_run_filter = ltt_run_filter_default; } -//ust// EXPORT_SYMBOL_GPL(ltt_filter_unregister);