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()
131 if (ftrace_graph_notrace_addr(trace->func)) in wakeup_graph_entry()
139 atomic_dec(&data->disabled); in wakeup_graph_entry()
159 atomic_dec(&data->disabled); in wakeup_graph_return()
172 if (is_graph(iter->tr)) in wakeup_trace_open()
178 if (iter->private) in wakeup_trace_close()
195 if (is_graph(iter->tr)) in wakeup_print_line()
211 * wakeup uses its own tracer function to keep the overhead down:
229 atomic_dec(&data->disabled); in wakeup_tracer_call()
238 if (function_enabled || (!set && !(tr->trace_flags & TRACE_ITER_FUNCTION))) in register_wakeup_function()
244 ret = register_ftrace_function(tr->ops); in register_wakeup_function()
260 unregister_ftrace_function(tr->ops); in unregister_wakeup_function()
316 struct tracer *tracer = tr->current_trace; in wakeup_flag_changed()
351 * Should this new latency be reported/recorded?
359 if (delta <= tr->max_latency) in report_latency()
381 struct trace_buffer *buffer = tr->array_buffer.buffer; in tracing_sched_switch_trace()
390 entry->prev_pid = prev->pid; in tracing_sched_switch_trace()
391 entry->prev_prio = prev->prio; in tracing_sched_switch_trace()
392 entry->prev_state = task_state_index(prev); in tracing_sched_switch_trace()
393 entry->next_pid = next->pid; in tracing_sched_switch_trace()
394 entry->next_prio = next->prio; in tracing_sched_switch_trace()
395 entry->next_state = task_state_index(next); in tracing_sched_switch_trace()
396 entry->next_cpu = task_cpu(next); in tracing_sched_switch_trace()
411 struct trace_buffer *buffer = tr->array_buffer.buffer; in tracing_sched_wakeup_trace()
418 entry->prev_pid = curr->pid; in tracing_sched_wakeup_trace()
419 entry->prev_prio = curr->prio; in tracing_sched_wakeup_trace()
420 entry->prev_state = task_state_index(curr); in tracing_sched_wakeup_trace()
421 entry->next_pid = wakee->pid; in tracing_sched_wakeup_trace()
422 entry->next_prio = wakee->prio; in tracing_sched_wakeup_trace()
423 entry->next_state = task_state_index(wakee); in tracing_sched_wakeup_trace()
424 entry->next_cpu = task_cpu(wakee); in tracing_sched_wakeup_trace()
462 disabled = atomic_inc_return(&per_cpu_ptr(wakeup_trace->array_buffer.data, cpu)->disabled); in probe_wakeup_sched_switch()
474 data = per_cpu_ptr(wakeup_trace->array_buffer.data, wakeup_cpu); in probe_wakeup_sched_switch()
480 T0 = data->preempt_timestamp; in probe_wakeup_sched_switch()
482 delta = T1-T0; in probe_wakeup_sched_switch()
488 wakeup_trace->max_latency = delta; in probe_wakeup_sched_switch()
497 atomic_dec(&per_cpu_ptr(wakeup_trace->array_buffer.data, cpu)->disabled); in probe_wakeup_sched_switch()
502 wakeup_cpu = -1; in __wakeup_reset()
503 wakeup_prio = -1; in __wakeup_reset()
516 tracing_reset_online_cpus(&tr->array_buffer); in wakeup_reset()
542 * - wakeup tracer handles all tasks in the system, independently in probe_wakeup()
544 * - wakeup_rt tracer handles tasks belonging to sched_dl and in probe_wakeup()
546 * - wakeup_dl handles tasks belonging to sched_dl class only. in probe_wakeup()
550 (!dl_task(p) && (p->prio >= wakeup_prio || p->prio >= current->prio))) in probe_wakeup()
554 disabled = atomic_inc_return(&per_cpu_ptr(wakeup_trace->array_buffer.data, cpu)->disabled); in probe_wakeup()
563 (!dl_task(p) && p->prio >= wakeup_prio)) in probe_wakeup()
571 wakeup_prio = p->prio; in probe_wakeup()
574 * Once you start tracing a -deadline task, don't bother tracing in probe_wakeup()
586 data = per_cpu_ptr(wakeup_trace->array_buffer.data, wakeup_cpu); in probe_wakeup()
587 data->preempt_timestamp = ftrace_now(cpu); in probe_wakeup()
601 atomic_dec(&per_cpu_ptr(wakeup_trace->array_buffer.data, cpu)->disabled); in probe_wakeup()
610 pr_info("wakeup trace: Couldn't activate tracepoint" in start_wakeup_tracer()
617 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()
648 printk(KERN_ERR "failed to start wakeup tracer\n"); in start_wakeup_tracer()
673 save_flags = tr->trace_flags; in __wakeup_tracer_init()
675 /* non overwrite screws up the latency tracers */ in __wakeup_tracer_init()
679 tr->max_latency = 0; in __wakeup_tracer_init()
691 return -EBUSY; in wakeup_tracer_init()
701 return -EBUSY; in wakeup_rt_tracer_init()
711 return -EBUSY; in wakeup_dl_tracer_init()
746 .name = "wakeup",