diff options
author | Ovidiu Mihalachi <ovidiu_mihalachi@mentor.com> | 2018-11-05 12:05:51 +0200 |
---|---|---|
committer | Jerome Forissier <jerome.forissier@linaro.org> | 2018-11-13 18:10:15 +0100 |
commit | 3f58e4ec10c5df57bad1296bb9a5cbc7bfacaef1 (patch) | |
tree | 8fb955cda8cd10bdbc062caf6df4acddc26dcd00 /mk/config.mk | |
parent | 7445d9ac558e1ff385af4773775ed68f61aed0d3 (diff) |
trace levels: Redefine TRACE_MIN level to 0
The global `trace_level` session-wise indicator which is set by
`trace_set_level()` [1], could get a wrong value in case of an
input `level` set to 0, meaning that all logs need to be disabled
by user define `CFG_TEE_TA_LOG_LEVEL=0` when building TA applications.
This inconsistency is caused by a rather wrong value of `TRACE_MIN`
low boundary value set to 1. According to [1] `trace level` will be
set to `TRACE_MAX` (4) in case input level is smaller than `TRACE_MIN`
and larger than `TRACE_MAX`.
In the scenario when the needed log level is 0, `trace level` would be
set to `TRACE_MAX` and will cause a lot of flow log level information
dumped by trace functions/macros that are using `trace_printf()`
primitive.
This patch sets the `TRACE_MIN` to 0 in order to assure a proper trace
level setting and completely disable all logs in case
`CFG_TEE_TA_LOG_LEVEL=0`.
[1]
void trace_set_level(int level)
{
if (((int)level >= TRACE_MIN) && (level <= TRACE_MAX))
trace_level = level;
else
trace_level = TRACE_MAX;
}
Acked-by: Christoph Gellner <cgellner@de.adit-jv.com>
Signed-off-by: Ovidiu Mihalachi <ovidiu_mihalachi@mentor.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Diffstat (limited to 'mk/config.mk')
-rw-r--r-- | mk/config.mk | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mk/config.mk b/mk/config.mk index 84af869c..6739cdc0 100644 --- a/mk/config.mk +++ b/mk/config.mk @@ -41,14 +41,20 @@ WARNS ?= 3 # so assertions are disabled. CFG_TEE_CORE_DEBUG ?= y -# Log levels for the TEE core and user-mode TAs -# Defines which messages are displayed on the secure console +# Log levels for the TEE core. Defines which core messages are displayed +# on the secure console. Disabling core log (level set to 0) also disables +# logs from the TAs. # 0: none # 1: error # 2: error + warning # 3: error + warning + debug # 4: error + warning + debug + flow CFG_TEE_CORE_LOG_LEVEL ?= 1 + +# TA log level +# If user-mode library libutils.a is built with CFG_TEE_TA_LOG_LEVEL=0, +# TA tracing is disabled regardless of the value of CFG_TEE_TA_LOG_LEVEL +# when the TA is built. CFG_TEE_TA_LOG_LEVEL ?= 1 # TA enablement |