From 76a9d96feb6837a411db98a0abde7081f091a21b Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 18 Mar 2021 07:18:37 +1300 Subject: log: Drop log_nop() functions These functions are not needed anymore since we now have logic which can output to the console if logging is disabled. Drop the declarations. Signed-off-by: Simon Glass --- include/log.h | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'include') diff --git a/include/log.h b/include/log.h index 7abc70e4398..df497bad181 100644 --- a/include/log.h +++ b/include/log.h @@ -130,18 +130,6 @@ int _log(enum log_category_t cat, enum log_level_t level, const char *file, int line, const char *func, const char *fmt, ...) __attribute__ ((format (__printf__, 6, 7))); -static inline int _log_nop(enum log_category_t cat, enum log_level_t level, - const char *file, int line, const char *func, - const char *fmt, ...) - __attribute__ ((format (__printf__, 6, 7))); - -static inline int _log_nop(enum log_category_t cat, enum log_level_t level, - const char *file, int line, const char *func, - const char *fmt, ...) -{ - return 0; -} - /** * _log_buffer - Internal function to print data buffer in hex and ascii form * @@ -240,12 +228,6 @@ int _log_buffer(enum log_category_t cat, enum log_level_t level, }) #endif -#define log_nop(_cat, _level, _fmt, _args...) ({ \ - int _l = _level; \ - _log_nop((enum log_category_t)(_cat), _l, __FILE__, __LINE__, \ - __func__, pr_fmt(_fmt), ##_args); \ -}) - #ifdef DEBUG #define _DEBUG 1 #else -- cgit v1.2.3 From 55bc22760c362bba478d449ea7ba59667c4eefe4 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Fri, 12 Aug 2022 10:54:51 +0200 Subject: bootstage: Show func name for bootstage_mark/error bootstage_mark() and bootstate_error() are not recording any name and in report it is showing as id=. That's not useful and it is better to show function name which calls it. That's why use macros with passing __func__ as recorded name for bootstage. Origin report looks like this: ZynqMP> bootstage report Timer summary in microseconds (10 records): Mark Elapsed Stage 0 0 reset 2,482,383 2,482,383 board_init_f 4,278,821 1,796,438 board_init_r 4,825,331 546,510 id=64 4,858,409 33,078 id=65 4,862,382 3,973 main_loop 4,921,713 59,331 usb_start 9,345,345 4,423,632 id=175 When this patch is applied. ZynqMP> bootstage report Timer summary in microseconds (31 records): Mark Elapsed Stage 0 0 reset 2,465,624 2,465,624 board_init_f 4,278,628 1,813,004 board_init_r 4,825,139 546,511 eth_common_init 4,858,228 33,089 eth_initialize 4,862,201 3,973 main_loop 4,921,530 59,329 usb_start 8,885,334 3,963,804 cli_loop Signed-off-by: Michal Simek Reviewed-by: Simon Glass --- include/bootstage.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/bootstage.h b/include/bootstage.h index bca9438418f..7088d0b875e 100644 --- a/include/bootstage.h +++ b/include/bootstage.h @@ -268,12 +268,27 @@ ulong bootstage_add_record(enum bootstage_id id, const char *name, /** * Mark a time stamp for the current boot stage. */ -ulong bootstage_mark(enum bootstage_id id); - -ulong bootstage_error(enum bootstage_id id); +#define bootstage_mark(id) bootstage_mark_name(id, __func__) +#define bootstage_error(id) bootstage_error_name(id, __func__) +/** + * bootstage_mark_name - record bootstage with passing id and name + * @id: Bootstage id to record this timestamp against + * @name: Textual name to display for this id in the report + * + * Return: recorded time stamp + */ ulong bootstage_mark_name(enum bootstage_id id, const char *name); +/** + * bootstage_error_name - record bootstage error with passing id and name + * @id: Bootstage id to record this timestamp against + * @name: Textual name to display for this id in the report + * + * Return: recorded time stamp + */ +ulong bootstage_error_name(enum bootstage_id id, const char *name); + /** * Mark a time stamp in the given function and line number * -- cgit v1.2.3