Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * latencytop.h: Infrastructure for displaying latency
0004  *
0005  * (C) Copyright 2008 Intel Corporation
0006  * Author: Arjan van de Ven <arjan@linux.intel.com>
0007  *
0008  */
0009 
0010 #ifndef _INCLUDE_GUARD_LATENCYTOP_H_
0011 #define _INCLUDE_GUARD_LATENCYTOP_H_
0012 
0013 #include <linux/compiler.h>
0014 struct task_struct;
0015 
0016 #ifdef CONFIG_LATENCYTOP
0017 
0018 #define LT_SAVECOUNT        32
0019 #define LT_BACKTRACEDEPTH   12
0020 
0021 struct latency_record {
0022     unsigned long   backtrace[LT_BACKTRACEDEPTH];
0023     unsigned int    count;
0024     unsigned long   time;
0025     unsigned long   max;
0026 };
0027 
0028 
0029 
0030 extern int latencytop_enabled;
0031 void __account_scheduler_latency(struct task_struct *task, int usecs, int inter);
0032 static inline void
0033 account_scheduler_latency(struct task_struct *task, int usecs, int inter)
0034 {
0035     if (unlikely(latencytop_enabled))
0036         __account_scheduler_latency(task, usecs, inter);
0037 }
0038 
0039 void clear_tsk_latency_tracing(struct task_struct *p);
0040 
0041 #else
0042 
0043 static inline void
0044 account_scheduler_latency(struct task_struct *task, int usecs, int inter)
0045 {
0046 }
0047 
0048 static inline void clear_tsk_latency_tracing(struct task_struct *p)
0049 {
0050 }
0051 
0052 #endif
0053 
0054 #endif