sof/tools/logger/convert.h

51 lines
1.0 KiB
C
Raw Normal View History

/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2018 Intel Corporation. All rights reserved.
*
* Author: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
* Artur Kloniecki <arturx.kloniecki@linux.intel.com>
*/
/*
* debug log converter interface.
*/
#include <stdio.h>
#include <ipc/info.h>
#include <smex/ldc.h>
#include <sof/lib/uuid.h>
#define KNRM "\x1B[0m"
#define KRED "\x1B[31m"
#define KGRN "\x1B[32m"
#define KYEL "\x1B[33m"
#define KBLU "\x1B[34m"
struct convert_config {
const char *out_file;
const char *in_file;
FILE *out_fd;
FILE *in_fd;
double clock;
int trace;
const char *ldc_file;
FILE* ldc_fd;
char *filter_config;
int input_std;
int version_fw;
char *version_file;
FILE *version_fd;
int use_colors;
int serial_fd;
int raw_output;
int dump_ldc;
int hide_location;
logger: new relative timestamps option, relative to first entry seen Add a new sof-logger -e 0/1 relative timestamps option where the TIMESTAMP column is relative to the first entry seen. Removes many digits and makes the TIMESTAMP column much more readable in short logs. Also stop showing "NaN" as the first DELTA like something went wrong. Show zero instead. The new option is off by default when using -r(aw) and on otherwise. The first entry is kept always absolute. Before: TIMESTAMP DELTA C# COMPONENT LOCATION CONTENT [6653843012.343750] ( NaN) c0 dma-trace src/trace/dma-trace.c:339 ERROR FW ... [6653843111.510417] ( 99.166664) c0 ll-schedule ./schedule/ll_schedule.c:229 perf ll_work [6653843309.010417] ( 197.500000) c0 ll-schedule ./schedule/ll_schedule.c:399 task add [6653843314.166667] ( 5.156250) c0 ll-schedule ./schedule/ll_schedule.c:403 task params [6653843322.031250] ( 7.864583) c0 ll-schedule ./schedule/ll_schedule.c:309 new added [6653843327.031250] ( 5.000000) c0 ll-schedule ./schedule/ll_schedule.c:312 num_tasks 2 [6653844109.531250] ( 782.500000) c0 sa src/lib/agent.c:65 perf sys_load [6653844155.156250] ( 45.625000) c0 ll-schedule ./schedule/ll_schedule.c:229 perf ll_work [6653844384.218750] ( 229.062500) c0 component src/audio/component.c:130 comp new host After: TIMESTAMP DELTA C# COMPONENT LOCATION CONTENT [686125142.395834] ( 0.000000) c0 dma-trace src/trace/dma-trace.c:339 ERROR FW ... [ 94.270833] ( 94.270836) c0 ll-schedule ./schedule/ll_schedule.c:229 perf ll_work [ 296.770833] ( 202.500000) c0 ll-schedule ./schedule/ll_schedule.c:399 task add [ 301.979167] ( 5.208333) c0 ll-schedule ./schedule/ll_schedule.c:403 task params [ 309.843750] ( 7.864583) c0 ll-schedule ./schedule/ll_schedule.c:309 new added [ 314.843750] ( 5.000000) c0 ll-schedule ./schedule/ll_schedule.c:312 num_tasks 2 [ 1092.395833] ( 777.552063) c0 sa src/lib/agent.c:65 perf sys_load [ 1137.968750] ( 45.572918) c0 ll-schedule ./schedule/ll_schedule.c:229 perf ll_work [ 1850.208333] ( 712.239563) c0 component src/audio/component.c:130 comp new host Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-21 09:46:56 +08:00
int relative_timestamps;
int time_precision;
struct snd_sof_uids_header *uids_dict;
struct snd_sof_logs_header *logs_header;
};
uint32_t get_uuid_key(const struct sof_uuid_entry *entry);
int convert(struct convert_config *config);