History

ftrace: Reuse the output of the function tracer for func_repeats

The func_repeats event shows the output of the function tracer followed by a count of the number of repeats the previous function had made, as well as the timestamp of the last function that was repeated. The printing of the function should be the same as is for the function it is displaying. Reuse the code in trace_fn_trace() by making a helper function print_fn_trace() and use it for trace_func_repeats_print().

Steven Rostedt (VMware) committed 5 years ago

Commit e1db6331 parent 22db0951 file · +13 −10Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/trace/trace_output.c+13−10
@@ -845,6 +845,17 @@ enum print_line_t trace_nop_print(struct trace_iterator *iter, int flags, · 844 unmodified lines
845 return trace_handle_return(&iter->seq);845 return trace_handle_return(&iter->seq);
846}846}
847 847
848static void print_fn_trace(struct trace_seq *s, unsigned long ip,
849 unsigned long parent_ip, int flags)
850{
851 seq_print_ip_sym(s, ip, flags);
852
853 if ((flags & TRACE_ITER_PRINT_PARENT) && parent_ip) {
854 trace_seq_puts(s, " <-");
855 seq_print_ip_sym(s, parent_ip, flags);
856 }
857}
858
848/* TRACE_FN */859/* TRACE_FN */
849static enum print_line_t trace_fn_trace(struct trace_iterator *iter, int flags,860static enum print_line_t trace_fn_trace(struct trace_iterator *iter, int flags,
850 struct trace_event *event)861 struct trace_event *event)
@@ -854,13 +865,7 @@ static enum print_line_t trace_fn_trace(struct trace_iterator *iter, int flags, · 3 unmodified lines
854 865
855 trace_assign_type(field, iter->ent);866 trace_assign_type(field, iter->ent);
856 867
857 seq_print_ip_sym(s, field->ip, flags);868 print_fn_trace(s, field->ip, field->parent_ip, flags);
858
859 if ((flags & TRACE_ITER_PRINT_PARENT) && field->parent_ip) {
860 trace_seq_puts(s, " <-");
861 seq_print_ip_sym(s, field->parent_ip, flags);
862 }
863
864 trace_seq_putc(s, '\n');869 trace_seq_putc(s, '\n');
865 870
866 return trace_handle_return(s);871 return trace_handle_return(s);
@@ -1408,9 +1413,7 @@ trace_func_repeats_print(struct trace_iterator *iter, int flags, · 541 unmodified lines
1408 1413
1409 trace_assign_type(field, iter->ent);1414 trace_assign_type(field, iter->ent);
1410 1415
1411 seq_print_ip_sym(s, field->ip, flags);1416 print_fn_trace(s, field->ip, field->parent_ip, flags);
1412 trace_seq_puts(s, " <-");
1413 seq_print_ip_sym(s, field->parent_ip, flags);
1414 trace_seq_printf(s, " (repeats: %u, last_ts:", field->count);1417 trace_seq_printf(s, " (repeats: %u, last_ts:", field->count);
1415 trace_print_time(s, iter,1418 trace_print_time(s, iter,
1416 iter->ts - FUNC_REPEATS_GET_DELTA_TS(field));1419 iter->ts - FUNC_REPEATS_GET_DELTA_TS(field));

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t