From 7cbd2d2e327d2971d186c41cbfdc33b7e6ae6afc Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 18 Nov 2018 08:14:26 -0700 Subject: malloc_simple: Add logging of allocations It is sometimes useful to see what memory is being allocated early during boot. Add logging to support this, using a new LOGC_ALLOC category. Signed-off-by: Simon Glass --- include/log.h | 2 +- include/malloc.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/log.h b/include/log.h index c88a1b5eb4c..0f2bc19477f 100644 --- a/include/log.h +++ b/include/log.h @@ -114,7 +114,7 @@ int _log(enum log_category_t cat, enum log_level_t level, const char *file, /* Emit a log record if the level is less that the maximum */ #define log(_cat, _level, _fmt, _args...) ({ \ int _l = _level; \ - if (_l <= _LOG_MAX_LEVEL) \ + if (CONFIG_IS_ENABLED(LOG) && _l <= _LOG_MAX_LEVEL) \ _log((enum log_category_t)(_cat), _l, __FILE__, __LINE__, \ __func__, \ pr_fmt(_fmt), ##_args); \ diff --git a/include/malloc.h b/include/malloc.h index 8175c75920c..b714fedf457 100644 --- a/include/malloc.h +++ b/include/malloc.h @@ -880,6 +880,7 @@ static inline void free(void *ptr) {} void *calloc(size_t nmemb, size_t size); void *memalign_simple(size_t alignment, size_t bytes); void *realloc_simple(void *ptr, size_t size); +void malloc_simple_info(void); #else # ifdef USE_DL_PREFIX -- cgit v1.2.3