aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.h
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-03-13 10:42:11 -0400
committerIngo Molnar <mingo@elte.hu>2009-03-13 11:57:42 -0400
commitbed1ffca022cc876fb83161d26670e9b5d3cf36b (patch)
treea896c79e9ea1af11f992826f1de7e2ece52fbe33 /kernel/trace/trace.h
parentf58ba100678f421bdcb000a3c71793f432dfab93 (diff)
tracing/syscalls: core infrastructure for syscalls tracing, enhancements
Impact: new feature This adds the generic support for syscalls tracing. This is currently exploited through a devoted tracer but other tracing engines can use it. (They just have to play with {start,stop}_ftrace_syscalls() and use the display callbacks unless they want to override them.) The syscalls prototypes definitions are abused here to steal some metadata informations: - syscall name, param types, param names, number of params The syscall addr is not directly saved during this definition because we don't know if its prototype is available in the namespace. But we don't really need it. The arch has just to build a function able to resolve the syscall number to its metadata struct. The current tracer prints the syscall names, parameters names and values (and their types optionally). Currently the value is a raw hex but higher level values diplaying is on my TODO list. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <1236955332-10133-2-git-send-email-fweisbec@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r--kernel/trace/trace.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 3d49daae47d..d80ca0d464d 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -194,6 +194,19 @@ struct kmemtrace_free_entry {
194 const void *ptr; 194 const void *ptr;
195}; 195};
196 196
197struct syscall_trace_enter {
198 struct trace_entry ent;
199 int nr;
200 unsigned long args[];
201};
202
203struct syscall_trace_exit {
204 struct trace_entry ent;
205 int nr;
206 unsigned long ret;
207};
208
209
197/* 210/*
198 * trace_flag_type is an enumeration that holds different 211 * trace_flag_type is an enumeration that holds different
199 * states when a trace occurs. These are: 212 * states when a trace occurs. These are:
@@ -306,6 +319,10 @@ extern void __ftrace_bad_type(void);
306 TRACE_KMEM_ALLOC); \ 319 TRACE_KMEM_ALLOC); \
307 IF_ASSIGN(var, ent, struct kmemtrace_free_entry, \ 320 IF_ASSIGN(var, ent, struct kmemtrace_free_entry, \
308 TRACE_KMEM_FREE); \ 321 TRACE_KMEM_FREE); \
322 IF_ASSIGN(var, ent, struct syscall_trace_enter, \
323 TRACE_SYSCALL_ENTER); \
324 IF_ASSIGN(var, ent, struct syscall_trace_exit, \
325 TRACE_SYSCALL_EXIT); \
309 __ftrace_bad_type(); \ 326 __ftrace_bad_type(); \
310 } while (0) 327 } while (0)
311 328