trace: Use notrace for short

The attribute syntax is quite verbose. Use the macro provided for this
purpose.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2022-12-21 16:08:15 -07:00
parent 5b958dea5c
commit 33c60a38bb
9 changed files with 22 additions and 25 deletions

View file

@ -82,7 +82,7 @@ unsigned long get_timer(unsigned long base)
return time_ms - base;
}
unsigned long __attribute__((no_instrument_function)) timer_get_us(void)
unsigned long notrace timer_get_us(void)
{
static unsigned long base_time_us;

View file

@ -248,7 +248,7 @@ static inline char *s5p_get_cpu_name(void)
}
#define IS_SAMSUNG_TYPE(type, id) \
static inline int __attribute__((no_instrument_function)) cpu_is_##type(void) \
static inline int notrace cpu_is_##type(void) \
{ \
return (s5p_cpu_id >> 12) == id; \
}
@ -257,7 +257,7 @@ IS_SAMSUNG_TYPE(exynos4, 0x4)
IS_SAMSUNG_TYPE(exynos5, 0x5)
#define IS_EXYNOS_TYPE(type, id) \
static inline int __attribute__((no_instrument_function)) \
static inline int notrace \
proid_is_##type(void) \
{ \
return s5p_cpu_id == id; \
@ -272,7 +272,7 @@ IS_EXYNOS_TYPE(exynos5422, 0x5422)
#define proid_is_exynos542x() (proid_is_exynos5420() || proid_is_exynos5422())
#define SAMSUNG_BASE(device, base) \
static inline unsigned long __attribute__((no_instrument_function)) \
static inline unsigned long notrace \
samsung_get_base_##device(void) \
{ \
if (cpu_is_exynos4()) { \

View file

@ -137,7 +137,7 @@ struct arch_global_data {
#define DECLARE_GLOBAL_DATA_PTR extern struct global_data *global_data_ptr
# else
static inline __attribute__((no_instrument_function)) gd_t *get_fs_gd_ptr(void)
static inline notrace gd_t *get_fs_gd_ptr(void)
{
gd_t *gd_ptr;

View file

@ -71,7 +71,7 @@ static inline unsigned long long native_read_tscp(unsigned int *aux)
#define EAX_EDX_RET(val, low, high) "=A" (val)
#endif
static inline __attribute__((no_instrument_function))
static inline notrace
unsigned long long native_read_msr(unsigned int msr)
{
DECLARE_ARGS(val, low, high);

View file

@ -108,7 +108,7 @@ void board_init_f_r(void) __attribute__ ((noreturn));
int arch_misc_init(void);
/* Read the time stamp counter */
static inline __attribute__((no_instrument_function)) uint64_t rdtsc(void)
static inline notrace uint64_t rdtsc(void)
{
uint32_t high, low;
__asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high));

View file

@ -599,6 +599,7 @@ static int spl_fit_upload_fpga(struct spl_fit_info *ctx, int node,
debug("Ignoring compatible = %s property\n",
compatible);
}
return 0;
ret = fpga_load(devnum, (void *)fpga_image->load_addr,
fpga_image->size, BIT_FULL, flags);

View file

@ -185,7 +185,7 @@ this produces sensible results for your board. Suitable sources for
this timer include high resolution timers, PWMs or profile timers if
available. Most modern SOCs have a suitable timer for this. Make sure
that you mark this timer (and anything it calls) with
__attribute__((no_instrument_function)) so that the trace library can
notrace so that the trace library can
use it without causing an infinite loop.

View file

@ -100,7 +100,7 @@ void *memset(void *s, int c, size_t n)
* func_ptr: Pointer to function being entered
* caller: Pointer to function which called this function
*/
void __attribute__((no_instrument_function))
void notrace
__cyg_profile_func_enter(void *func_ptr, void *caller)
{
}
@ -116,7 +116,7 @@ __cyg_profile_func_enter(void *func_ptr, void *caller)
* func_ptr: Pointer to function being entered
* caller: Pointer to function which called this function
*/
void __attribute__((no_instrument_function))
void notrace
__cyg_profile_func_exit(void *func_ptr, void *caller)
{
}

View file

@ -68,7 +68,7 @@ static volatile gd_t *trace_gd;
/**
* trace_save_gd() - save the value of the gd register
*/
static void __attribute__((no_instrument_function)) trace_save_gd(void)
static void notrace trace_save_gd(void)
{
trace_gd = gd;
}
@ -81,7 +81,7 @@ static void __attribute__((no_instrument_function)) trace_save_gd(void)
* have to set the gd register to the U-Boot value when entering a trace
* point and set it back to the application value when exiting the trace point.
*/
static void __attribute__((no_instrument_function)) trace_swap_gd(void)
static void notrace trace_swap_gd(void)
{
volatile gd_t *temp_gd = trace_gd;
@ -91,18 +91,17 @@ static void __attribute__((no_instrument_function)) trace_swap_gd(void)
#else
static void __attribute__((no_instrument_function)) trace_save_gd(void)
static void notrace trace_save_gd(void)
{
}
static void __attribute__((no_instrument_function)) trace_swap_gd(void)
static void notrace trace_swap_gd(void)
{
}
#endif
static void __attribute__((no_instrument_function)) add_ftrace(void *func_ptr,
void *caller, ulong flags)
static void notrace add_ftrace(void *func_ptr, void *caller, ulong flags)
{
if (hdr->depth > hdr->depth_limit) {
hdr->ftrace_too_deep_count++;
@ -118,7 +117,7 @@ static void __attribute__((no_instrument_function)) add_ftrace(void *func_ptr,
hdr->ftrace_count++;
}
static void __attribute__((no_instrument_function)) add_textbase(void)
static void notrace add_textbase(void)
{
if (hdr->ftrace_count < hdr->ftrace_size) {
struct trace_call *rec = &hdr->ftrace[hdr->ftrace_count];
@ -139,8 +138,7 @@ static void __attribute__((no_instrument_function)) add_textbase(void)
* @func_ptr: pointer to function being entered
* @caller: pointer to function which called this function
*/
void __attribute__((no_instrument_function)) __cyg_profile_func_enter(
void *func_ptr, void *caller)
void notrace __cyg_profile_func_enter(void *func_ptr, void *caller)
{
if (trace_enabled) {
int func;
@ -167,8 +165,7 @@ void __attribute__((no_instrument_function)) __cyg_profile_func_enter(
* @func_ptr: pointer to function being entered
* @caller: pointer to function which called this function
*/
void __attribute__((no_instrument_function)) __cyg_profile_func_exit(
void *func_ptr, void *caller)
void notrace __cyg_profile_func_exit(void *func_ptr, void *caller)
{
if (trace_enabled) {
trace_swap_gd();
@ -327,7 +324,7 @@ void trace_print_stats(void)
puts(" calls not traced due to depth\n");
}
void __attribute__((no_instrument_function)) trace_set_enabled(int enabled)
void notrace trace_set_enabled(int enabled)
{
trace_enabled = enabled != 0;
}
@ -339,8 +336,7 @@ void __attribute__((no_instrument_function)) trace_set_enabled(int enabled)
* @buff_size: Size of trace buffer
* Return: 0 if ok
*/
int __attribute__((no_instrument_function)) trace_init(void *buff,
size_t buff_size)
int notrace trace_init(void *buff, size_t buff_size)
{
ulong func_count = gd->mon_len / FUNC_SITE_SIZE;
size_t needed;
@ -404,7 +400,7 @@ int __attribute__((no_instrument_function)) trace_init(void *buff,
*
* Return: 0 if ok, -ENOSPC if not enough memory is available
*/
int __attribute__((no_instrument_function)) trace_early_init(void)
int notrace trace_early_init(void)
{
ulong func_count = gd->mon_len / FUNC_SITE_SIZE;
size_t buff_size = CONFIG_TRACE_EARLY_SIZE;