aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-16 15:23:18 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-16 15:23:18 -0500
commitb29c8306a368cf65782669eba079f81dc861c54d (patch)
tree35d75aa0e671070d4024f11338d3ae89b078b1ed /kernel
parent0bde7294e2ada03d0f1cc61cec51274081d9a9cf (diff)
parent3a81a5210b7d33bb6d836b4c4952a54166a336f3 (diff)
Merge tag 'trace-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing update from Steven Rostedt: "This batch of changes is mostly clean ups and small bug fixes. The only real feature that was added this release is from Namhyung Kim, who introduced "set_graph_notrace" filter that lets you run the function graph tracer and not trace particular functions and their call chain. Tom Zanussi added some updates to the ftrace multibuffer tracing that made it more consistent with the top level tracing. One of the fixes for perf function tracing required an API change in RCU; the addition of "rcu_is_watching()". As Paul McKenney is pushing that change in this release too, he gave me a branch that included all the changes to get that working, and I pulled that into my tree in order to complete the perf function tracing fix" * tag 'trace-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Add rcu annotation for syscall trace descriptors tracing: Do not use signed enums with unsigned long long in fgragh output tracing: Remove unused function ftrace_off_permanent() tracing: Do not assign filp->private_data to freed memory tracing: Add helper function tracing_is_disabled() tracing: Open tracer when ftrace_dump_on_oops is used tracing: Add support for SOFT_DISABLE to syscall events tracing: Make register/unregister_ftrace_command __init tracing: Update event filters for multibuffer recordmcount.pl: Add support for __fentry__ ftrace: Have control op function callback only trace when RCU is watching rcu: Do not trace rcu_is_watching() functions ftrace/x86: skip over the breakpoint for ftrace caller trace/trace_stat: use rbtree postorder iteration helper instead of opencoding ftrace: Add set_graph_notrace filter ftrace: Narrow down the protected area of graph_lock ftrace: Introduce struct ftrace_graph_data ftrace: Get rid of ftrace_graph_filter_enabled tracing: Fix potential out-of-bounds in trace_get_user() tracing: Show more exact help information about snapshot
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rcu/tiny.c2
-rw-r--r--kernel/rcu/tree.c4
-rw-r--r--kernel/trace/ftrace.c161
-rw-r--r--kernel/trace/trace.c82
-rw-r--r--kernel/trace/trace.h50
-rw-r--r--kernel/trace/trace_branch.c2
-rw-r--r--kernel/trace/trace_events.c32
-rw-r--r--kernel/trace/trace_events_filter.c218
-rw-r--r--kernel/trace/trace_export.c2
-rw-r--r--kernel/trace/trace_functions_graph.c82
-rw-r--r--kernel/trace/trace_kprobe.c4
-rw-r--r--kernel/trace/trace_mmiotrace.c4
-rw-r--r--kernel/trace/trace_sched_switch.c4
-rw-r--r--kernel/trace/trace_stat.c41
-rw-r--r--kernel/trace/trace_syscalls.c42
-rw-r--r--kernel/trace/trace_uprobe.c3
16 files changed, 521 insertions, 212 deletions
diff --git a/kernel/rcu/tiny.c b/kernel/rcu/tiny.c
index 0c9a934cfec1..1254f312d024 100644
--- a/kernel/rcu/tiny.c
+++ b/kernel/rcu/tiny.c
@@ -181,7 +181,7 @@ EXPORT_SYMBOL_GPL(rcu_irq_enter);
181/* 181/*
182 * Test whether RCU thinks that the current CPU is idle. 182 * Test whether RCU thinks that the current CPU is idle.
183 */ 183 */
184bool __rcu_is_watching(void) 184bool notrace __rcu_is_watching(void)
185{ 185{
186 return rcu_dynticks_nesting; 186 return rcu_dynticks_nesting;
187} 187}
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 4c06ddfea7cd..dd081987a8ec 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -664,7 +664,7 @@ void rcu_nmi_exit(void)
664 * rcu_is_watching(), the caller of __rcu_is_watching() must have at 664 * rcu_is_watching(), the caller of __rcu_is_watching() must have at
665 * least disabled preemption. 665 * least disabled preemption.
666 */ 666 */
667bool __rcu_is_watching(void) 667bool notrace __rcu_is_watching(void)
668{ 668{
669 return atomic_read(this_cpu_ptr(&rcu_dynticks.dynticks)) & 0x1; 669 return atomic_read(this_cpu_ptr(&rcu_dynticks.dynticks)) & 0x1;
670} 670}
@@ -675,7 +675,7 @@ bool __rcu_is_watching(void)
675 * If the current CPU is in its idle loop and is neither in an interrupt 675 * If the current CPU is in its idle loop and is neither in an interrupt
676 * or NMI handler, return true. 676 * or NMI handler, return true.
677 */ 677 */
678bool rcu_is_watching(void) 678bool notrace rcu_is_watching(void)
679{ 679{
680 int ret; 680 int ret;
681 681
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 03cf44ac54d3..22fa55696760 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -3307,7 +3307,11 @@ void unregister_ftrace_function_probe_all(char *glob)
3307static LIST_HEAD(ftrace_commands); 3307static LIST_HEAD(ftrace_commands);
3308static DEFINE_MUTEX(ftrace_cmd_mutex); 3308static DEFINE_MUTEX(ftrace_cmd_mutex);
3309 3309
3310int register_ftrace_command(struct ftrace_func_command *cmd) 3310/*
3311 * Currently we only register ftrace commands from __init, so mark this
3312 * __init too.
3313 */
3314__init int register_ftrace_command(struct ftrace_func_command *cmd)
3311{ 3315{
3312 struct ftrace_func_command *p; 3316 struct ftrace_func_command *p;
3313 int ret = 0; 3317 int ret = 0;
@@ -3326,7 +3330,11 @@ int register_ftrace_command(struct ftrace_func_command *cmd)
3326 return ret; 3330 return ret;
3327} 3331}
3328 3332
3329int unregister_ftrace_command(struct ftrace_func_command *cmd) 3333/*
3334 * Currently we only unregister ftrace commands from __init, so mark
3335 * this __init too.
3336 */
3337__init int unregister_ftrace_command(struct ftrace_func_command *cmd)
3330{ 3338{
3331 struct ftrace_func_command *p, *n; 3339 struct ftrace_func_command *p, *n;
3332 int ret = -ENODEV; 3340 int ret = -ENODEV;
@@ -3641,7 +3649,7 @@ __setup("ftrace_filter=", set_ftrace_filter);
3641 3649
3642#ifdef CONFIG_FUNCTION_GRAPH_TRACER 3650#ifdef CONFIG_FUNCTION_GRAPH_TRACER
3643static char ftrace_graph_buf[FTRACE_FILTER_SIZE] __initdata; 3651static char ftrace_graph_buf[FTRACE_FILTER_SIZE] __initdata;
3644static int ftrace_set_func(unsigned long *array, int *idx, char *buffer); 3652static int ftrace_set_func(unsigned long *array, int *idx, int size, char *buffer);
3645 3653
3646static int __init set_graph_function(char *str) 3654static int __init set_graph_function(char *str)
3647{ 3655{
@@ -3659,7 +3667,7 @@ static void __init set_ftrace_early_graph(char *buf)
3659 func = strsep(&buf, ","); 3667 func = strsep(&buf, ",");
3660 /* we allow only one expression at a time */ 3668 /* we allow only one expression at a time */
3661 ret = ftrace_set_func(ftrace_graph_funcs, &ftrace_graph_count, 3669 ret = ftrace_set_func(ftrace_graph_funcs, &ftrace_graph_count,
3662 func); 3670 FTRACE_GRAPH_MAX_FUNCS, func);
3663 if (ret) 3671 if (ret)
3664 printk(KERN_DEBUG "ftrace: function %s not " 3672 printk(KERN_DEBUG "ftrace: function %s not "
3665 "traceable\n", func); 3673 "traceable\n", func);
@@ -3776,15 +3784,25 @@ static const struct file_operations ftrace_notrace_fops = {
3776static DEFINE_MUTEX(graph_lock); 3784static DEFINE_MUTEX(graph_lock);
3777 3785
3778int ftrace_graph_count; 3786int ftrace_graph_count;
3779int ftrace_graph_filter_enabled; 3787int ftrace_graph_notrace_count;
3780unsigned long ftrace_graph_funcs[FTRACE_GRAPH_MAX_FUNCS] __read_mostly; 3788unsigned long ftrace_graph_funcs[FTRACE_GRAPH_MAX_FUNCS] __read_mostly;
3789unsigned long ftrace_graph_notrace_funcs[FTRACE_GRAPH_MAX_FUNCS] __read_mostly;
3790
3791struct ftrace_graph_data {
3792 unsigned long *table;
3793 size_t size;
3794 int *count;
3795 const struct seq_operations *seq_ops;
3796};
3781 3797
3782static void * 3798static void *
3783__g_next(struct seq_file *m, loff_t *pos) 3799__g_next(struct seq_file *m, loff_t *pos)
3784{ 3800{
3785 if (*pos >= ftrace_graph_count) 3801 struct ftrace_graph_data *fgd = m->private;
3802
3803 if (*pos >= *fgd->count)
3786 return NULL; 3804 return NULL;
3787 return &ftrace_graph_funcs[*pos]; 3805 return &fgd->table[*pos];
3788} 3806}
3789 3807
3790static void * 3808static void *
@@ -3796,10 +3814,12 @@ g_next(struct seq_file *m, void *v, loff_t *pos)
3796 3814
3797static void *g_start(struct seq_file *m, loff_t *pos) 3815static void *g_start(struct seq_file *m, loff_t *pos)
3798{ 3816{
3817 struct ftrace_graph_data *fgd = m->private;
3818
3799 mutex_lock(&graph_lock); 3819 mutex_lock(&graph_lock);
3800 3820
3801 /* Nothing, tell g_show to print all functions are enabled */ 3821 /* Nothing, tell g_show to print all functions are enabled */
3802 if (!ftrace_graph_filter_enabled && !*pos) 3822 if (!*fgd->count && !*pos)
3803 return (void *)1; 3823 return (void *)1;
3804 3824
3805 return __g_next(m, pos); 3825 return __g_next(m, pos);
@@ -3835,38 +3855,88 @@ static const struct seq_operations ftrace_graph_seq_ops = {
3835}; 3855};
3836 3856
3837static int 3857static int
3838ftrace_graph_open(struct inode *inode, struct file *file) 3858__ftrace_graph_open(struct inode *inode, struct file *file,
3859 struct ftrace_graph_data *fgd)
3839{ 3860{
3840 int ret = 0; 3861 int ret = 0;
3841 3862
3842 if (unlikely(ftrace_disabled))
3843 return -ENODEV;
3844
3845 mutex_lock(&graph_lock); 3863 mutex_lock(&graph_lock);
3846 if ((file->f_mode & FMODE_WRITE) && 3864 if ((file->f_mode & FMODE_WRITE) &&
3847 (file->f_flags & O_TRUNC)) { 3865 (file->f_flags & O_TRUNC)) {