sof: logger: reopen trace file upon EOF

If logger reads an end-of-file from trace node, reopen the file
to ensure trace read position is in sync between host and DSP.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
This commit is contained in:
Kai Vehmanen 2019-04-24 16:46:21 +03:00 committed by Janusz Jankowski
parent f9b4411059
commit 6a84b4e945
1 changed files with 3 additions and 1 deletions

View File

@ -375,8 +375,10 @@ static int logger_read(const struct convert_config *config,
/* getting entry parameters from dma dump */ /* getting entry parameters from dma dump */
ret = fread(&dma_log, sizeof(dma_log), 1, config->in_fd); ret = fread(&dma_log, sizeof(dma_log), 1, config->in_fd);
if (!ret) { if (!ret) {
if (config->trace) if (config->trace && !ferror(config->in_fd)) {
freopen(NULL, "r", config->in_fd);
continue; continue;
}
return -ferror(config->in_fd); return -ferror(config->in_fd);
} }