aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_syscalls.c
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@redhat.com>2009-08-13 16:34:53 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2009-08-26 18:46:40 -0400
commitbd1a5c849bdcc5c89e4a6a18216cd2b9a7a8a78f (patch)
tree1a807fef00b8a700d90683d4f1d480d95eec9669 /kernel/trace/trace_syscalls.c
parentb1cf540f0e5278ecfe8532557e547d833ed269d7 (diff)
tracing: Ftrace dynamic ftrace_event_call support
Add dynamic ftrace_event_call support to ftrace. Trace engines can add new ftrace_event_call to ftrace on the fly. Each operator function of the call takes an ftrace_event_call data structure as an argument, because these functions may be shared among several ftrace_event_calls. Changes from v13: - Define remove_subsystem_dir() always (revirt a2ca5e03), because trace_remove_event_call() uses it. - Modify syscall tracer because of ftrace_event_call change. [fweisbec@gmail.com: Fixed conflict against latest tracing/core] Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Avi Kivity <avi@redhat.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Frank Ch. Eigler <fche@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Jason Baron <jbaron@redhat.com> Cc: Jim Keniston <jkenisto@us.ibm.com> Cc: K.Prasad <prasad@linux.vnet.ibm.com> Cc: Lai Jiangshan <laijs@cn.fujitsu.com> Cc: Li Zefan <lizf@cn.fujitsu.com> Cc: Przemysław Pawełczyk <przemyslaw@pawelczyk.it> Cc: Roland McGrath <roland@redhat.com> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Tom Zanussi <tzanussi@gmail.com> Cc: Vegard Nossum <vegard.nossum@gmail.com> LKML-Reference: <20090813203453.31965.71901.stgit@localhost.localdomain> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'kernel/trace/trace_syscalls.c')
-rw-r--r--kernel/trace/trace_syscalls.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
index 85291c4de406..5931933587e9 100644
--- a/kernel/trace/trace_syscalls.c
+++ b/kernel/trace/trace_syscalls.c
@@ -193,8 +193,8 @@ int syscall_enter_define_fields(struct ftrace_event_call *call)
193 return ret; 193 return ret;
194 194
195 for (i = 0; i < meta->nb_args; i++) { 195 for (i = 0; i < meta->nb_args; i++) {
196 ret = trace_define_field(call, meta->types[i], 196 ret = trace_define_field(call, (char *)meta->types[i],
197 meta->args[i], offset, 197 (char *)meta->args[i], offset,
198 sizeof(unsigned long), 0, 198 sizeof(unsigned long), 0,
199 FILTER_OTHER); 199 FILTER_OTHER);
200 offset += sizeof(unsigned long); 200 offset += sizeof(unsigned long);
@@ -277,13 +277,13 @@ void ftrace_syscall_exit(struct pt_regs *regs, long ret)
277 trace_current_buffer_unlock_commit(event, 0, 0); 277 trace_current_buffer_unlock_commit(event, 0, 0);
278} 278}
279 279
280int reg_event_syscall_enter(void *ptr) 280int reg_event_syscall_enter(struct ftrace_event_call *call)
281{ 281{
282 int ret = 0; 282 int ret = 0;
283 int num; 283 int num;
284 char *name; 284 char *name;
285 285
286 name = (char *)ptr; 286 name = (char *)call->data;
287 num = syscall_name_to_nr(name); 287 num = syscall_name_to_nr(name);
288 if (num < 0 || num >= FTRACE_SYSCALL_MAX) 288 if (num < 0 || num >= FTRACE_SYSCALL_MAX)
289 return -ENOSYS; 289 return -ENOSYS;
@@ -301,12 +301,12 @@ int reg_event_syscall_enter(void *ptr)
301 return ret; 301 return ret;
302} 302}
303 303
304void unreg_event_syscall_enter(void *ptr) 304void unreg_event_syscall_enter(struct ftrace_event_call *call)
305{ 305{
306 int num; 306 int num;
307 char *name; 307 char *name;
308 308
309 name = (char *)ptr; 309 name = (char *)call->data;
310 num = syscall_name_to_nr(name); 310 num = syscall_name_to_nr(name);
311 if (num < 0 || num >= FTRACE_SYSCALL_MAX) 311 if (num < 0 || num >= FTRACE_SYSCALL_MAX)
312 return; 312 return;
@@ -318,13 +318,13 @@ void unreg_event_syscall_enter(void *ptr)
318 mutex_unlock(&syscall_trace_lock); 318 mutex_unlock(&syscall_trace_lock);
319} 319}
320 320
321int reg_event_syscall_exit(void *ptr) 321int reg_event_syscall_exit(struct ftrace_event_call *call)
322{ 322{
323 int ret = 0; 323 int ret = 0;
324 int num; 324 int num;
325 char *name; 325 char *name;
326 326
327 name = (char *)ptr; 327 name = (char *)call->data;
328 num = syscall_name_to_nr(name); 328 num = syscall_name_to_nr(name);
329 if (num < 0 || num >= FTRACE_SYSCALL_MAX) 329 if (num < 0 || num >= FTRACE_SYSCALL_MAX)
330 return -ENOSYS; 330 return -ENOSYS;
@@ -342,12 +342,12 @@ int reg_event_syscall_exit(void *ptr)
342 return ret; 342 return ret;
343} 343}
344 344
345void unreg_event_syscall_exit(void *ptr) 345void unreg_event_syscall_exit(struct ftrace_event_call *call)
346{ 346{
347 int num; 347 int num;
348 char *name; 348 char *name;
349 349
350 name = (char *)ptr; 350 name = (char *)call->data;
351 num = syscall_name_to_nr(name); 351 num = syscall_name_to_nr(name);
352 if (num < 0 || num >= FTRACE_SYSCALL_MAX) 352 if (num < 0 || num >= FTRACE_SYSCALL_MAX)
353 return; 353 return;