kpb-trace: use one variable to measure time

This will fix "variable x set but not used" gcc errors if TRACE disabled

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
This commit is contained in:
Adrian Bonislawski 2019-06-19 12:24:50 +02:00 committed by Janusz Jankowski
parent fdd04e9bf5
commit 8f589395f8
1 changed files with 4 additions and 6 deletions

View File

@ -795,13 +795,12 @@ static uint64_t kpb_draining_task(void *arg)
size_t size_to_copy;
bool move_buffer = false;
uint32_t drained = 0;
uint64_t time_start;
uint64_t time_end;
uint64_t time;
uint32_t attr = 0;
trace_kpb("kpb_draining_task(), start.");
time_start = platform_timer_get(platform_timer);
time = platform_timer_get(platform_timer);
while (history_depth > 0) {
size_to_read = (uint32_t)buff->end_addr - (uint32_t)buff->r_ptr;
@ -836,7 +835,7 @@ static uint64_t kpb_draining_task(void *arg)
comp_update_buffer_produce(sink, size_to_copy);
}
time_end = platform_timer_get(platform_timer);
time = platform_timer_get(platform_timer) - time;
/* Draining is done. Now switch KPB to copy real time stream
* to client's sink. This state is called "draining on demand"
@ -848,8 +847,7 @@ static uint64_t kpb_draining_task(void *arg)
trace_kpb("kpb_draining_task(), done. %u drained in %d ms.",
drained,
(time_end - time_start)
/ clock_ms_to_ticks(PLATFORM_DEFAULT_CLOCK, 1));
time / clock_ms_to_ticks(PLATFORM_DEFAULT_CLOCK, 1));
return 0;
}