aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_irqsoff.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-12-31 14:46:59 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-12-31 14:46:59 -0500
commit495d714ad140e1732e66c45d0409054b24c1a0d6 (patch)
tree373ec6619adea47d848d36f140b32def27164bbd /kernel/trace/trace_irqsoff.c
parentf12e840c819bab42621685558a01d3f46ab9a226 (diff)
parent3d739c1f6156c70eb0548aa288dcfbac9e0bd162 (diff)
Merge tag 'trace-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing updates from Steven Rostedt: - Rework of the kprobe/uprobe and synthetic events to consolidate all the dynamic event code. This will make changes in the future easier. - Partial rewrite of the function graph tracing infrastructure. This will allow for multiple users of hooking onto functions to get the callback (return) of the function. This is the ground work for having kprobes and function graph tracer using one code base. - Clean up of the histogram code that will facilitate adding more features to the histograms in the future. - Addition of str_has_prefix() and a few use cases. There currently is a similar function strstart() that is used in a few places, but only returns a bool and not a length. These instances will be removed in the future to use str_has_prefix() instead. - A few other various clean ups as well. * tag 'trace-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (57 commits) tracing: Use the return of str_has_prefix() to remove open coded numbers tracing: Have the historgram use the result of str_has_prefix() for len of prefix tracing: Use str_has_prefix() instead of using fixed sizes tracing: Use str_has_prefix() helper for histogram code string.h: Add str_has_prefix() helper function tracing: Make function ‘ftrace_exports’ static tracing: Simplify printf'ing in seq_print_sym tracing: Avoid -Wformat-nonliteral warning tracing: Merge seq_print_sym_short() and seq_print_sym_offset() tracing: Add hist trigger comments for variable-related fields tracing: Remove hist trigger synth_var_refs tracing: Use hist trigger's var_ref array to destroy var_refs tracing: Remove open-coding of hist trigger var_ref management tracing: Use var_refs[] for hist trigger reference checking tracing: Change strlen to sizeof for hist trigger static strings tracing: Remove unnecessary hist trigger struct field tracing: Fix ftrace_graph_get_ret_stack() to use task and not current seq_buf: Use size_t for len in seq_buf_puts() seq_buf: Make seq_buf_puts() null-terminate the buffer arm64: Use ftrace_graph_get_ret_stack() instead of curr_ret_stack ...
Diffstat (limited to 'kernel/trace/trace_irqsoff.c')
-rw-r--r--kernel/trace/trace_irqsoff.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c
index 98ea6d28df15..d3294721f119 100644
--- a/kernel/trace/trace_irqsoff.c
+++ b/kernel/trace/trace_irqsoff.c
@@ -218,6 +218,11 @@ static void irqsoff_graph_return(struct ftrace_graph_ret *trace)
218 atomic_dec(&data->disabled); 218 atomic_dec(&data->disabled);
219} 219}
220 220
221static struct fgraph_ops fgraph_ops = {
222 .entryfunc = &irqsoff_graph_entry,
223 .retfunc = &irqsoff_graph_return,
224};
225
221static void irqsoff_trace_open(struct trace_iterator *iter) 226static void irqsoff_trace_open(struct trace_iterator *iter)
222{ 227{
223 if (is_graph(iter->tr)) 228 if (is_graph(iter->tr))
@@ -272,13 +277,6 @@ __trace_function(struct trace_array *tr,
272#else 277#else
273#define __trace_function trace_function 278#define __trace_function trace_function
274 279
275#ifdef CONFIG_FUNCTION_TRACER
276static int irqsoff_graph_entry(struct ftrace_graph_ent *trace)
277{
278 return -1;
279}
280#endif
281
282static enum print_line_t irqsoff_print_line(struct trace_iterator *iter) 280static enum print_line_t irqsoff_print_line(struct trace_iterator *iter)
283{ 281{
284 return TRACE_TYPE_UNHANDLED; 282 return TRACE_TYPE_UNHANDLED;
@@ -288,7 +286,6 @@ static void irqsoff_trace_open(struct trace_iterator *iter) { }
288static void irqsoff_trace_close(struct trace_iterator *iter) { } 286static void irqsoff_trace_close(struct trace_iterator *iter) { }
289 287
290#ifdef CONFIG_FUNCTION_TRACER 288#ifdef CONFIG_FUNCTION_TRACER
291static void irqsoff_graph_return(struct ftrace_graph_ret *trace) { }
292static void irqsoff_print_header(struct seq_file *s) 289static void irqsoff_print_header(struct seq_file *s)
293{ 290{
294 trace_default_header(s); 291 trace_default_header(s);
@@ -468,8 +465,7 @@ static int register_irqsoff_function(struct trace_array *tr, int graph, int set)
468 return 0; 465 return 0;
469 466
470 if (graph) 467 if (graph)
471 ret = register_ftrace_graph(&irqsoff_graph_return, 468 ret = register_ftrace_graph(&fgraph_ops);
472 &irqsoff_graph_entry);
473 else 469 else
474 ret = register_ftrace_function(tr->ops); 470 ret = register_ftrace_function(tr->ops);
475 471
@@ -485,7 +481,7 @@ static void unregister_irqsoff_function(struct trace_array *tr, int graph)
485 return; 481 return;
486 482
487 if (graph) 483 if (graph)
488 unregister_ftrace_graph(); 484 unregister_ftrace_graph(&fgraph_ops);
489 else 485 else
490 unregister_ftrace_function(tr->ops); 486 unregister_ftrace_function(tr->ops);
491 487