aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_functions_graph.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-03-19 15:14:46 -0400
committerSteven Rostedt <srostedt@redhat.com>2009-03-19 15:58:56 -0400
commit5087f8d2a2f2daff5a913d72d8ea3ad601948e10 (patch)
tree94eea3fdf8aabf361b8bcb9dac99395796aa78c6 /kernel/trace/trace_functions_graph.c
parent40ce74f19c28077550646c76d96a075bf312e461 (diff)
function-graph: show binary events as comments
With the added TRACE_EVENT macro, the events no longer appear in the function graph tracer. This was because the function graph did not know how to display the entries. The graph tracer was only aware of its own entries and the printk entries. By using the event call back feature, the graph tracer can now display the events. # echo irq > /debug/tracing/set_event Which can show: 0) | handle_IRQ_event() { 0) | /* irq_handler_entry: irq=48 handler=eth0 */ 0) | e1000_intr() { 0) 0.926 us | __napi_schedule(); 0) 3.888 us | } 0) | /* irq_handler_exit: irq=48 return=handled */ 0) 0.655 us | runqueue_is_locked(); 0) | __wake_up() { 0) 0.831 us | _spin_lock_irqsave(); The irq entry and exit events show up as comments. Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Diffstat (limited to 'kernel/trace/trace_functions_graph.c')
-rw-r--r--kernel/trace/trace_functions_graph.c40
1 files changed, 28 insertions, 12 deletions
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 66ea23b64fe6..e876816fa8e7 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -712,10 +712,12 @@ print_graph_return(struct ftrace_graph_ret *trace, struct trace_seq *s,
712} 712}
713 713
714static enum print_line_t 714static enum print_line_t
715print_graph_comment(struct bprint_entry *trace, struct trace_seq *s, 715print_graph_comment(struct trace_seq *s, struct trace_entry *ent,
716 struct trace_entry *ent, struct trace_iterator *iter) 716 struct trace_iterator *iter)
717{ 717{
718 unsigned long sym_flags = (trace_flags & TRACE_ITER_SYM_MASK);
718 struct fgraph_data *data = iter->private; 719 struct fgraph_data *data = iter->private;
720 struct trace_event *event;
719 int depth = 0; 721 int depth = 0;
720 int ret; 722 int ret;
721 int i; 723 int i;
@@ -751,9 +753,26 @@ print_graph_comment(struct bprint_entry *trace, struct trace_seq *s,
751 if (!ret) 753 if (!ret)
752 return TRACE_TYPE_PARTIAL_LINE; 754 return TRACE_TYPE_PARTIAL_LINE;
753 755
754 ret = trace_seq_bprintf(s, trace->fmt, trace->buf); 756 switch (iter->ent->type) {
755 if (!ret) 757 case TRACE_BPRINT:
756 return TRACE_TYPE_PARTIAL_LINE; 758 ret = trace_print_bprintk_msg_only(iter);
759 if (ret != TRACE_TYPE_HANDLED)
760 return ret;
761 break;
762 case TRACE_PRINT:
763 ret = trace_print_printk_msg_only(iter);
764 if (ret != TRACE_TYPE_HANDLED)
765 return ret;
766 break;
767 default:
768 event = ftrace_find_event(ent->type);
769 if (!event)
770 return TRACE_TYPE_UNHANDLED;
771
772 ret = event->trace(iter, sym_flags);
773 if (ret != TRACE_TYPE_HANDLED)
774 return ret;
775 }
757 776
758 /* Strip ending newline */ 777 /* Strip ending newline */
759 if (s->buffer[s->len - 1] == '\n') { 778 if (s->buffer[s->len - 1] == '\n') {
@@ -772,8 +791,8 @@ print_graph_comment(struct bprint_entry *trace, struct trace_seq *s,
772enum print_line_t 791enum print_line_t
773print_graph_function(struct trace_iterator *iter) 792print_graph_function(struct trace_iterator *iter)
774{ 793{
775 struct trace_seq *s = &iter->seq;
776 struct trace_entry *entry = iter->ent; 794 struct trace_entry *entry = iter->ent;
795 struct trace_seq *s = &iter->seq;
777 796
778 switch (entry->type) { 797 switch (entry->type) {
779 case TRACE_GRAPH_ENT: { 798 case TRACE_GRAPH_ENT: {
@@ -786,14 +805,11 @@ print_graph_function(struct trace_iterator *iter)
786 trace_assign_type(field, entry); 805 trace_assign_type(field, entry);
787 return print_graph_return(&field->ret, s, entry, iter); 806 return print_graph_return(&field->ret, s, entry, iter);
788 } 807 }
789 case TRACE_BPRINT: {
790 struct bprint_entry *field;
791 trace_assign_type(field, entry);
792 return print_graph_comment(field, s, entry, iter);
793 }
794 default: 808 default:
795 return TRACE_TYPE_UNHANDLED; 809 return print_graph_comment(s, entry, iter);
796 } 810 }
811
812 return TRACE_TYPE_HANDLED;
797} 813}
798 814
799static void print_graph_headers(struct seq_file *s) 815static void print_graph_headers(struct seq_file *s)