Angel Pons | 32859fc | 2020-04-02 23:48:27 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
Rudolf Marek | 7f0e930 | 2011-09-02 23:23:41 +0200 | [diff] [blame] | 3 | |
| 4 | #ifndef __TRACE_H |
| 5 | #define __TRACE_H |
| 6 | |
Kyösti Mälkki | 7596c54 | 2019-09-13 10:51:04 +0300 | [diff] [blame] | 7 | #if !ENV_ROMSTAGE_OR_BEFORE && CONFIG(TRACE) |
Rudolf Marek | 7f0e930 | 2011-09-02 23:23:41 +0200 | [diff] [blame] | 8 | |
Lee Leahy | 91d1e76 | 2017-03-07 14:31:19 -0800 | [diff] [blame] | 9 | void __cyg_profile_func_enter(void *, void *) |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 10 | __attribute__((no_instrument_function)); |
Rudolf Marek | 7f0e930 | 2011-09-02 23:23:41 +0200 | [diff] [blame] | 11 | |
Lee Leahy | 91d1e76 | 2017-03-07 14:31:19 -0800 | [diff] [blame] | 12 | void __cyg_profile_func_exit(void *, void *) |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 13 | __attribute__((no_instrument_function)); |
Rudolf Marek | 7f0e930 | 2011-09-02 23:23:41 +0200 | [diff] [blame] | 14 | |
| 15 | extern volatile int trace_dis; |
| 16 | |
| 17 | #define DISABLE_TRACE do { trace_dis = 1; } while (0); |
| 18 | #define ENABLE_TRACE do { trace_dis = 0; } while (0); |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 19 | #define DISABLE_TRACE_ON_FUNCTION __attribute__((no_instrument_function)); |
Rudolf Marek | 7f0e930 | 2011-09-02 23:23:41 +0200 | [diff] [blame] | 20 | |
| 21 | #else /* !CONFIG_TRACE */ |
| 22 | |
| 23 | #define DISABLE_TRACE |
| 24 | #define ENABLE_TRACE |
| 25 | #define DISABLE_TRACE_ON_FUNCTION |
| 26 | |
| 27 | #endif |
Kyösti Mälkki | 7596c54 | 2019-09-13 10:51:04 +0300 | [diff] [blame] | 28 | |
Rudolf Marek | 7f0e930 | 2011-09-02 23:23:41 +0200 | [diff] [blame] | 29 | #endif |