@@ -42,6 +42,7 @@ static void usage(void)
4242 fprintf (stdout , "%s:\t -i infile -o outfile\tDump infile contents to outfile\n" , APP_NAME );
4343#ifdef LOGGER_FORMAT
4444 fprintf (stdout , "%s:\t -l *.ldc_file\t-i in_file\n" , APP_NAME );
45+ fprintf (stdout , "%s:\t -p \tinput from stdin\n" , APP_NAME );
4546#endif
4647 fprintf (stdout , "%s:\t -c\t\t\tSet timestamp clock in MHz\n" , APP_NAME );
4748 fprintf (stdout , "%s:\t -s\t\t\tTake a snapshot of state\n" , APP_NAME );
@@ -122,10 +123,11 @@ int main(int argc, char *argv[])
122123 config .in_fd = NULL ;
123124#ifdef LOGGER_FORMAT
124125 config .ldc_file = NULL ;
126+ config .input_std = 0 ;
125127#endif
126128
127129#ifdef LOGGER_FORMAT
128- while ((opt = getopt (argc , argv , "ho:i:l:s :m:c:t" )) != -1 ) {
130+ while ((opt = getopt (argc , argv , "ho:i:l:ps :m:c:t" )) != -1 ) {
129131#else
130132 while ((opt = getopt (argc , argv , "ho:i:s:m:c:t" )) != -1 ) {
131133#endif
@@ -148,6 +150,9 @@ int main(int argc, char *argv[])
148150 case 'l' :
149151 config .ldc_file = optarg ;
150152 break ;
153+ case 'p' :
154+ config .input_std = 1 ;
155+ break ;
151156#endif
152157 case 'h' :
153158 default : /* '?' */
@@ -190,7 +195,12 @@ int main(int argc, char *argv[])
190195 if (!config .in_file )
191196 config .in_file = "/sys/kernel/debug/sof/etrace" ;
192197
193- if (config .in_file ) {
198+ #ifdef LOGGER_FORMAT
199+ if (config .input_std ) {
200+ config .in_fd = stdin ;
201+ } else
202+ #endif
203+ {
194204 config .in_fd = fopen (config .in_file , "r" );
195205 if (!config .in_fd ) {
196206 fprintf (stderr , "error: Unable to open in file %s\n" ,
0 commit comments