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> | |
13 | #include "tracercore.h" | |
9dad1eb8 PMF |
14 | |
15 | /* Traces structures */ | |
16 | struct ltt_traces ltt_traces = { | |
17 | .setup_head = LIST_HEAD_INIT(ltt_traces.setup_head), | |
18 | .head = LIST_HEAD_INIT(ltt_traces.head), | |
19 | }; | |
b6bf28ec | 20 | //ust// EXPORT_SYMBOL(ltt_traces); |
9dad1eb8 PMF |
21 | |
22 | /* Traces list writer locking */ | |
23 | static DEFINE_MUTEX(ltt_traces_mutex); | |
24 | ||
25 | /* dentry of ltt's root dir */ | |
b6bf28ec PMF |
26 | //ust// static struct dentry *ltt_root_dentry; |
27 | //ust// struct dentry *get_ltt_root(void) | |
28 | //ust// { | |
29 | //ust// if (!ltt_root_dentry) { | |
30 | //ust// ltt_root_dentry = debugfs_create_dir(LTT_ROOT, NULL); | |
31 | //ust// if (!ltt_root_dentry) | |
32 | //ust// printk(KERN_ERR "LTT : create ltt root dir failed\n"); | |
33 | //ust// } | |
34 | //ust// return ltt_root_dentry; | |
35 | //ust// } | |
36 | //ust// EXPORT_SYMBOL_GPL(get_ltt_root); | |
9dad1eb8 PMF |
37 | |
38 | void ltt_lock_traces(void) | |
39 | { | |
40 | mutex_lock(<t_traces_mutex); | |
41 | } | |
b6bf28ec | 42 | //ust// EXPORT_SYMBOL_GPL(ltt_lock_traces); |
9dad1eb8 PMF |
43 | |
44 | void ltt_unlock_traces(void) | |
45 | { | |
46 | mutex_unlock(<t_traces_mutex); | |
47 | } | |
b6bf28ec | 48 | //ust// EXPORT_SYMBOL_GPL(ltt_unlock_traces); |
9dad1eb8 | 49 | |
b6bf28ec PMF |
50 | //ust// DEFINE_PER_CPU(unsigned int, ltt_nesting); |
51 | //ust// EXPORT_PER_CPU_SYMBOL(ltt_nesting); | |
9dad1eb8 PMF |
52 | |
53 | int ltt_run_filter_default(void *trace, uint16_t eID) | |
54 | { | |
55 | return 1; | |
56 | } | |
57 | ||
58 | /* This function pointer is protected by a trace activation check */ | |
59 | ltt_run_filter_functor ltt_run_filter = ltt_run_filter_default; | |
b6bf28ec | 60 | //ust// EXPORT_SYMBOL_GPL(ltt_run_filter); |
9dad1eb8 PMF |
61 | |
62 | void ltt_filter_register(ltt_run_filter_functor func) | |
63 | { | |
64 | ltt_run_filter = func; | |
65 | } | |
b6bf28ec | 66 | //ust// EXPORT_SYMBOL_GPL(ltt_filter_register); |
9dad1eb8 PMF |
67 | |
68 | void ltt_filter_unregister(void) | |
69 | { | |
70 | ltt_run_filter = ltt_run_filter_default; | |
71 | } | |
b6bf28ec | 72 | //ust// EXPORT_SYMBOL_GPL(ltt_filter_unregister); |