Update version to 0.16
[ust.git] / libust / tracercore.c
index 3b571f1b99e3f2ef8a9ebcaa8a0a6c056fdd2f3e..8d3dad605f0d9d2598a2dc1eae01ddd5e2058e3f 100644 (file)
@@ -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 <linux/ltt-core.h>
-//ust// #include <linux/percpu.h>
-//ust// #include <linux/module.h>
-//ust// #include <linux/debugfs.h>
-#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(&ltt_traces_mutex);
+       pthread_mutex_lock(&ltt_traces_mutex);
 }
-//ust// EXPORT_SYMBOL_GPL(ltt_lock_traces);
 
 void ltt_unlock_traces(void)
 {
-       mutex_unlock(&ltt_traces_mutex);
+       pthread_mutex_unlock(&ltt_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);
This page took 0.023142 seconds and 4 git commands to generate.