aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_unlikely.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2008-11-12 15:24:24 -0500
committerIngo Molnar <mingo@elte.hu>2008-11-12 16:28:09 -0500
commit9f029e83e968e5661d7be045bbcb620dbb909938 (patch)
tree13beecf2626162dc8a3912c79d58fc91e2193de5 /kernel/trace/trace_unlikely.c
parent2ed84eeb8808cf3c9f039213ca137ffd7d753f0e (diff)
ftrace: rename unlikely iter_ctrl to branch
Impact: rename of iter_ctrl unlikely to branch The unlikely name is ugly. This patch converts the iter_ctrl command "unlikely" and "nounlikely" to "branch" and "nobranch" respectively. It also renames a lot of internal functions to use "branch" instead of "unlikely". Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace_unlikely.c')
-rw-r--r--kernel/trace/trace_unlikely.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/kernel/trace/trace_unlikely.c b/kernel/trace/trace_unlikely.c
index 856eb3b7f694..e5d5969853a3 100644
--- a/kernel/trace/trace_unlikely.c
+++ b/kernel/trace/trace_unlikely.c
@@ -17,16 +17,16 @@
17 17
18#ifdef CONFIG_BRANCH_TRACER 18#ifdef CONFIG_BRANCH_TRACER
19 19
20static int unlikely_tracing_enabled __read_mostly; 20static int branch_tracing_enabled __read_mostly;
21static DEFINE_MUTEX(unlikely_tracing_mutex); 21static DEFINE_MUTEX(branch_tracing_mutex);
22static struct trace_array *unlikely_tracer; 22static struct trace_array *branch_tracer;
23 23
24static void 24static void
25probe_likely_condition(struct ftrace_likely_data *f, int val, int expect) 25probe_likely_condition(struct ftrace_branch_data *f, int val, int expect)
26{ 26{
27 struct trace_array *tr = unlikely_tracer; 27 struct trace_array *tr = branch_tracer;
28 struct ring_buffer_event *event; 28 struct ring_buffer_event *event;
29 struct trace_unlikely *entry; 29 struct trace_branch *entry;
30 unsigned long flags, irq_flags; 30 unsigned long flags, irq_flags;
31 int cpu, pc; 31 int cpu, pc;
32 const char *p; 32 const char *p;
@@ -54,7 +54,7 @@ probe_likely_condition(struct ftrace_likely_data *f, int val, int expect)
54 pc = preempt_count(); 54 pc = preempt_count();
55 entry = ring_buffer_event_data(event); 55 entry = ring_buffer_event_data(event);
56 tracing_generic_entry_update(&entry->ent, flags, pc); 56 tracing_generic_entry_update(&entry->ent, flags, pc);
57 entry->ent.type = TRACE_UNLIKELY; 57 entry->ent.type = TRACE_BRANCH;
58 58
59 /* Strip off the path, only save the file */ 59 /* Strip off the path, only save the file */
60 p = f->file + strlen(f->file); 60 p = f->file + strlen(f->file);
@@ -77,51 +77,51 @@ probe_likely_condition(struct ftrace_likely_data *f, int val, int expect)
77} 77}
78 78
79static inline 79static inline
80void trace_likely_condition(struct ftrace_likely_data *f, int val, int expect) 80void trace_likely_condition(struct ftrace_branch_data *f, int val, int expect)
81{ 81{
82 if (!unlikely_tracing_enabled) 82 if (!branch_tracing_enabled)
83 return; 83 return;
84 84
85 probe_likely_condition(f, val, expect); 85 probe_likely_condition(f, val, expect);
86} 86}
87 87
88int enable_unlikely_tracing(struct trace_array *tr) 88int enable_branch_tracing(struct trace_array *tr)
89{ 89{
90 int ret = 0; 90 int ret = 0;
91 91
92 mutex_lock(&unlikely_tracing_mutex); 92 mutex_lock(&branch_tracing_mutex);
93 unlikely_tracer = tr; 93 branch_tracer = tr;
94 /* 94 /*
95 * Must be seen before enabling. The reader is a condition 95 * Must be seen before enabling. The reader is a condition
96 * where we do not need a matching rmb() 96 * where we do not need a matching rmb()
97 */ 97 */
98 smp_wmb(); 98 smp_wmb();
99 unlikely_tracing_enabled++; 99 branch_tracing_enabled++;
100 mutex_unlock(&unlikely_tracing_mutex); 100 mutex_unlock(&branch_tracing_mutex);
101 101
102 return ret; 102 return ret;
103} 103}
104 104
105void disable_unlikely_tracing(void) 105void disable_branch_tracing(void)
106{ 106{
107 mutex_lock(&unlikely_tracing_mutex); 107 mutex_lock(&branch_tracing_mutex);
108 108
109 if (!unlikely_tracing_enabled) 109 if (!branch_tracing_enabled)
110 goto out_unlock; 110 goto out_unlock;
111 111
112 unlikely_tracing_enabled--; 112 branch_tracing_enabled--;
113 113
114 out_unlock: 114 out_unlock:
115 mutex_unlock(&unlikely_tracing_mutex); 115 mutex_unlock(&branch_tracing_mutex);
116} 116}
117#else 117#else
118static inline 118static inline
119void trace_likely_condition(struct ftrace_likely_data *f, int val, int expect) 119void trace_likely_condition(struct ftrace_branch_data *f, int val, int expect)
120{ 120{
121} 121}
122#endif /* CONFIG_BRANCH_TRACER */ 122#endif /* CONFIG_BRANCH_TRACER */
123 123
124void ftrace_likely_update(struct ftrace_likely_data *f, int val, int expect) 124void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect)
125{ 125{
126 /* 126 /*
127 * I would love to have a trace point here instead, but the 127 * I would love to have a trace point here instead, but the
@@ -148,7 +148,7 @@ static void *
148t_next(struct seq_file *m, void *v, loff_t *pos) 148t_next(struct seq_file *m, void *v, loff_t *pos)
149{ 149{
150 struct ftrace_pointer *f = m->private; 150 struct ftrace_pointer *f = m->private;
151 struct ftrace_likely_data *p = v; 151 struct ftrace_branch_data *p = v;
152 152
153 (*pos)++; 153 (*pos)++;
154 154
@@ -180,7 +180,7 @@ static void t_stop(struct seq_file *m, void *p)
180 180
181static int t_show(struct seq_file *m, void *v) 181static int t_show(struct seq_file *m, void *v)
182{ 182{
183 struct ftrace_likely_data *p = v; 183 struct ftrace_branch_data *p = v;
184 const char *f; 184 const char *f;
185 unsigned long percent; 185 unsigned long percent;
186 186
@@ -252,7 +252,7 @@ static struct ftrace_pointer ftrace_unlikely_pos = {
252 .stop = __stop_unlikely_profile, 252 .stop = __stop_unlikely_profile,
253}; 253};
254 254
255static __init int ftrace_unlikely_init(void) 255static __init int ftrace_branch_init(void)
256{ 256{
257 struct dentry *d_tracer; 257 struct dentry *d_tracer;
258 struct dentry *entry; 258 struct dentry *entry;
@@ -275,4 +275,4 @@ static __init int ftrace_unlikely_init(void)
275 return 0; 275 return 0;
276} 276}
277 277
278device_initcall(ftrace_unlikely_init); 278device_initcall(ftrace_branch_init);