aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPetri Savolainen <petri.savolainen@nokia.com>2022-11-23 14:45:20 +0200
committerPetri Savolainen <petri.savolainen@nokia.com>2022-11-28 17:10:24 +0200
commit1debaf40e89bea9ce8c3c72505bc69a62daa39fa (patch)
tree552f5f9eb033de24615d7fe765f28bcd9ed46077 /test
parent354d9e48cc98d18c1fc0c7a19fbfaf0dd854fa4b (diff)
test: sched_latency: record index of max latency event
Added index of the highest latency sample event into statistics. It may help in finding the reason for high latency events (high latency only during start up vs randomly). Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Diffstat (limited to 'test')
-rw-r--r--test/performance/odp_sched_latency.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/test/performance/odp_sched_latency.c b/test/performance/odp_sched_latency.c
index 81ca53ce6..6475f49f8 100644
--- a/test/performance/odp_sched_latency.c
+++ b/test/performance/odp_sched_latency.c
@@ -103,6 +103,7 @@ typedef struct {
uint64_t tot; /**< Total event latency. Sum of all events. */
uint64_t min; /**< Minimum event latency */
uint64_t max; /**< Maximum event latency */
+ uint64_t max_idx; /**< Index of the maximum latency sample event */
} test_stat_t;
/** Performance test statistics (per core) */
@@ -310,8 +311,8 @@ static void print_results(test_globals_t *globals)
total.min = UINT64_MAX;
printf("%s priority\n"
- "Thread Avg[ns] Min[ns] Max[ns] Samples Total\n"
- "---------------------------------------------------------------\n",
+ "Thread Avg[ns] Min[ns] Max[ns] Samples Total Max idx\n"
+ "-----------------------------------------------------------------------\n",
i == HI_PRIO ? "HIGH" : "LOW");
for (j = 1; j <= args->cpu_count; j++) {
lat = &globals->core_stat[j].prio[i];
@@ -331,11 +332,11 @@ static void print_results(test_globals_t *globals)
avg = lat->events ? lat->tot / lat->sample_events : 0;
printf("%-8d %-10" PRIu64 " %-10" PRIu64 " "
- "%-10" PRIu64 " %-10" PRIu64 " %-10" PRIu64 "\n",
+ "%-10" PRIu64 " %-10" PRIu64 " %-10" PRIu64 " %-10" PRIu64 "\n",
j, avg, lat->min, lat->max, lat->sample_events,
- lat->events);
+ lat->events, lat->max_idx);
}
- printf("---------------------------------------------------------------\n");
+ printf("-----------------------------------------------------------------------\n");
if (total.sample_events == 0) {
printf("Total N/A\n\n");
continue;
@@ -431,8 +432,10 @@ static int test_schedule(int thr, test_globals_t *globals)
if (event->type == SAMPLE) {
latency = odp_time_to_ns(time) - odp_time_to_ns(event->time_stamp);
- if (latency > stats->max)
+ if (latency > stats->max) {
stats->max = latency;
+ stats->max_idx = stats->sample_events;
+ }
if (latency < stats->min)
stats->min = latency;
stats->tot += latency;