tests: latency_measure: Change reporting strings

Changes the summary lines used in the latency_measure benchmark
so that they follow a consistent pattern.

    OBJECT  action.<brief details about action>

This makes it easier to locate results belonging to a particular
object group. It also has the benefit to keep results colocated
should the output be sorted by an external tool.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
This commit is contained in:
Peter Mitsis 2024-01-03 13:40:06 -05:00 committed by Alberto Escolar
commit 911182c6b9
6 changed files with 19 additions and 19 deletions

View file

@ -63,9 +63,9 @@ void heap_malloc_free(void)
notes = "Memory heap too small--increase it.";
}
PRINT_STATS_AVG("Average time for heap malloc", sum_malloc, count,
PRINT_STATS_AVG("HEAP malloc.immediate", sum_malloc, count,
failed, notes);
PRINT_STATS_AVG("Average time for heap free", sum_free, count,
PRINT_STATS_AVG("HEAP free.immediate", sum_free, count,
failed, notes);
timing_stop();

View file

@ -174,7 +174,7 @@ int int_to_thread(uint32_t num_iterations)
sum -= timestamp_overhead_adjustment(0, 0);
PRINT_STATS_AVG("Switch from ISR back to interrupted thread",
PRINT_STATS_AVG("ISR resume.interrupted.thread.kernel",
(uint32_t)sum, num_iterations, false, "");
/* ************** */
@ -183,7 +183,7 @@ int int_to_thread(uint32_t num_iterations)
sum -= timestamp_overhead_adjustment(0, 0);
PRINT_STATS_AVG("Switch from ISR to another thread (kernel)",
PRINT_STATS_AVG("ISR resume.different.thread.kernel",
(uint32_t)sum, num_iterations, false, "");
/* ************** */
@ -193,7 +193,7 @@ int int_to_thread(uint32_t num_iterations)
sum -= timestamp_overhead_adjustment(0, K_USER);
PRINT_STATS_AVG("Switch from ISR to another thread (user)",
PRINT_STATS_AVG("ISR resume.different.thread.user",
(uint32_t)sum, num_iterations, false, "");
#endif

View file

@ -94,7 +94,7 @@ int mutex_lock_unlock(uint32_t num_iterations, uint32_t options)
k_sem_give(&pause_sem);
snprintf(description, sizeof(description),
"Lock a mutex from %s thread",
"MUTEX lock.immediate.recursive.%s",
(options & K_USER) == K_USER ? "user" : "kernel");
PRINT_STATS_AVG(description, (uint32_t)cycles, num_iterations,
false, "");
@ -102,7 +102,7 @@ int mutex_lock_unlock(uint32_t num_iterations, uint32_t options)
cycles = timestamp.cycles;
snprintf(description, sizeof(description),
"Unlock a mutex from %s thread",
"MUTEX unlock.immediate.recursive.%s",
(options & K_USER) == K_USER ? "user" : "kernel");
PRINT_STATS_AVG(description, (uint32_t)cycles, num_iterations,
false, "");

View file

@ -139,7 +139,7 @@ void sema_context_switch(uint32_t num_iterations,
cycles -= timestamp_overhead_adjustment(start_options, alt_options);
snprintf(description, sizeof(description),
"Take a semaphore (context switch %c -> %c)",
"SEMAPHORE take.blocking.(%c -> %c)",
((start_options & K_USER) == K_USER) ? 'U' : 'K',
((alt_options & K_USER) == K_USER) ? 'U' : 'K');
PRINT_STATS_AVG(description, (uint32_t)cycles,
@ -155,7 +155,7 @@ void sema_context_switch(uint32_t num_iterations,
cycles -= timestamp_overhead_adjustment(start_options, alt_options);
snprintf(description, sizeof(description),
"Give a semaphore (context switch %c -> %c)",
"SEMAPHORE give.wake+ctx.(%c -> %c)",
((alt_options & K_USER) == K_USER) ? 'U' : 'K',
((start_options & K_USER) == K_USER) ? 'U' : 'K');
PRINT_STATS_AVG(description, (uint32_t)cycles,
@ -255,7 +255,7 @@ int sema_test_signal(uint32_t num_iterations, uint32_t options)
cycles = timestamp.cycles;
snprintf(description, sizeof(description),
"Give a semaphore (no waiters) from %s thread",
"SEMAPHORE give.immediate.%s",
(options & K_USER) == K_USER ? "user" : "kernel");
PRINT_STATS_AVG(description, (uint32_t)cycles,
@ -274,7 +274,7 @@ int sema_test_signal(uint32_t num_iterations, uint32_t options)
cycles = timestamp.cycles;
snprintf(description, sizeof(description),
"Take a semaphore (no blocking) from %s thread",
"SEMAPHORE take.immediate.%s",
(options & K_USER) == K_USER ? "user" : "kernel");
PRINT_STATS_AVG(description, (uint32_t)cycles,

View file

@ -248,7 +248,7 @@ int thread_ops(uint32_t num_iterations, uint32_t start_options, uint32_t alt_opt
/* Only report stats if <start_thread> created <alt_thread> */
snprintf(description, sizeof(description),
"Create %s thread from %s thread",
"THREAD create.%s.from.%s",
(alt_options & K_USER) != 0 ? "user" : "kernel",
(start_options & K_USER) != 0 ? "user" : "kernel");
@ -261,7 +261,7 @@ int thread_ops(uint32_t num_iterations, uint32_t start_options, uint32_t alt_opt
k_sem_give(&pause_sem);
snprintf(description, sizeof(description),
"Start %s thread from %s thread",
"THREAD start.%s.from.%s",
(alt_options & K_USER) != 0 ? "user" : "kernel",
(start_options & K_USER) != 0 ? "user" : "kernel");
@ -273,7 +273,7 @@ int thread_ops(uint32_t num_iterations, uint32_t start_options, uint32_t alt_opt
k_sem_give(&pause_sem);
snprintf(description, sizeof(description),
"Suspend %s thread from %s thread",
"THREAD suspend.%s.from.%s",
(alt_options & K_USER) != 0 ? "user" : "kernel",
(start_options & K_USER) != 0 ? "user" : "kernel");
@ -285,7 +285,7 @@ int thread_ops(uint32_t num_iterations, uint32_t start_options, uint32_t alt_opt
k_sem_give(&pause_sem);
snprintf(description, sizeof(description),
"Resume %s thread from %s thread",
"THREAD resume.%s.from.%s",
(alt_options & K_USER) != 0 ? "user" : "kernel",
(start_options & K_USER) != 0 ? "user" : "kernel");
@ -297,7 +297,7 @@ int thread_ops(uint32_t num_iterations, uint32_t start_options, uint32_t alt_opt
k_sem_give(&pause_sem);
snprintf(description, sizeof(description),
"Abort %s thread from %s thread",
"THREAD abort.%s.from.%s",
(alt_options & K_USER) != 0 ? "user" : "kernel",
(start_options & K_USER) != 0 ? "user" : "kernel");

View file

@ -131,7 +131,7 @@ static void thread_switch_yield_common(const char *description,
sum -= timestamp_overhead_adjustment(start_options, alt_options);
snprintf(summary, sizeof(summary),
"%s (%c -> %c)",
"%s.(%c -> %c)",
description,
(start_options & K_USER) == K_USER ? 'U' : 'K',
(alt_options & K_USER) == K_USER ? 'U' : 'K');
@ -148,8 +148,8 @@ void thread_switch_yield(uint32_t num_iterations, bool is_cooperative)
: k_thread_priority_get(k_current_get()) - 1;
snprintf(description, sizeof(description),
"%s threads ctx switch via k_yield",
is_cooperative ? "Cooperative" : "Preemptive");
"THREAD yield.%s.ctx",
is_cooperative ? "cooperative" : "preemptive");
/* Kernel -> Kernel */
thread_switch_yield_common(description, num_iterations, 0, 0,