spdk_top: change CLOCK_REALTIME to CLOCK_MONOTONIC
Changes CLOCK_REALTIME to CLOCK_MONOTONIC in show_stats() to avoid getting time_diff values below 0. Time counters in future patches will be using CLOCK_MONOTONIC as well. Change-Id: I4de834e0ad3266986ae11be95859a7bc64e5fc70 Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8930 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
30d42a8437
commit
2e2102b026
@ -2731,7 +2731,7 @@ show_stats(pthread_t *data_thread)
|
||||
char current_page_str[CURRENT_PAGE_STR_LEN];
|
||||
bool force_refresh = true;
|
||||
|
||||
clock_gettime(CLOCK_REALTIME, &time_now);
|
||||
clock_gettime(CLOCK_MONOTONIC, &time_now);
|
||||
time_last = time_now.tv_sec;
|
||||
|
||||
switch_tab(THREADS_TAB);
|
||||
@ -2751,7 +2751,7 @@ show_stats(pthread_t *data_thread)
|
||||
resize_interface(active_tab);
|
||||
}
|
||||
|
||||
clock_gettime(CLOCK_REALTIME, &time_now);
|
||||
clock_gettime(CLOCK_MONOTONIC, &time_now);
|
||||
time_dif = time_now.tv_sec - time_last;
|
||||
if (time_dif < 0) {
|
||||
time_dif = g_sleep_time;
|
||||
|
Loading…
Reference in New Issue
Block a user