From d2e1446d81725c351dc73a03b397ce043fb18452 Mon Sep 17 00:00:00 2001 From: Meizu OpenSource Date: Mon, 15 Aug 2016 10:19:42 +0800 Subject: first commit --- include/linux/time_log.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 include/linux/time_log.h (limited to 'include/linux/time_log.h') diff --git a/include/linux/time_log.h b/include/linux/time_log.h new file mode 100644 index 000000000..1770e9bce --- /dev/null +++ b/include/linux/time_log.h @@ -0,0 +1,31 @@ +#include +#include + +extern bool printk_disable_uart; +#if 1 +#define TIME_LOG_START() \ + { \ + unsigned long long _start_time = 0; \ + unsigned long long _end_time = 0; \ + unsigned long long _dur_time = 0; \ + if(printk_disable_uart == 0){ \ + _start_time = sched_clock(); \ + } \ + do { } while(0) + +#define TIME_LOG_END(X...) \ + if(printk_disable_uart == 0){ \ + _end_time = sched_clock(); \ + _dur_time = _end_time - _start_time; \ + printk(KERN_ERR X); \ + printk(KERN_ERR" s:%llu e:%llu d:%llu\n", \ + _start_time, _end_time, _dur_time ); \ + if(_dur_time > 100000000){ \ + printk(KERN_ERR"warning init time too long!\n");} \ + } \ + } \ + do { } while(0) +#else +#define TIME_LOG_START() do{} while(0) +#define TIME_LOG_END(X...) do{} while(0) +#endif \ No newline at end of file -- cgit v1.2.3