Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318018
b: refs/heads/master
c: 21f6794
h: refs/heads/master
v: v3
  • Loading branch information
Anton Vorontsov authored and Greg Kroah-Hartman committed Jul 17, 2012
1 parent 2f70688 commit 6096c19
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 060287b8c467bf49a594d8d669e1986c6d8d76b0
refs/heads/master: 21f679404a0c28bd5b1b3aff2a7218bbff4cb43d
25 changes: 20 additions & 5 deletions trunk/kernel/trace/trace_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <linux/debugfs.h>
#include <linux/uaccess.h>
#include <linux/ftrace.h>
#include <linux/pstore.h>
#include <linux/fs.h>

#include "trace.h"
Expand Down Expand Up @@ -74,6 +75,14 @@ function_trace_call_preempt_only(unsigned long ip, unsigned long parent_ip)
preempt_enable_notrace();
}

/* Our two options */
enum {
TRACE_FUNC_OPT_STACK = 0x1,
TRACE_FUNC_OPT_PSTORE = 0x2,
};

static struct tracer_flags func_flags;

static void
function_trace_call(unsigned long ip, unsigned long parent_ip)
{
Expand All @@ -97,6 +106,12 @@ function_trace_call(unsigned long ip, unsigned long parent_ip)
disabled = atomic_inc_return(&data->disabled);

if (likely(disabled == 1)) {
/*
* So far tracing doesn't support multiple buffers, so
* we make an explicit call for now.
*/
if (unlikely(func_flags.val & TRACE_FUNC_OPT_PSTORE))
pstore_ftrace_call(ip, parent_ip);
pc = preempt_count();
trace_function(tr, ip, parent_ip, flags, pc);
}
Expand Down Expand Up @@ -158,14 +173,12 @@ static struct ftrace_ops trace_stack_ops __read_mostly =
.flags = FTRACE_OPS_FL_GLOBAL,
};

/* Our two options */
enum {
TRACE_FUNC_OPT_STACK = 0x1,
};

static struct tracer_opt func_opts[] = {
#ifdef CONFIG_STACKTRACE
{ TRACER_OPT(func_stack_trace, TRACE_FUNC_OPT_STACK) },
#endif
#ifdef CONFIG_PSTORE_FTRACE
{ TRACER_OPT(func_pstore, TRACE_FUNC_OPT_PSTORE) },
#endif
{ } /* Always set a last empty entry */
};
Expand Down Expand Up @@ -217,6 +230,8 @@ static int func_set_flag(u32 old_flags, u32 bit, int set)
register_ftrace_function(&trace_ops);
}

return 0;
} else if (bit == TRACE_FUNC_OPT_PSTORE) {
return 0;
}

Expand Down

0 comments on commit 6096c19

Please sign in to comment.