1 /* SPDX-License-Identifier: GPL-2.0 */ << 2 /* 1 /* 3 * latencytop.h: Infrastructure for displaying 2 * latencytop.h: Infrastructure for displaying latency 4 * 3 * 5 * (C) Copyright 2008 Intel Corporation 4 * (C) Copyright 2008 Intel Corporation 6 * Author: Arjan van de Ven <arjan@linux.intel 5 * Author: Arjan van de Ven <arjan@linux.intel.com> 7 * 6 * 8 */ 7 */ 9 8 10 #ifndef _INCLUDE_GUARD_LATENCYTOP_H_ 9 #ifndef _INCLUDE_GUARD_LATENCYTOP_H_ 11 #define _INCLUDE_GUARD_LATENCYTOP_H_ 10 #define _INCLUDE_GUARD_LATENCYTOP_H_ 12 11 13 #include <linux/compiler.h> 12 #include <linux/compiler.h> 14 struct task_struct; 13 struct task_struct; 15 14 16 #ifdef CONFIG_LATENCYTOP 15 #ifdef CONFIG_LATENCYTOP 17 16 18 #define LT_SAVECOUNT 32 17 #define LT_SAVECOUNT 32 19 #define LT_BACKTRACEDEPTH 12 18 #define LT_BACKTRACEDEPTH 12 20 19 21 struct latency_record { 20 struct latency_record { 22 unsigned long backtrace[LT_BACKTRACE 21 unsigned long backtrace[LT_BACKTRACEDEPTH]; 23 unsigned int count; 22 unsigned int count; 24 unsigned long time; 23 unsigned long time; 25 unsigned long max; 24 unsigned long max; 26 }; 25 }; 27 26 28 27 29 28 30 extern int latencytop_enabled; 29 extern int latencytop_enabled; 31 void __account_scheduler_latency(struct task_s 30 void __account_scheduler_latency(struct task_struct *task, int usecs, int inter); 32 static inline void 31 static inline void 33 account_scheduler_latency(struct task_struct * 32 account_scheduler_latency(struct task_struct *task, int usecs, int inter) 34 { 33 { 35 if (unlikely(latencytop_enabled)) 34 if (unlikely(latencytop_enabled)) 36 __account_scheduler_latency(ta 35 __account_scheduler_latency(task, usecs, inter); 37 } 36 } 38 37 39 void clear_tsk_latency_tracing(struct task_str !! 38 void clear_all_latency_tracing(struct task_struct *p); >> 39 >> 40 extern int sysctl_latencytop(struct ctl_table *table, int write, >> 41 void __user *buffer, size_t *lenp, loff_t *ppos); 40 42 41 #else 43 #else 42 44 43 static inline void 45 static inline void 44 account_scheduler_latency(struct task_struct * 46 account_scheduler_latency(struct task_struct *task, int usecs, int inter) 45 { 47 { 46 } 48 } 47 49 48 static inline void clear_tsk_latency_tracing(s !! 50 static inline void clear_all_latency_tracing(struct task_struct *p) 49 { 51 { 50 } 52 } 51 53 52 #endif 54 #endif 53 55 54 #endif 56 #endif 55 57
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.