From a207d7b35bb30965c217128fb22de6b3e034c78f Mon Sep 17 00:00:00 2001 From: PulkoMandy Date: Mon, 16 Mar 2020 17:54:45 +0100 Subject: [PATCH] bootloader: reduce verbosity - Disable tracing where it's not needed by default - Convert some drpintf to TRACE statements - Comment some dprintf out completely in files that don't have a TRACE macro. Change-Id: I1f6062bce74bcf1dbf77bf7bccadeeb12a4df46c Reviewed-on: https://review.haiku-os.org/c/haiku/+/2370 Reviewed-by: waddlesplash --- .../boot/loader/load_driver_settings.cpp | 2 +- .../platform/openfirmware/arch/sparc/cpu.cpp | 2 +- .../platform/openfirmware/arch/sparc/mmu.cpp | 18 +++++++++--------- src/system/boot/platform/openfirmware/heap.cpp | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/system/boot/loader/load_driver_settings.cpp b/src/system/boot/loader/load_driver_settings.cpp index 129edd91c8..963cebe1d1 100644 --- a/src/system/boot/loader/load_driver_settings.cpp +++ b/src/system/boot/loader/load_driver_settings.cpp @@ -119,7 +119,7 @@ add_stage2_driver_settings(stage2_args* args) // TODO: split more intelligently for (const char** arg = args->arguments; arg != NULL && args->arguments_count-- && arg[0] != NULL; arg++) { - dprintf("adding args: '%s'\n", arg[0]); + //dprintf("adding args: '%s'\n", arg[0]); add_safe_mode_settings((char*)arg[0]); } return B_OK; diff --git a/src/system/boot/platform/openfirmware/arch/sparc/cpu.cpp b/src/system/boot/platform/openfirmware/arch/sparc/cpu.cpp index b8fd782078..6511626dcd 100644 --- a/src/system/boot/platform/openfirmware/arch/sparc/cpu.cpp +++ b/src/system/boot/platform/openfirmware/arch/sparc/cpu.cpp @@ -15,7 +15,7 @@ #include #include -#define TRACE_CPU +//#define TRACE_CPU #ifdef TRACE_CPU # define TRACE(x) dprintf x #else diff --git a/src/system/boot/platform/openfirmware/arch/sparc/mmu.cpp b/src/system/boot/platform/openfirmware/arch/sparc/mmu.cpp index 8b61d21c62..000f149790 100644 --- a/src/system/boot/platform/openfirmware/arch/sparc/mmu.cpp +++ b/src/system/boot/platform/openfirmware/arch/sparc/mmu.cpp @@ -71,7 +71,7 @@ remove_virtual_range_to_keep(void *start, uint32 size) static status_t find_physical_memory_ranges(size_t &total) { - dprintf("checking for memory...\n"); + TRACE("checking for memory...\n"); intptr_t package = of_instance_to_package(sMemoryInstance); total = 0; @@ -110,10 +110,10 @@ find_physical_memory_ranges(size_t &total) for (int32 i = 0; i < count; i++) { if (regions[i].size <= 0) { - dprintf("%d: empty region\n", i); + TRACE("%d: empty region\n", i); continue; } - dprintf("%" B_PRIu32 ": base = %" B_PRIx64 "," + TRACE("%" B_PRIu32 ": base = %" B_PRIx64 "," "size = %" B_PRIx64 "\n", i, regions[i].base, regions[i].size); total += regions[i].size; @@ -225,7 +225,7 @@ find_allocated_ranges(void **_exceptionHandlers) } length = length / sizeof(struct translation_map); uint32 total = 0; - dprintf("found %d translations\n", length); + TRACE("found %d translations\n", length); for (int i = 0; i < length; i++) { struct translation_map *map = &translations[i]; @@ -271,7 +271,7 @@ find_allocated_ranges(void **_exceptionHandlers) total += map->length; } - dprintf("total size kept: %" B_PRIu32 "\n", total); + TRACE("total size kept: %" B_PRIu32 "\n", total); // remove the boot loader code from the virtual ranges to keep in the // kernel @@ -576,7 +576,7 @@ arch_mmu_init(void) dprintf("Error: could not find physical memory ranges!\n"); return B_ERROR; } - dprintf("total physical memory = %luMB\n", total / (1024 * 1024)); + TRACE("total physical memory = %luMB\n", total / (1024 * 1024)); void *exceptionHandlers = (void *)-1; if (find_allocated_ranges(&exceptionHandlers) != B_OK) { @@ -600,11 +600,11 @@ arch_mmu_init(void) // set kernel args - dprintf("virt_allocated: %" B_PRIu32 "\n", + TRACE("virt_allocated: %" B_PRIu32 "\n", gKernelArgs.num_virtual_allocated_ranges); - dprintf("phys_allocated: %" B_PRIu32 "\n", + TRACE("phys_allocated: %" B_PRIu32 "\n", gKernelArgs.num_physical_allocated_ranges); - dprintf("phys_memory: %" B_PRIu32 "\n", + TRACE("phys_memory: %" B_PRIu32 "\n", gKernelArgs.num_physical_memory_ranges); #if 0 diff --git a/src/system/boot/platform/openfirmware/heap.cpp b/src/system/boot/platform/openfirmware/heap.cpp index 3ff41ad67d..277ec5a91c 100644 --- a/src/system/boot/platform/openfirmware/heap.cpp +++ b/src/system/boot/platform/openfirmware/heap.cpp @@ -12,7 +12,7 @@ #include -#define TRACE_HEAP 1 +//#define TRACE_HEAP 1 #if TRACE_HEAP # define TRACE(x) printf x #else