Skip to content

Commit

Permalink
example: sysinfo: add timer pool start call
Browse files Browse the repository at this point in the history
Call odp_timer_pool_start() before querying timer pool info. Depending on
the implementation, some information may only be available after the
timer pool has been started.

Also, print clock source in case of timer API call failures.

Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
  • Loading branch information
MatiasElo committed Sep 19, 2023
1 parent abcdc5e commit 73e5b8a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions example/sysinfo/odp_sysinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ static int timer_capability(appl_args_t *appl_args)
if (ret == -1)
continue;
if (ret < -1) {
ODPH_ERR("odp_timer_capability() failed: %d\n", ret);
ODPH_ERR("odp_timer_capability() for clock source %d failed: %d\n", i, ret);
return -1;
}

Expand All @@ -573,9 +573,11 @@ static int timer_capability(appl_args_t *appl_args)
return -1;
}

odp_timer_pool_start();

ret = odp_timer_pool_info(pool, info);
if (ret) {
ODPH_ERR("odp_timer_pool_info() failed: %d\n", ret);
ODPH_ERR("odp_timer_pool_info() for clock source %d failed: %d\n", i, ret);
return -1;
}

Expand Down

0 comments on commit 73e5b8a

Please sign in to comment.