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 */
ret = fread(&dma_log, sizeof(dma_log), 1, config->in_fd);
if (!ret) {
if (config->trace)
if (config->trace && !ferror(config->in_fd)) {
freopen(NULL, "r", config->in_fd);
continue;
}
return -ferror(config->in_fd);
}