aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_branch.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/trace_branch.c')
-rw-r--r--kernel/trace/trace_branch.c39
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
264static int tracing_likely_open(struct inode *inode, struct file *file) 264static 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
277static struct file_operations tracing_likely_fops = { 277static 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
283extern unsigned long __start_likely_profile[]; 283extern unsigned long __start_annotated_branch_profile[];
284extern unsigned long __stop_likely_profile[]; 284extern unsigned long __stop_annotated_branch_profile[];
285extern unsigned long __start_unlikely_profile[];
286extern unsigned long __stop_unlikely_profile[];
287 285
288static struct ftrace_pointer ftrace_likely_pos = { 286static 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
293static struct ftrace_pointer ftrace_unlikely_pos = {
294 .start = __start_unlikely_profile,
295 .stop = __stop_unlikely_profile,
296}; 289};
297 290
298static __init int ftrace_branch_init(void) 291static __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}