summaryrefslogtreecommitdiff
path: root/framework/main.c
diff options
context:
space:
mode:
authorVikram Kanigiri <vikram.kanigiri@arm.com>2015-01-16 16:21:34 +0000
committerSandrine Bailleux <sandrine.bailleux@arm.com>2015-02-16 12:51:55 +0000
commitceab3fa7039e64bb953e1f8aeef37e826fec028c (patch)
treef4ee80f7538c4a056a87933723ac2ff9f0f1eca6 /framework/main.c
parent9757e1bdcd8de37d00ab5358c9efc07bb0191782 (diff)
Add support and rationalize output to different log levels
This patch adds support for different log levels and sets the default log level of 20 and 40 for release and debug builds respectively. It also differentiates the current printed logs into different log levels. Change-Id: I845074f45ddb2b11c9844f0b082f776b9944c4d9
Diffstat (limited to 'framework/main.c')
-rw-r--r--framework/main.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/framework/main.c b/framework/main.c
index caeb3ef..ff221a1 100644
--- a/framework/main.c
+++ b/framework/main.c
@@ -25,7 +25,6 @@
#include <power_management.h>
#include <psci.h>
#include <sgi.h>
-#include <stdio.h>
#include <string.h>
#include <tftf.h>
#include <tftf_lib.h>
@@ -116,7 +115,7 @@ static void prepare_next_test(void)
for (unsigned int i = 0; i < PLATFORM_CORE_COUNT; ++i)
test_results[i] = TEST_NOT_RUN;
- mp_printf("Starting unittest '%s - %s'\n",
+ NOTICE("Starting unittest '%s - %s'\n",
current_testsuite()->name, current_testcase()->name);
/* Program the watchdog */
@@ -134,7 +133,7 @@ static TEST_RESULT get_overall_test_result(void)
for (unsigned int i = 0; i < PLATFORM_CORE_COUNT; ++i) {
switch (test_results[i]) {
case TEST_NOT_RUN:
- pr_debug("CPU%u not involved in the test\n", i);
+ VERBOSE("CPU%u not involved in the test\n", i);
/* Ignoring */
break;
@@ -143,14 +142,14 @@ static TEST_RESULT get_overall_test_result(void)
* If at least one CPU skipped the test, consider the
* whole test as skipped as well.
*/
- pr_debug("CPU%u skipped the test\n", i);
+ NOTICE("CPU%u skipped the test\n", i);
return TEST_RESULT_SKIPPED;
case TEST_RESULT_SUCCESS:
break;
case TEST_RESULT_FAIL:
- pr_debug("CPU%u failed the test\n", i);
+ ERROR("CPU%u failed the test\n", i);
return TEST_RESULT_FAIL;
case TEST_STARTING:
@@ -160,11 +159,11 @@ static TEST_RESULT get_overall_test_result(void)
* implementation or some sort of unexpected crash
* happened.
*/
- pr_debug("CPU%u never returned from the test!\n", i);
+ ERROR("CPU%u never returned from the test!\n", i);
return TEST_RESULT_CRASHED;
default:
- pr_debug("Unknown test result value: %u\n",
+ ERROR("Unknown test result value: %u\n",
test_results[i]);
panic();
}
@@ -226,7 +225,7 @@ static void __dead2 hand_over_to_lead_cpu(void)
unsigned int mpid = read_mpidr_el1() & 0xFFFFFF;
unsigned int core_pos = platform_get_core_pos(mpid);
- pr_debug("CPU%u: Hand over to lead CPU%u\n", core_pos,
+ VERBOSE("CPU%u: Hand over to lead CPU%u\n", core_pos,
platform_get_core_pos(lead_cpu_mpid));
/*
@@ -238,7 +237,7 @@ static void __dead2 hand_over_to_lead_cpu(void)
*/
ret = tftf_cpu_on(lead_cpu_mpid, 0, 0);
if (ret != PSCI_E_SUCCESS) {
- printf("CPU%u: Failed to power on lead CPU%u (%d)\n",
+ ERROR("CPU%u: Failed to power on lead CPU%u (%d)\n",
core_pos, platform_get_core_pos(lead_cpu_mpid), ret);
panic();
}
@@ -323,9 +322,9 @@ void __dead2 tftf_cold_boot_main(void)
TESTCASE_FUNC crashed_testcase_function;
int rc;
- printf("%s\n", TFTF_WELCOME_STR);
- printf("%s\n", build_message);
- printf("%s\n", version_string);
+ NOTICE("%s\n", TFTF_WELCOME_STR);
+ NOTICE("%s\n", build_message);
+ NOTICE("%s\n", version_string);
tftf_arch_setup();
tftf_platform_setup();
@@ -335,7 +334,7 @@ void __dead2 tftf_cold_boot_main(void)
rc = tftf_systimer_setup();
if (rc != 0) {
- printf("Error: Failed to initialize the system timer (%d).\n", rc);
+ ERROR("Failed to initialize the system timer (%d).\n", rc);
tftf_exit();
}
@@ -350,7 +349,7 @@ void __dead2 tftf_cold_boot_main(void)
* structures have not been initialised. There's no point in
* continuing execution.
*/
- printf("FATAL: Failed to initialise internal data structures in NVM.\n");
+ ERROR("FATAL: Failed to initialise internal data structures in NVM.\n");
tftf_clean_nvm();
tftf_exit();
}
@@ -366,9 +365,9 @@ void __dead2 tftf_cold_boot_main(void)
&cur_testcase,
0);
if (status == STATUS_SUCCESS) {
- printf("Resuming test execution.\n");
+ NOTICE("Resuming test execution.\n");
} else {
- printf("Warning: Failed to resume the test execution.\n");
+ NOTICE("Warning: Failed to resume the test execution.\n");
}
}
@@ -380,9 +379,9 @@ void __dead2 tftf_cold_boot_main(void)
&cur_testcase,
1);
if (status == STATUS_SUCCESS) {
- printf("Recovering test execution.\n");
+ NOTICE("Recovering test execution.\n");
} else {
- printf("Warning: Failed to recover the test execution.\n");
+ NOTICE("Warning: Failed to recover the test execution.\n");
}
/* Mark the test as crashed */