trace_osnoise.c (498627b4ac85780b9962ed9b5c5abbefd884ef8e) | trace_osnoise.c (19c3eaa72288ce161441dd6b74b765a094d73488) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * OS Noise Tracer: computes the OS Noise suffered by a running thread. 4 * Timerlat Tracer: measures the wakeup latency of a timer triggered IRQ and thread. 5 * 6 * Based on "hwlat_detector" tracer by: 7 * Copyright (C) 2008-2009 Jon Masters, Red Hat, Inc. <jcm@redhat.com> 8 * Copyright (C) 2013-2016 Steven Rostedt, Red Hat, Inc. <srostedt@redhat.com> --- 1028 unchanged lines hidden (view full) --- 1037 * Used to capture the time, looking for potential osnoise latency repeatedly. 1038 * Different from hwlat_detector, it is called with preemption and interrupts 1039 * enabled. This allows irqs, softirqs and threads to run, interfering on the 1040 * osnoise sampling thread, as they would do with a regular thread. 1041 */ 1042static int run_osnoise(void) 1043{ 1044 struct osnoise_variables *osn_var = this_cpu_osn_var(); | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * OS Noise Tracer: computes the OS Noise suffered by a running thread. 4 * Timerlat Tracer: measures the wakeup latency of a timer triggered IRQ and thread. 5 * 6 * Based on "hwlat_detector" tracer by: 7 * Copyright (C) 2008-2009 Jon Masters, Red Hat, Inc. <jcm@redhat.com> 8 * Copyright (C) 2013-2016 Steven Rostedt, Red Hat, Inc. <srostedt@redhat.com> --- 1028 unchanged lines hidden (view full) --- 1037 * Used to capture the time, looking for potential osnoise latency repeatedly. 1038 * Different from hwlat_detector, it is called with preemption and interrupts 1039 * enabled. This allows irqs, softirqs and threads to run, interfering on the 1040 * osnoise sampling thread, as they would do with a regular thread. 1041 */ 1042static int run_osnoise(void) 1043{ 1044 struct osnoise_variables *osn_var = this_cpu_osn_var(); |
1045 u64 noise = 0, sum_noise = 0, max_noise = 0; | |
1046 struct trace_array *tr = osnoise_trace; 1047 u64 start, sample, last_sample; 1048 u64 last_int_count, int_count; | 1045 struct trace_array *tr = osnoise_trace; 1046 u64 start, sample, last_sample; 1047 u64 last_int_count, int_count; |
1048 s64 noise = 0, max_noise = 0; |
|
1049 s64 total, last_total = 0; 1050 struct osnoise_sample s; 1051 unsigned int threshold; | 1049 s64 total, last_total = 0; 1050 struct osnoise_sample s; 1051 unsigned int threshold; |
1052 int hw_count = 0; | |
1053 u64 runtime, stop_in; | 1052 u64 runtime, stop_in; |
1053 u64 sum_noise = 0; 1054 int hw_count = 0; |
|
1054 int ret = -1; 1055 1056 /* 1057 * Considers the current thread as the workload. 1058 */ 1059 osn_var->pid = current->pid; 1060 1061 /* --- 997 unchanged lines hidden --- | 1055 int ret = -1; 1056 1057 /* 1058 * Considers the current thread as the workload. 1059 */ 1060 osn_var->pid = current->pid; 1061 1062 /* --- 997 unchanged lines hidden --- |