diff options
author | Steven Rostedt <srostedt@redhat.com> | 2008-11-21 00:40:40 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-23 05:39:56 -0500 |
commit | 45b797492a0758e64dff74e9db70e1f65e0603a5 (patch) | |
tree | 75db13ee888a6c7f90c92c17a743bff8ce42d86a /kernel/trace/trace_branch.c | |
parent | 42f565e116e0408b5ddc21a33c4a4d41fd572420 (diff) |
trace: consolidate unlikely and likely profiler
Impact: clean up to make one profiler of like and unlikely tracer
The likely and unlikely profiler prints out the file and line numbers
of the annotated branches that it is profiling. It shows the number
of times it was correct or incorrect in its guess. Having two
different files or sections for that matter to tell us if it was a
likely or unlikely is pretty pointless. We really only care if
it was correct or not.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace_branch.c')
-rw-r--r-- | kernel/trace/trace_branch.c | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/kernel/trace/trace_branch.c b/kernel/trace/trace_branch.c index 23f9b02ce967..21dedc8b50a4 100644 --- a/kernel/trace/trace_branch.c +++ b/kernel/trace/trace_branch.c | |||
@@ -261,7 +261,7 @@ static struct seq_operations tracing_likely_seq_ops = { | |||
261 | .show = t_show, | 261 | .show = t_show, |
262 | }; | 262 | }; |
263 | 263 | ||
264 | static int tracing_likely_open(struct inode *inode, struct file *file) | 264 | static int tracing_branch_open(struct inode *inode, struct file *file) |
265 | { | 265 | { |
266 | int ret; | 266 | int ret; |
267 | 267 | ||
@@ -274,25 +274,18 @@ static int tracing_likely_open(struct inode *inode, struct file *file) | |||
274 | return ret; | 274 | return ret; |
275 | } | 275 | } |
276 | 276 | ||
277 | static struct file_operations tracing_likely_fops = { | 277 | static const struct file_operations tracing_branch_fops = { |
278 | .open = tracing_likely_open, | 278 | .open = tracing_branch_open, |
279 | .read = seq_read, | 279 | .read = seq_read, |
280 | .llseek = seq_lseek, | 280 | .llseek = seq_lseek, |
281 | }; | 281 | }; |
282 | 282 | ||
283 | extern unsigned long __start_likely_profile[]; | 283 | extern unsigned long __start_annotated_branch_profile[]; |
284 | extern unsigned long __stop_likely_profile[]; | 284 | extern unsigned long __stop_annotated_branch_profile[]; |
285 | extern unsigned long __start_unlikely_profile[]; | ||
286 | extern unsigned long __stop_unlikely_profile[]; | ||
287 | 285 | ||
288 | static struct ftrace_pointer ftrace_likely_pos = { | 286 | static const struct ftrace_pointer ftrace_annotated_branch_pos = { |
289 | .start = __start_likely_profile, | 287 | .start = __start_annotated_branch_profile, |
290 | .stop = __stop_likely_profile, | 288 | .stop = __stop_annotated_branch_profile, |
291 | }; | ||
292 | |||
293 | static struct ftrace_pointer ftrace_unlikely_pos = { | ||
294 | .start = __start_unlikely_profile, | ||
295 | .stop = __stop_unlikely_profile, | ||
296 | }; | 289 | }; |
297 | 290 | ||
298 | static __init int ftrace_branch_init(void) | 291 | static __init int ftrace_branch_init(void) |
@@ -302,18 +295,12 @@ static __init int ftrace_branch_init(void) | |||
302 | 295 | ||
303 | d_tracer = tracing_init_dentry(); | 296 | d_tracer = tracing_init_dentry(); |
304 | 297 | ||
305 | entry = debugfs_create_file("profile_likely", 0444, d_tracer, | 298 | entry = debugfs_create_file("profile_annotated_branch", 0444, d_tracer, |
306 | &ftrace_likely_pos, | 299 | &ftrace_annotated_branch_pos, |
307 | &tracing_likely_fops); | 300 | &tracing_branch_fops); |
308 | if (!entry) | ||
309 | pr_warning("Could not create debugfs 'profile_likely' entry\n"); | ||
310 | |||
311 | entry = debugfs_create_file("profile_unlikely", 0444, d_tracer, | ||
312 | &ftrace_unlikely_pos, | ||
313 | &tracing_likely_fops); | ||
314 | if (!entry) | 301 | if (!entry) |
315 | pr_warning("Could not create debugfs" | 302 | pr_warning("Could not create debugfs " |
316 | " 'profile_unlikely' entry\n"); | 303 | "'profile_annotatet_branch' entry\n"); |
317 | 304 | ||
318 | return 0; | 305 | return 0; |
319 | } | 306 | } |