xref: /optee_os/lib/libutils/ext/include/trace_levels.h (revision 1bb929836182ecb96d2d9d268daa807c67596396)
1*1bb92983SJerome Forissier /* SPDX-License-Identifier: BSD-2-Clause */
24de4bebcSJens Wiklander /*
34de4bebcSJens Wiklander  * Copyright (c) 2014, STMicroelectronics International N.V.
44de4bebcSJens Wiklander  * All rights reserved.
54de4bebcSJens Wiklander  *
64de4bebcSJens Wiklander  * Redistribution and use in source and binary forms, with or without
74de4bebcSJens Wiklander  * modification, are permitted provided that the following conditions are met:
84de4bebcSJens Wiklander  *
94de4bebcSJens Wiklander  * 1. Redistributions of source code must retain the above copyright notice,
104de4bebcSJens Wiklander  * this list of conditions and the following disclaimer.
114de4bebcSJens Wiklander  *
124de4bebcSJens Wiklander  * 2. Redistributions in binary form must reproduce the above copyright notice,
134de4bebcSJens Wiklander  * this list of conditions and the following disclaimer in the documentation
144de4bebcSJens Wiklander  * and/or other materials provided with the distribution.
154de4bebcSJens Wiklander  *
164de4bebcSJens Wiklander  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
174de4bebcSJens Wiklander  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
184de4bebcSJens Wiklander  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
194de4bebcSJens Wiklander  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
204de4bebcSJens Wiklander  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
214de4bebcSJens Wiklander  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
224de4bebcSJens Wiklander  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
234de4bebcSJens Wiklander  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
244de4bebcSJens Wiklander  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
254de4bebcSJens Wiklander  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
264de4bebcSJens Wiklander  * POSSIBILITY OF SUCH DAMAGE.
274de4bebcSJens Wiklander  */
284de4bebcSJens Wiklander #ifndef TRACE_LEVELS_H
294de4bebcSJens Wiklander #define TRACE_LEVELS_H
304de4bebcSJens Wiklander 
314de4bebcSJens Wiklander /*
324de4bebcSJens Wiklander  * Trace levels.
334de4bebcSJens Wiklander  *
344de4bebcSJens Wiklander  * ALWAYS is used when you always want a print to be seen, but it is not always
354de4bebcSJens Wiklander  * an error.
364de4bebcSJens Wiklander  *
374de4bebcSJens Wiklander  * ERROR is used when some kind of error has happened, this is most likely the
384de4bebcSJens Wiklander  * print you will use most of the time when you report some kind of error.
394de4bebcSJens Wiklander  *
404de4bebcSJens Wiklander  * INFO is used when you want to print some 'normal' text to the user.
414de4bebcSJens Wiklander  * This is the default level.
424de4bebcSJens Wiklander  *
434de4bebcSJens Wiklander  * DEBUG is used to print extra information to enter deeply in the module.
444de4bebcSJens Wiklander  *
454de4bebcSJens Wiklander  * FLOW is used to print the execution flox, typically the in/out of functions.
464de4bebcSJens Wiklander  *
474de4bebcSJens Wiklander  */
484de4bebcSJens Wiklander 
494de4bebcSJens Wiklander #define TRACE_MIN       1
504de4bebcSJens Wiklander #define TRACE_ERROR     TRACE_MIN
514de4bebcSJens Wiklander #define TRACE_INFO      2
524de4bebcSJens Wiklander #define TRACE_DEBUG     3
534de4bebcSJens Wiklander #define TRACE_FLOW      4
544de4bebcSJens Wiklander #define TRACE_MAX       TRACE_FLOW
554de4bebcSJens Wiklander 
564de4bebcSJens Wiklander /* Trace level of the casual printf */
574de4bebcSJens Wiklander #define TRACE_PRINTF_LEVEL TRACE_ERROR
584de4bebcSJens Wiklander 
594de4bebcSJens Wiklander #endif /*TRACE_LEVELS_H*/
60