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