X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=ltt-core.c;h=fc55bdfffc1d2b2651c4b1fb48469f8c0fa50d13;hb=1c25284c690cd38b71789c4024089d28de21caea;hp=1a0424e95c39bf6ea385662a7dd85f199cc0ea59;hpb=57a13317407af307da09f519799a860f88ae7246;p=lttng-modules.git diff --git a/ltt-core.c b/ltt-core.c index 1a0424e9..fc55bdff 100644 --- a/ltt-core.c +++ b/ltt-core.c @@ -14,79 +14,9 @@ #include "ltt-tracer-core.h" -/* Traces structures */ -struct ltt_traces ltt_traces = { - .setup_head = LIST_HEAD_INIT(ltt_traces.setup_head), - .head = LIST_HEAD_INIT(ltt_traces.head), -}; -EXPORT_SYMBOL(ltt_traces); - -/* Traces list writer locking */ -static DEFINE_MUTEX(ltt_traces_mutex); - -/* root dentry mutex */ -static DEFINE_MUTEX(ltt_root_mutex); -/* dentry of ltt's root dir */ -static struct dentry *ltt_root_dentry; -static struct kref ltt_root_kref = { - .refcount = ATOMIC_INIT(0), -}; - -static void ltt_root_release(struct kref *ref) -{ - debugfs_remove(ltt_root_dentry); - ltt_root_dentry = NULL; -} - -void put_ltt_root(void) -{ - mutex_lock(<t_root_mutex); - if (ltt_root_dentry) - kref_put(<t_root_kref, ltt_root_release); - mutex_unlock(<t_root_mutex); -} -EXPORT_SYMBOL_GPL(put_ltt_root); - -struct dentry *get_ltt_root(void) -{ - mutex_lock(<t_root_mutex); - if (!ltt_root_dentry) { - ltt_root_dentry = debugfs_create_dir(LTT_ROOT, NULL); - if (!ltt_root_dentry) { - printk(KERN_ERR "LTT : create ltt root dir failed\n"); - goto out; - } - kref_init(<t_root_kref); - goto out; - } - kref_get(<t_root_kref); -out: - mutex_unlock(<t_root_mutex); - return ltt_root_dentry; -} -EXPORT_SYMBOL_GPL(get_ltt_root); - -/* - * ltt_lock_traces/ltt_unlock_traces also disables cpu hotplug. - */ -void ltt_lock_traces(void) -{ - mutex_lock(<t_traces_mutex); - get_online_cpus(); -} -EXPORT_SYMBOL_GPL(ltt_lock_traces); - -void ltt_unlock_traces(void) -{ - put_online_cpus(); - mutex_unlock(<t_traces_mutex); -} -EXPORT_SYMBOL_GPL(ltt_unlock_traces); - -DEFINE_PER_CPU(unsigned int, ltt_nesting); -EXPORT_PER_CPU_SYMBOL(ltt_nesting); - -int ltt_run_filter_default(void *trace, uint16_t eID) +int ltt_run_filter_default(struct ltt_session *session, + struct ltt_channel *chan, + struct ltt_event *event) { return 1; }