Commit | Line | Data |
---|---|---|
9dad1eb8 PMF |
1 | /* |
2 | * LTT core in-kernel infrastructure. | |
3 | * | |
4 | * Copyright 2006 - Mathieu Desnoyers mathieu.desnoyers@polymtl.ca | |
5 | * | |
6 | * Distributed under the GPL license | |
7 | */ | |
8 | ||
b6bf28ec PMF |
9 | //ust// #include <linux/ltt-core.h> |
10 | //ust// #include <linux/percpu.h> | |
11 | //ust// #include <linux/module.h> | |
12 | //ust// #include <linux/debugfs.h> | |
1ae7f074 | 13 | #include "kernelcompat.h" |
b6bf28ec | 14 | #include "tracercore.h" |
9dad1eb8 PMF |
15 | |
16 | /* Traces structures */ | |
17 | struct ltt_traces ltt_traces = { | |
18 | .setup_head = LIST_HEAD_INIT(ltt_traces.setup_head), | |
19 | .head = LIST_HEAD_INIT(ltt_traces.head), | |
20 | }; | |
b6bf28ec | 21 | //ust// EXPORT_SYMBOL(ltt_traces); |
9dad1eb8 PMF |
22 | |
23 | /* Traces list writer locking */ | |
24 | static DEFINE_MUTEX(ltt_traces_mutex); | |
25 | ||
26 | /* dentry of ltt's root dir */ | |
b6bf28ec PMF |
27 | //ust// static struct dentry *ltt_root_dentry; |
28 | //ust// struct dentry *get_ltt_root(void) | |
29 | //ust// { | |
30 | //ust// if (!ltt_root_dentry) { | |
31 | //ust// ltt_root_dentry = debugfs_create_dir(LTT_ROOT, NULL); | |
32 | //ust// if (!ltt_root_dentry) | |
33 | //ust// printk(KERN_ERR "LTT : create ltt root dir failed\n"); | |
34 | //ust// } | |
35 | //ust// return ltt_root_dentry; | |
36 | //ust// } | |
37 | //ust// EXPORT_SYMBOL_GPL(get_ltt_root); | |
9dad1eb8 PMF |
38 | |
39 | void ltt_lock_traces(void) | |
40 | { | |
41 | mutex_lock(<t_traces_mutex); | |
42 | } | |
b6bf28ec | 43 | //ust// EXPORT_SYMBOL_GPL(ltt_lock_traces); |
9dad1eb8 PMF |
44 | |
45 | void ltt_unlock_traces(void) | |
46 | { | |
47 | mutex_unlock(<t_traces_mutex); | |
48 | } | |
b6bf28ec | 49 | //ust// EXPORT_SYMBOL_GPL(ltt_unlock_traces); |
9dad1eb8 | 50 | |
b6bf28ec PMF |
51 | //ust// DEFINE_PER_CPU(unsigned int, ltt_nesting); |
52 | //ust// EXPORT_PER_CPU_SYMBOL(ltt_nesting); | |
bb07823d | 53 | unsigned int ltt_nesting; |
9dad1eb8 PMF |
54 | |
55 | int ltt_run_filter_default(void *trace, uint16_t eID) | |
56 | { | |
57 | return 1; | |
58 | } | |
59 | ||
60 | /* This function pointer is protected by a trace activation check */ | |
61 | ltt_run_filter_functor ltt_run_filter = ltt_run_filter_default; | |
b6bf28ec | 62 | //ust// EXPORT_SYMBOL_GPL(ltt_run_filter); |
9dad1eb8 PMF |
63 | |
64 | void ltt_filter_register(ltt_run_filter_functor func) | |
65 | { | |
66 | ltt_run_filter = func; | |
67 | } | |
b6bf28ec | 68 | //ust// EXPORT_SYMBOL_GPL(ltt_filter_register); |
9dad1eb8 PMF |
69 | |
70 | void ltt_filter_unregister(void) | |
71 | { | |
72 | ltt_run_filter = ltt_run_filter_default; | |
73 | } | |
b6bf28ec | 74 | //ust// EXPORT_SYMBOL_GPL(ltt_filter_unregister); |