lib/trace: Remove TRACE support
Looks like the option is generally not compatible with garbage collections. Nothing gets inlined, for example is_smp_boot() no longer evaluates to constant false and thus the symbols from secondary.S would need to be present for the build to pass even if we set SMP=n. Also the addresses of relocatable ramstage are currently not normalised on the logs, so util/genprof would be unable dress those. Change-Id: I0b6f310e15e6f4992cd054d288903fea8390e5cf Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/45757 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
committed by
Nico Huber
parent
5e053af7a6
commit
8c99c27df1
13
src/Kconfig
13
src/Kconfig
@@ -1113,23 +1113,12 @@ config DEBUG_INTEL_ME
|
||||
is present on Intel 6-series chipsets.
|
||||
endif
|
||||
|
||||
config TRACE
|
||||
bool "Trace function calls"
|
||||
default n
|
||||
help
|
||||
If enabled, every function will print information to console once
|
||||
the function is entered. The syntax is ~0xaaaabbbb(0xccccdddd)
|
||||
the 0xaaaabbbb is the actual function and 0xccccdddd is EIP
|
||||
of calling function. Please note some printk related functions
|
||||
are omitted from trace to have good looking console dumps.
|
||||
|
||||
config DEBUG_FUNC
|
||||
bool "Enable function entry and exit reporting macros" if DEFAULT_CONSOLE_LOGLEVEL_8
|
||||
default n
|
||||
help
|
||||
This option enables additional function entry and exit debug messages
|
||||
for select functions. If supported, this is less output than
|
||||
the TRACE option.
|
||||
for select functions.
|
||||
Note: This option will increase the size of the coreboot image.
|
||||
If unsure, say N.
|
||||
|
||||
|
@@ -10,7 +10,6 @@
|
||||
#include <console/vtxprintf.h>
|
||||
#include <smp/spinlock.h>
|
||||
#include <smp/node.h>
|
||||
#include <trace.h>
|
||||
#include <timer.h>
|
||||
|
||||
DECLARE_SPIN_LOCK(console_lock)
|
||||
@@ -81,7 +80,6 @@ int do_vprintk(int msg_level, const char *fmt, va_list args)
|
||||
if (log_this < CONSOLE_LOG_FAST)
|
||||
return 0;
|
||||
|
||||
DISABLE_TRACE;
|
||||
spin_lock(&console_lock);
|
||||
|
||||
console_time_run();
|
||||
@@ -96,7 +94,6 @@ int do_vprintk(int msg_level, const char *fmt, va_list args)
|
||||
console_time_stop();
|
||||
|
||||
spin_unlock(&console_lock);
|
||||
ENABLE_TRACE;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
@@ -2,7 +2,6 @@
|
||||
|
||||
#include <console/vtxprintf.h>
|
||||
#include <string.h>
|
||||
#include <trace.h>
|
||||
|
||||
struct vsnprintf_context {
|
||||
char *str_buf;
|
||||
@@ -24,16 +23,12 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
|
||||
int i;
|
||||
struct vsnprintf_context ctx;
|
||||
|
||||
DISABLE_TRACE;
|
||||
|
||||
ctx.str_buf = buf;
|
||||
ctx.buf_limit = size ? size - 1 : 0;
|
||||
i = vtxprintf(str_tx_byte, fmt, args, &ctx);
|
||||
if (size)
|
||||
*ctx.str_buf = '\0';
|
||||
|
||||
ENABLE_TRACE;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
|
@@ -3,7 +3,6 @@
|
||||
#include <arch/io.h>
|
||||
#include <boot/coreboot_tables.h>
|
||||
#include <console/uart.h>
|
||||
#include <trace.h>
|
||||
#include "uart8250reg.h"
|
||||
|
||||
/* Should support 8250, 16450, 16550, 16550A type UARTs */
|
||||
@@ -54,7 +53,6 @@ static unsigned char uart8250_rx_byte(unsigned int base_port)
|
||||
|
||||
static void uart8250_init(unsigned int base_port, unsigned int divisor)
|
||||
{
|
||||
DISABLE_TRACE;
|
||||
/* Disable interrupts */
|
||||
outb(0x0, base_port + UART8250_IER);
|
||||
/* Enable FIFOs */
|
||||
@@ -72,7 +70,6 @@ static void uart8250_init(unsigned int base_port, unsigned int divisor)
|
||||
|
||||
/* Set to 3 for 8N1 */
|
||||
outb(CONFIG_TTYS0_LCS, base_port + UART8250_LCR);
|
||||
ENABLE_TRACE;
|
||||
}
|
||||
|
||||
static const unsigned int bases[] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
|
||||
|
@@ -1,28 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#ifndef __TRACE_H
|
||||
#define __TRACE_H
|
||||
|
||||
#if !ENV_ROMSTAGE_OR_BEFORE && CONFIG(TRACE)
|
||||
|
||||
void __cyg_profile_func_enter(void *, void *)
|
||||
__attribute__((no_instrument_function));
|
||||
|
||||
void __cyg_profile_func_exit(void *, void *)
|
||||
__attribute__((no_instrument_function));
|
||||
|
||||
extern volatile int trace_dis;
|
||||
|
||||
#define DISABLE_TRACE do { trace_dis = 1; } while (0);
|
||||
#define ENABLE_TRACE do { trace_dis = 0; } while (0);
|
||||
#define DISABLE_TRACE_ON_FUNCTION __attribute__((no_instrument_function));
|
||||
|
||||
#else /* !CONFIG_TRACE */
|
||||
|
||||
#define DISABLE_TRACE
|
||||
#define ENABLE_TRACE
|
||||
#define DISABLE_TRACE_ON_FUNCTION
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
@@ -140,8 +140,6 @@ ramstage-y += wrdd.c
|
||||
ramstage-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c
|
||||
ramstage-$(CONFIG_BOOTSPLASH) += bootsplash.c
|
||||
ramstage-$(CONFIG_BOOTSPLASH) += jpeg.c
|
||||
ramstage-$(CONFIG_TRACE) += trace.c
|
||||
postcar-$(CONFIG_TRACE) += trace.c
|
||||
ramstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
|
||||
ramstage-$(CONFIG_COVERAGE) += libgcov.c
|
||||
ramstage-y += edid.c
|
||||
|
@@ -1,21 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <console/console.h>
|
||||
#include <trace.h>
|
||||
|
||||
int volatile trace_dis = 0;
|
||||
|
||||
void __cyg_profile_func_enter(void *func, void *callsite)
|
||||
{
|
||||
|
||||
if (trace_dis)
|
||||
return;
|
||||
|
||||
DISABLE_TRACE
|
||||
printk(BIOS_INFO, "~%p(%p)\n", func, callsite);
|
||||
ENABLE_TRACE
|
||||
}
|
||||
|
||||
void __cyg_profile_func_exit(void *func, void *callsite)
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user