Skip to content
This repository was archived by the owner on Jan 17, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rmbox/convert.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ struct convert_config {
#ifdef LOGGER_FORMAT
const char *ldc_file;
FILE* ldc_fd;
int input_std;
#endif
};

Expand Down
3 changes: 2 additions & 1 deletion rmbox/logger_convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ static inline void print_table_header(FILE *out_fd)
"DELTA",
"FILE_NAME",
"CONTENT");
fflush(out_fd);
}

#define CASE(x) \
Expand Down Expand Up @@ -137,6 +138,7 @@ static void print_entry_params(FILE *out_fd, struct dma_log dma_log,
break;
}
fprintf(out_fd, "\n");
fflush(out_fd);
}

static int fetch_entry(struct convert_config *config, uint32_t base_address,
Expand Down Expand Up @@ -241,7 +243,6 @@ static int logger_read(struct convert_config *config,
{
struct dma_log dma_log;
int ret = 0;

print_table_header(config->out_fd);
uint64_t last_timestamp = 0;

Expand Down
14 changes: 12 additions & 2 deletions rmbox/rmbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ static void usage(void)
fprintf(stdout, "%s:\t -i infile -o outfile\tDump infile contents to outfile\n", APP_NAME);
#ifdef LOGGER_FORMAT
fprintf(stdout, "%s:\t -l *.ldc_file\t-i in_file\n", APP_NAME);
fprintf(stdout, "%s:\t -p \tinput from stdin\n", APP_NAME);
#endif
fprintf(stdout, "%s:\t -c\t\t\tSet timestamp clock in MHz\n", APP_NAME);
fprintf(stdout, "%s:\t -s\t\t\tTake a snapshot of state\n", APP_NAME);
Expand Down Expand Up @@ -122,10 +123,11 @@ int main(int argc, char *argv[])
config.in_fd = NULL;
#ifdef LOGGER_FORMAT
config.ldc_file = NULL;
config.input_std = 0;
#endif

#ifdef LOGGER_FORMAT
while ((opt = getopt(argc, argv, "ho:i:l:s:m:c:t")) != -1) {
while ((opt = getopt(argc, argv, "ho:i:l:ps:m:c:t")) != -1) {
#else
while ((opt = getopt(argc, argv, "ho:i:s:m:c:t")) != -1) {
#endif
Expand All @@ -148,6 +150,9 @@ int main(int argc, char *argv[])
case 'l':
config.ldc_file = optarg;
break;
case 'p':
config.input_std = 1;
break;
#endif
case 'h':
default: /* '?' */
Expand Down Expand Up @@ -190,7 +195,12 @@ int main(int argc, char *argv[])
if (!config.in_file)
config.in_file = "/sys/kernel/debug/sof/etrace";

if (config.in_file) {
#ifdef LOGGER_FORMAT
if (config.input_std) {
config.in_fd = stdin;
} else
#endif
{
config.in_fd = fopen(config.in_file, "r");
if (!config.in_fd) {
fprintf(stderr, "error: Unable to open in file %s\n",
Expand Down