diff options
author | Masami Hiramatsu <mhiramat@redhat.com> | 2009-08-13 16:34:53 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-08-26 18:46:40 -0400 |
commit | bd1a5c849bdcc5c89e4a6a18216cd2b9a7a8a78f (patch) | |
tree | 1a807fef00b8a700d90683d4f1d480d95eec9669 /include/trace | |
parent | b1cf540f0e5278ecfe8532557e547d833ed269d7 (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 'include/trace')
-rw-r--r-- | include/trace/ftrace.h | 16 | ||||
-rw-r--r-- | include/trace/syscall.h | 11 |
2 files changed, 15 insertions, 12 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 360a77ad79e1..f2bd7a8f8e8b 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -434,7 +434,7 @@ static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\ | |||
434 | * event_trace_printk(_RET_IP_, "<call>: " <fmt>); | 434 | * event_trace_printk(_RET_IP_, "<call>: " <fmt>); |
435 | * } | 435 | * } |
436 | * | 436 | * |
437 | * static int ftrace_reg_event_<call>(void) | 437 | * static int ftrace_reg_event_<call>(struct ftrace_event_call *unused) |
438 | * { | 438 | * { |
439 | * int ret; | 439 | * int ret; |
440 | * | 440 | * |
@@ -445,7 +445,7 @@ static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\ | |||
445 | * return ret; | 445 | * return ret; |
446 | * } | 446 | * } |
447 | * | 447 | * |
448 | * static void ftrace_unreg_event_<call>(void) | 448 | * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused) |
449 | * { | 449 | * { |
450 | * unregister_trace_<call>(ftrace_event_<call>); | 450 | * unregister_trace_<call>(ftrace_event_<call>); |
451 | * } | 451 | * } |
@@ -478,7 +478,7 @@ static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\ | |||
478 | * trace_current_buffer_unlock_commit(event, irq_flags, pc); | 478 | * trace_current_buffer_unlock_commit(event, irq_flags, pc); |
479 | * } | 479 | * } |
480 | * | 480 | * |
481 | * static int ftrace_raw_reg_event_<call>(void) | 481 | * static int ftrace_raw_reg_event_<call>(struct ftrace_event_call *unused) |
482 | * { | 482 | * { |
483 | * int ret; | 483 | * int ret; |
484 | * | 484 | * |
@@ -489,7 +489,7 @@ static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\ | |||
489 | * return ret; | 489 | * return ret; |
490 | * } | 490 | * } |
491 | * | 491 | * |
492 | * static void ftrace_unreg_event_<call>(void) | 492 | * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused) |
493 | * { | 493 | * { |
494 | * unregister_trace_<call>(ftrace_raw_event_<call>); | 494 | * unregister_trace_<call>(ftrace_raw_event_<call>); |
495 | * } | 495 | * } |
@@ -498,7 +498,7 @@ static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\ | |||
498 | * .trace = ftrace_raw_output_<call>, <-- stage 2 | 498 | * .trace = ftrace_raw_output_<call>, <-- stage 2 |
499 | * }; | 499 | * }; |
500 | * | 500 | * |
501 | * static int ftrace_raw_init_event_<call>(void) | 501 | * static int ftrace_raw_init_event_<call>(struct ftrace_event_call *unused) |
502 | * { | 502 | * { |
503 | * int id; | 503 | * int id; |
504 | * | 504 | * |
@@ -592,7 +592,7 @@ static void ftrace_raw_event_##call(proto) \ | |||
592 | trace_nowake_buffer_unlock_commit(event, irq_flags, pc); \ | 592 | trace_nowake_buffer_unlock_commit(event, irq_flags, pc); \ |
593 | } \ | 593 | } \ |
594 | \ | 594 | \ |
595 | static int ftrace_raw_reg_event_##call(void *ptr) \ | 595 | static int ftrace_raw_reg_event_##call(struct ftrace_event_call *unused)\ |
596 | { \ | 596 | { \ |
597 | int ret; \ | 597 | int ret; \ |
598 | \ | 598 | \ |
@@ -603,7 +603,7 @@ static int ftrace_raw_reg_event_##call(void *ptr) \ | |||
603 | return ret; \ | 603 | return ret; \ |
604 | } \ | 604 | } \ |
605 | \ | 605 | \ |
606 | static void ftrace_raw_unreg_event_##call(void *ptr) \ | 606 | static void ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused)\ |
607 | { \ | 607 | { \ |
608 | unregister_trace_##call(ftrace_raw_event_##call); \ | 608 | unregister_trace_##call(ftrace_raw_event_##call); \ |
609 | } \ | 609 | } \ |
@@ -612,7 +612,7 @@ static struct trace_event ftrace_event_type_##call = { \ | |||
612 | .trace = ftrace_raw_output_##call, \ | 612 | .trace = ftrace_raw_output_##call, \ |
613 | }; \ | 613 | }; \ |
614 | \ | 614 | \ |
615 | static int ftrace_raw_init_event_##call(void) \ | 615 | static int ftrace_raw_init_event_##call(struct ftrace_event_call *unused)\ |
616 | { \ | 616 | { \ |
617 | int id; \ | 617 | int id; \ |
618 | \ | 618 | \ |
diff --git a/include/trace/syscall.h b/include/trace/syscall.h index 5dc283ba5ae0..e290b86f6167 100644 --- a/include/trace/syscall.h +++ b/include/trace/syscall.h | |||
@@ -39,16 +39,19 @@ void set_syscall_enter_id(int num, int id); | |||
39 | void set_syscall_exit_id(int num, int id); | 39 | void set_syscall_exit_id(int num, int id); |
40 | extern struct trace_event event_syscall_enter; | 40 | extern struct trace_event event_syscall_enter; |
41 | extern struct trace_event event_syscall_exit; | 41 | extern struct trace_event event_syscall_exit; |
42 | extern int reg_event_syscall_enter(void *ptr); | 42 | |
43 | extern void unreg_event_syscall_enter(void *ptr); | ||
44 | extern int reg_event_syscall_exit(void *ptr); | ||
45 | extern void unreg_event_syscall_exit(void *ptr); | ||
46 | extern int syscall_enter_format(struct ftrace_event_call *call, | 43 | extern int syscall_enter_format(struct ftrace_event_call *call, |
47 | struct trace_seq *s); | 44 | struct trace_seq *s); |
48 | extern int syscall_exit_format(struct ftrace_event_call *call, | 45 | extern int syscall_exit_format(struct ftrace_event_call *call, |
49 | struct trace_seq *s); | 46 | struct trace_seq *s); |
50 | extern int syscall_enter_define_fields(struct ftrace_event_call *call); | 47 | extern int syscall_enter_define_fields(struct ftrace_event_call *call); |
51 | extern int syscall_exit_define_fields(struct ftrace_event_call *call); | 48 | extern int syscall_exit_define_fields(struct ftrace_event_call *call); |
49 | extern int reg_event_syscall_enter(struct ftrace_event_call *call); | ||
50 | extern void unreg_event_syscall_enter(struct ftrace_event_call *call); | ||
51 | extern int reg_event_syscall_exit(struct ftrace_event_call *call); | ||
52 | extern void unreg_event_syscall_exit(struct ftrace_event_call *call); | ||
53 | extern int | ||
54 | ftrace_format_syscall(struct ftrace_event_call *call, struct trace_seq *s); | ||
52 | enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags); | 55 | enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags); |
53 | enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags); | 56 | enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags); |
54 | #endif | 57 | #endif |