aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/trace/ftrace.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 71e5faef12ab..a141d8499ab0 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -69,7 +69,7 @@ static DEFINE_MUTEX(ftrace_lock);
69 69
70static struct ftrace_ops ftrace_list_end __read_mostly = 70static struct ftrace_ops ftrace_list_end __read_mostly =
71{ 71{
72 .func = ftrace_stub, 72 .func = ftrace_stub,
73}; 73};
74 74
75static struct ftrace_ops *ftrace_list __read_mostly = &ftrace_list_end; 75static struct ftrace_ops *ftrace_list __read_mostly = &ftrace_list_end;
@@ -271,8 +271,10 @@ struct ftrace_profile_stat {
271#define PROFILES_PER_PAGE \ 271#define PROFILES_PER_PAGE \
272 (PROFILE_RECORDS_SIZE / sizeof(struct ftrace_profile)) 272 (PROFILE_RECORDS_SIZE / sizeof(struct ftrace_profile))
273 273
274static int ftrace_profile_bits; 274static int ftrace_profile_bits __read_mostly;
275static int ftrace_profile_enabled; 275static int ftrace_profile_enabled __read_mostly;
276
277/* ftrace_profile_lock - synchronize the enable and disable of the profiler */
276static DEFINE_MUTEX(ftrace_profile_lock); 278static DEFINE_MUTEX(ftrace_profile_lock);
277 279
278static DEFINE_PER_CPU(struct ftrace_profile_stat, ftrace_profile_stats); 280static DEFINE_PER_CPU(struct ftrace_profile_stat, ftrace_profile_stats);
@@ -651,7 +653,7 @@ static void unregister_ftrace_profiler(void)
651#else 653#else
652static struct ftrace_ops ftrace_profile_ops __read_mostly = 654static struct ftrace_ops ftrace_profile_ops __read_mostly =
653{ 655{
654 .func = function_profile_call, 656 .func = function_profile_call,
655}; 657};
656 658
657static int register_ftrace_profiler(void) 659static int register_ftrace_profiler(void)
@@ -670,7 +672,7 @@ ftrace_profile_write(struct file *filp, const char __user *ubuf,
670 size_t cnt, loff_t *ppos) 672 size_t cnt, loff_t *ppos)
671{ 673{
672 unsigned long val; 674 unsigned long val;
673 char buf[64]; 675 char buf[64]; /* big enough to hold a number */
674 int ret; 676 int ret;
675 677
676 if (cnt >= sizeof(buf)) 678 if (cnt >= sizeof(buf))
@@ -719,7 +721,7 @@ static ssize_t
719ftrace_profile_read(struct file *filp, char __user *ubuf, 721ftrace_profile_read(struct file *filp, char __user *ubuf,
720 size_t cnt, loff_t *ppos) 722 size_t cnt, loff_t *ppos)
721{ 723{
722 char buf[64]; 724 char buf[64]; /* big enough to hold a number */
723 int r; 725 int r;
724 726
725 r = sprintf(buf, "%u\n", ftrace_profile_enabled); 727 r = sprintf(buf, "%u\n", ftrace_profile_enabled);
@@ -734,12 +736,12 @@ static const struct file_operations ftrace_profile_fops = {
734 736
735/* used to initialize the real stat files */ 737/* used to initialize the real stat files */
736static struct tracer_stat function_stats __initdata = { 738static struct tracer_stat function_stats __initdata = {
737 .name = "functions", 739 .name = "functions",
738 .stat_start = function_stat_start, 740 .stat_start = function_stat_start,
739 .stat_next = function_stat_next, 741 .stat_next = function_stat_next,
740 .stat_cmp = function_stat_cmp, 742 .stat_cmp = function_stat_cmp,
741 .stat_headers = function_stat_headers, 743 .stat_headers = function_stat_headers,
742 .stat_show = function_stat_show 744 .stat_show = function_stat_show
743}; 745};
744 746
745static void ftrace_profile_debugfs(struct dentry *d_tracer) 747static void ftrace_profile_debugfs(struct dentry *d_tracer)
@@ -1954,7 +1956,7 @@ function_trace_probe_call(unsigned long ip, unsigned long parent_ip)
1954 1956
1955static struct ftrace_ops trace_probe_ops __read_mostly = 1957static struct ftrace_ops trace_probe_ops __read_mostly =
1956{ 1958{
1957 .func = function_trace_probe_call, 1959 .func = function_trace_probe_call,
1958}; 1960};
1959 1961
1960static int ftrace_probe_registered; 1962static int ftrace_probe_registered;