summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordp-arm <dimitris.papastamos@arm.com>2016-11-15 13:32:01 +0000
committerSandrine Bailleux <sandrine.bailleux@arm.com>2016-12-06 11:38:23 +0000
commiteb1c04e80cc7064cbd04ec10bfed4207e8957b77 (patch)
tree0d955110625df8fd72cdf099be7de813d65ebb58
parent4a28da27e380faf7f1cbf39b1e68ecadcdad5597 (diff)
Print cache flush overhead for runtime instrumentation tests
Change-Id: I9efd1bfa09238f47ac3bc29343c8db25ad63205b Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
-rw-r--r--tests/runtime_services/standard_service/pmf/api_tests/runtime_instr/test_pmf_rt_instr.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/tests/runtime_services/standard_service/pmf/api_tests/runtime_instr/test_pmf_rt_instr.c b/tests/runtime_services/standard_service/pmf/api_tests/runtime_instr/test_pmf_rt_instr.c
index caa37a5..e2efcd9 100644
--- a/tests/runtime_services/standard_service/pmf/api_tests/runtime_instr/test_pmf_rt_instr.c
+++ b/tests/runtime_services/standard_service/pmf/api_tests/runtime_instr/test_pmf_rt_instr.c
@@ -41,11 +41,13 @@
#include <tftf_lib.h>
#include <timer.h>
-#define TOTAL_IDS 4
+#define TOTAL_IDS 6
#define ENTER_PSCI 0
#define EXIT_PSCI 1
#define ENTER_HW_LOW_PWR 2
#define EXIT_HW_LOW_PWR 3
+#define ENTER_CFLUSH 4
+#define EXIT_CFLUSH 5
static spinlock_t cpu_count_lock;
static volatile int cpu_count;
@@ -126,6 +128,11 @@ static test_result_t check_pwr_down_ts(void)
return TEST_RESULT_FAIL;
}
+ if (ts[ENTER_CFLUSH] > ts[EXIT_CFLUSH]) {
+ tftf_testcase_printf("PMF timestamps are not correctly ordered\n");
+ return TEST_RESULT_FAIL;
+ }
+
return TEST_RESULT_SUCCESS;
}
@@ -155,13 +162,13 @@ static int dump_suspend_stats(void)
{
u_register_t *ts;
u_register_t target_mpid;
- uint64_t freq, cycles[2], period[2];
+ uint64_t freq, cycles[3], period[3];
int cpu_node, ret;
unsigned int pos;
freq = read_cntfrq_el0();
- tftf_testcase_printf("CPU\tENTRY\tEXIT\n");
+ tftf_testcase_printf("CPU\tENTRY\tEXIT\tCFLUSH OVERHEAD\n");
for_each_cpu(cpu_node) {
target_mpid = tftf_get_mpidr_from_node(cpu_node);
pos = platform_get_core_pos(target_mpid);
@@ -182,9 +189,17 @@ static int dump_suspend_stats(void)
return TEST_RESULT_FAIL;
}
- tftf_testcase_printf("%d\t%02llu us\t%02llu us\n", pos,
+ cycles[2] = ts[EXIT_CFLUSH] - ts[ENTER_CFLUSH];
+ ret = cycles_to_us(cycles[2], freq, &period[2]);
+ if (ret < 0) {
+ ERROR("cycles_to_us: out of range\n");
+ return TEST_RESULT_FAIL;
+ }
+
+ tftf_testcase_printf("%d\t%02llu us\t%02llu us\t%02llu us\n", pos,
(unsigned long long)period[0],
- (unsigned long long)period[1]);
+ (unsigned long long)period[1],
+ (unsigned long long)period[2]);
}
return TEST_RESULT_SUCCESS;