Lines Matching +full:wakeup +full:- +full:latency

1 // SPDX-License-Identifier: GPL-2.0
3 * trace task wakeup timings
5 * Copyright (C) 2007-2008 Steven Rostedt <srostedt@redhat.com>
10 * Copyright (C) 2004-2006 Ingo Molnar
28 static unsigned wakeup_prio = -1;
44 # define is_graph(tr) ((tr)->trace_flags & TRACE_ITER_DISPLAY_GRAPH)
54 * Prologue for the wakeup function tracers.
57 * is disabled and data->disabled is incremented.
59 * is not disabled and data->disabled is
85 *data = per_cpu_ptr(tr->array_buffer.data, cpu); in func_prolog_preempt_disable()
86 disabled = atomic_inc_return(&(*data)->disabled); in func_prolog_preempt_disable()
93 atomic_dec(&(*data)->disabled); in func_prolog_preempt_disable()
110 tr->max_latency = 0; in wakeup_display_graph()
134 if (ftrace_graph_notrace_addr(trace->func)) in wakeup_graph_entry()
140 calltime = fgraph_reserve_data(gops->idx, sizeof(*calltime)); in wakeup_graph_entry()
147 atomic_dec(&data->disabled); in wakeup_graph_entry()
171 calltime = fgraph_retrieve_data(gops->idx, &size); in wakeup_graph_return()
176 atomic_dec(&data->disabled); in wakeup_graph_return()
189 if (is_graph(iter->tr)) in wakeup_trace_open()
192 iter->private = NULL; in wakeup_trace_open()
197 if (iter->private) in wakeup_trace_close()
214 if (is_graph(iter->tr)) in wakeup_print_line()
230 * wakeup uses its own tracer function to keep the overhead down:
248 atomic_dec(&data->disabled); in wakeup_tracer_call()
257 if (function_enabled || (!set && !(tr->trace_flags & TRACE_ITER_FUNCTION))) in register_wakeup_function()
263 ret = register_ftrace_function(tr->ops); in register_wakeup_function()
279 unregister_ftrace_function(tr->ops); in unregister_wakeup_function()
335 struct tracer *tracer = tr->current_trace; in wakeup_flag_changed()
370 * Should this new latency be reported/recorded?
378 if (delta <= tr->max_latency) in report_latency()
399 struct trace_buffer *buffer = tr->array_buffer.buffer; in tracing_sched_switch_trace()
408 entry->prev_pid = prev->pid; in tracing_sched_switch_trace()
409 entry->prev_prio = prev->prio; in tracing_sched_switch_trace()
410 entry->prev_state = task_state_index(prev); in tracing_sched_switch_trace()
411 entry->next_pid = next->pid; in tracing_sched_switch_trace()
412 entry->next_prio = next->prio; in tracing_sched_switch_trace()
413 entry->next_state = task_state_index(next); in tracing_sched_switch_trace()
414 entry->next_cpu = task_cpu(next); in tracing_sched_switch_trace()
427 struct trace_buffer *buffer = tr->array_buffer.buffer; in tracing_sched_wakeup_trace()
434 entry->prev_pid = curr->pid; in tracing_sched_wakeup_trace()
435 entry->prev_prio = curr->prio; in tracing_sched_wakeup_trace()
436 entry->prev_state = task_state_index(curr); in tracing_sched_wakeup_trace()
437 entry->next_pid = wakee->pid; in tracing_sched_wakeup_trace()
438 entry->next_prio = wakee->prio; in tracing_sched_wakeup_trace()
439 entry->next_state = task_state_index(wakee); in tracing_sched_wakeup_trace()
440 entry->next_cpu = task_cpu(wakee); in tracing_sched_wakeup_trace()
476 disabled = atomic_inc_return(&per_cpu_ptr(wakeup_trace->array_buffer.data, cpu)->disabled); in probe_wakeup_sched_switch()
490 data = per_cpu_ptr(wakeup_trace->array_buffer.data, wakeup_cpu); in probe_wakeup_sched_switch()
496 T0 = data->preempt_timestamp; in probe_wakeup_sched_switch()
498 delta = T1-T0; in probe_wakeup_sched_switch()
504 wakeup_trace->max_latency = delta; in probe_wakeup_sched_switch()
513 atomic_dec(&per_cpu_ptr(wakeup_trace->array_buffer.data, cpu)->disabled); in probe_wakeup_sched_switch()
518 wakeup_cpu = -1; in __wakeup_reset()
519 wakeup_prio = -1; in __wakeup_reset()
532 tracing_reset_online_cpus(&tr->array_buffer); in wakeup_reset()
557 * - wakeup tracer handles all tasks in the system, independently in probe_wakeup()
559 * - wakeup_rt tracer handles tasks belonging to sched_dl and in probe_wakeup()
561 * - wakeup_dl handles tasks belonging to sched_dl class only. in probe_wakeup()
565 (!dl_task(p) && (p->prio >= wakeup_prio || p->prio >= current->prio))) in probe_wakeup()
568 disabled = atomic_inc_return(&per_cpu_ptr(wakeup_trace->array_buffer.data, cpu)->disabled); in probe_wakeup()
579 (!dl_task(p) && p->prio >= wakeup_prio)) in probe_wakeup()
587 wakeup_prio = p->prio; in probe_wakeup()
590 * Once you start tracing a -deadline task, don't bother tracing in probe_wakeup()
600 data = per_cpu_ptr(wakeup_trace->array_buffer.data, wakeup_cpu); in probe_wakeup()
601 data->preempt_timestamp = ftrace_now(cpu); in probe_wakeup()
615 atomic_dec(&per_cpu_ptr(wakeup_trace->array_buffer.data, cpu)->disabled); in probe_wakeup()
624 pr_info("wakeup trace: Couldn't activate tracepoint" in start_wakeup_tracer()
631 pr_info("wakeup trace: Couldn't activate tracepoint" in start_wakeup_tracer()
645 pr_info("wakeup trace: Couldn't activate tracepoint" in start_wakeup_tracer()
662 printk(KERN_ERR "failed to start wakeup tracer\n"); in start_wakeup_tracer()
687 save_flags = tr->trace_flags; in __wakeup_tracer_init()
689 /* non overwrite screws up the latency tracers */ in __wakeup_tracer_init()
693 tr->max_latency = 0; in __wakeup_tracer_init()
705 return -EBUSY; in wakeup_tracer_init()
715 return -EBUSY; in wakeup_rt_tracer_init()
725 return -EBUSY; in wakeup_dl_tracer_init()
760 .name = "wakeup",