aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2013-07-31 13:31:35 -0400
committerSteven Rostedt <rostedt@goodmis.org>2013-08-21 23:25:06 -0400
commit620a30e97febc8332590376c94ed0e9dba522bc8 (patch)
tree38bde59c3f7f03117d9bf87532ced86074cd7c39 /kernel
parent779c5e379158de3e96112630c543d3c7b37efab9 (diff)
tracing: Don't pass file_operations array to event_create_dir()
Now that event_create_dir() and __trace_add_new_event() always use the same file_operations we can kill these arguments and simplify the code. Link: http://lkml.kernel.org/r/20130731173135.GA31040@redhat.com Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace_events.c46
1 files changed, 12 insertions, 34 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 2ec82734b8a7..4e706a01f1f9 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -1489,12 +1489,7 @@ event_subsystem_dir(struct trace_array *tr, const char *name,
1489} 1489}
1490 1490
1491static int 1491static int
1492event_create_dir(struct dentry *parent, 1492event_create_dir(struct dentry *parent, struct ftrace_event_file *file)
1493 struct ftrace_event_file *file,
1494 const struct file_operations *id,
1495 const struct file_operations *enable,
1496 const struct file_operations *filter,
1497 const struct file_operations *format)
1498{ 1493{
1499 struct ftrace_event_call *call = file->event_call; 1494 struct ftrace_event_call *call = file->event_call;
1500 struct trace_array *tr = file->tr; 1495 struct trace_array *tr = file->tr;
@@ -1522,12 +1517,13 @@ event_create_dir(struct dentry *parent,
1522 1517
1523 if (call->class->reg && !(call->flags & TRACE_EVENT_FL_IGNORE_ENABLE)) 1518 if (call->class->reg && !(call->flags & TRACE_EVENT_FL_IGNORE_ENABLE))
1524 trace_create_file("enable", 0644, file->dir, file, 1519 trace_create_file("enable", 0644, file->dir, file,
1525 enable); 1520 &ftrace_enable_fops);
1526 1521
1527#ifdef CONFIG_PERF_EVENTS 1522#ifdef CONFIG_PERF_EVENTS
1528 if (call->event.type && call->class->reg) 1523 if (call->event.type && call->class->reg)
1529 trace_create_file("id", 0444, file->dir, 1524 trace_create_file("id", 0444, file->dir,
1530 (void *)(long)call->event.type, id); 1525 (void *)(long)call->event.type,
1526 &ftrace_event_id_fops);
1531#endif 1527#endif
1532 1528
1533 /* 1529 /*
@@ -1544,10 +1540,10 @@ event_create_dir(struct dentry *parent,
1544 } 1540 }
1545 } 1541 }
1546 trace_create_file("filter", 0644, file->dir, call, 1542 trace_create_file("filter", 0644, file->dir, call,
1547 filter); 1543 &ftrace_event_filter_fops);
1548 1544
1549 trace_create_file("format", 0444, file->dir, call, 1545 trace_create_file("format", 0444, file->dir, call,
1550 format); 1546 &ftrace_event_format_fops);
1551 1547
1552 return 0; 1548 return 0;
1553} 1549}
@@ -1648,12 +1644,7 @@ trace_create_new_event(struct ftrace_event_call *call,
1648 1644
1649/* Add an event to a trace directory */ 1645/* Add an event to a trace directory */
1650static int 1646static int
1651__trace_add_new_event(struct ftrace_event_call *call, 1647__trace_add_new_event(struct ftrace_event_call *call, struct trace_array *tr)
1652 struct trace_array *tr,
1653 const struct file_operations *id,
1654 const struct file_operations *enable,
1655 const struct file_operations *filter,
1656 const struct file_operations *format)
1657{ 1648{
1658 struct ftrace_event_file *file; 1649 struct ftrace_event_file *file;
1659 1650
@@ -1661,7 +1652,7 @@ __trace_add_new_event(struct ftrace_event_call *call,
1661 if (!file) 1652 if (!file)
1662 return -ENOMEM; 1653 return -ENOMEM;
1663 1654
1664 return event_create_dir(tr->event_dir, file, id, enable, filter, format); 1655 return event_create_dir(tr->event_dir, file);
1665} 1656}
1666 1657
1667/* 1658/*
@@ -1845,11 +1836,7 @@ __trace_add_event_dirs(struct trace_array *tr)
1845 int ret; 1836 int ret;
1846 1837
1847 list_for_each_entry(call, &ftrace_events, list) { 1838 list_for_each_entry(call, &ftrace_events, list) {
1848 ret = __trace_add_new_event(call, tr, 1839 ret = __trace_add_new_event(call, tr);
1849 &ftrace_event_id_fops,
1850 &ftrace_enable_fops,
1851 &ftrace_event_filter_fops,
1852 &ftrace_event_format_fops);
1853 if (ret < 0) 1840 if (ret < 0)
1854 pr_warning("Could not create directory for event %s\n", 1841 pr_warning("Could not create directory for event %s\n",
1855 call->name); 1842 call->name);
@@ -2157,11 +2144,7 @@ __trace_early_add_event_dirs(struct trace_array *tr)
2157 2144
2158 2145
2159 list_for_each_entry(file, &tr->events, list) { 2146 list_for_each_entry(file, &tr->events, list) {
2160 ret = event_create_dir(tr->event_dir, file, 2147 ret = event_create_dir(tr->event_dir, file);
2161 &ftrace_event_id_fops,
2162 &ftrace_enable_fops,
2163 &ftrace_event_filter_fops,
2164 &ftrace_event_format_fops);
2165 if (ret < 0) 2148 if (ret < 0)
2166 pr_warning("Could not create directory for event %s\n", 2149 pr_warning("Could not create directory for event %s\n",
2167 file->event_call->name); 2150 file->event_call->name);
@@ -2206,13 +2189,8 @@ static void __add_event_to_tracers(struct ftrace_event_call *call)
2206{ 2189{
2207 struct trace_array *tr; 2190 struct trace_array *tr;
2208 2191
2209 list_for_each_entry(tr, &ftrace_trace_arrays, list) { 2192 list_for_each_entry(tr, &ftrace_trace_arrays, list)
2210 __trace_add_new_event(call, tr, 2193 __trace_add_new_event(call, tr);
2211 &ftrace_event_id_fops,
2212 &ftrace_enable_fops,
2213 &ftrace_event_filter_fops,
2214 &ftrace_event_format_fops);
2215 }
2216} 2194}
2217 2195
2218static struct notifier_block trace_module_nb = { 2196static struct notifier_block trace_module_nb = {