aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-07-29 11:51:13 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2009-08-06 01:28:05 -0400
commitc0a0d0d3f65284c71115a9bb1ed801ee33eeb552 (patch)
treeac4c74e18c73f368abc8721f8f04c9101069fcaf /kernel/trace/trace.c
parent5e5bf483986ad86ad25f25eec5299c86eb2d1c57 (diff)
tracing/core: Make the stack entry helpers global
Make the stacktrace event insertion helpers globals. This has two effects: - Prepare for moving the sched events insertion helpers to the sched switch tracer file. - Move some ifdef outside function definitions Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index b6211d604131..d6059a493e7f 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -866,10 +866,6 @@ struct ring_buffer_event *trace_buffer_lock_reserve(struct trace_array *tr,
866 866
867 return event; 867 return event;
868} 868}
869static void ftrace_trace_stack(struct trace_array *tr,
870 unsigned long flags, int skip, int pc);
871static void ftrace_trace_userstack(struct trace_array *tr,
872 unsigned long flags, int pc);
873 869
874static inline void __trace_buffer_unlock_commit(struct trace_array *tr, 870static inline void __trace_buffer_unlock_commit(struct trace_array *tr,
875 struct ring_buffer_event *event, 871 struct ring_buffer_event *event,
@@ -1003,11 +999,11 @@ ftrace(struct trace_array *tr, struct trace_array_cpu *data,
1003 trace_function(tr, ip, parent_ip, flags, pc); 999 trace_function(tr, ip, parent_ip, flags, pc);
1004} 1000}
1005 1001
1002#ifdef CONFIG_STACKTRACE
1006static void __ftrace_trace_stack(struct trace_array *tr, 1003static void __ftrace_trace_stack(struct trace_array *tr,
1007 unsigned long flags, 1004 unsigned long flags,
1008 int skip, int pc) 1005 int skip, int pc)
1009{ 1006{
1010#ifdef CONFIG_STACKTRACE
1011 struct ftrace_event_call *call = &event_kernel_stack; 1007 struct ftrace_event_call *call = &event_kernel_stack;
1012 struct ring_buffer_event *event; 1008 struct ring_buffer_event *event;
1013 struct stack_entry *entry; 1009 struct stack_entry *entry;
@@ -1028,12 +1024,10 @@ static void __ftrace_trace_stack(struct trace_array *tr,
1028 save_stack_trace(&trace); 1024 save_stack_trace(&trace);
1029 if (!filter_check_discard(call, entry, tr->buffer, event)) 1025 if (!filter_check_discard(call, entry, tr->buffer, event))
1030 ring_buffer_unlock_commit(tr->buffer, event); 1026 ring_buffer_unlock_commit(tr->buffer, event);
1031#endif
1032} 1027}
1033 1028
1034static void ftrace_trace_stack(struct trace_array *tr, 1029void ftrace_trace_stack(struct trace_array *tr, unsigned long flags, int skip,
1035 unsigned long flags, 1030 int pc)
1036 int skip, int pc)
1037{ 1031{
1038 if (!(trace_flags & TRACE_ITER_STACKTRACE)) 1032 if (!(trace_flags & TRACE_ITER_STACKTRACE))
1039 return; 1033 return;
@@ -1041,17 +1035,14 @@ static void ftrace_trace_stack(struct trace_array *tr,
1041 __ftrace_trace_stack(tr, flags, skip, pc); 1035 __ftrace_trace_stack(tr, flags, skip, pc);
1042} 1036}
1043 1037
1044void __trace_stack(struct trace_array *tr, 1038void __trace_stack(struct trace_array *tr, unsigned long flags, int skip,
1045 unsigned long flags, 1039 int pc)
1046 int skip, int pc)
1047{ 1040{
1048 __ftrace_trace_stack(tr, flags, skip, pc); 1041 __ftrace_trace_stack(tr, flags, skip, pc);
1049} 1042}
1050 1043
1051static void ftrace_trace_userstack(struct trace_array *tr, 1044void ftrace_trace_userstack(struct trace_array *tr, unsigned long flags, int pc)
1052 unsigned long flags, int pc)
1053{ 1045{
1054#ifdef CONFIG_STACKTRACE
1055 struct ftrace_event_call *call = &event_user_stack; 1046 struct ftrace_event_call *call = &event_user_stack;
1056 struct ring_buffer_event *event; 1047 struct ring_buffer_event *event;
1057 struct userstack_entry *entry; 1048 struct userstack_entry *entry;
@@ -1076,7 +1067,6 @@ static void ftrace_trace_userstack(struct trace_array *tr,
1076 save_stack_trace_user(&trace); 1067 save_stack_trace_user(&trace);
1077 if (!filter_check_discard(call, entry, tr->buffer, event)) 1068 if (!filter_check_discard(call, entry, tr->buffer, event))
1078 ring_buffer_unlock_commit(tr->buffer, event); 1069 ring_buffer_unlock_commit(tr->buffer, event);
1079#endif
1080} 1070}
1081 1071
1082#ifdef UNUSED 1072#ifdef UNUSED
@@ -1086,6 +1076,8 @@ static void __trace_userstack(struct trace_array *tr, unsigned long flags)
1086} 1076}
1087#endif /* UNUSED */ 1077#endif /* UNUSED */
1088 1078
1079#endif /* CONFIG_STACKTRACE */
1080
1089static void 1081static void
1090ftrace_trace_special(void *__tr, 1082ftrace_trace_special(void *__tr,
1091 unsigned long arg1, unsigned long arg2, unsigned long arg3, 1083 unsigned long arg1, unsigned long arg2, unsigned long arg3,