@@ -3788,10 +3788,24 @@ static int perf_script__process_auxtrace_info(struct perf_session *session,
3788
3788
#endif
3789
3789
3790
3790
static int parse_insn_trace (const struct option * opt __maybe_unused ,
3791
- const char * str __maybe_unused ,
3792
- int unset __maybe_unused )
3791
+ const char * str , int unset __maybe_unused )
3793
3792
{
3794
- parse_output_fields (NULL , "+insn,-event,-period" , 0 );
3793
+ const char * fields = "+insn,-event,-period" ;
3794
+ int ret ;
3795
+
3796
+ if (str ) {
3797
+ if (strcmp (str , "disasm" ) == 0 )
3798
+ fields = "+disasm,-event,-period" ;
3799
+ else if (strlen (str ) != 0 && strcmp (str , "raw" ) != 0 ) {
3800
+ fprintf (stderr , "Only accept raw|disasm\n" );
3801
+ return - EINVAL ;
3802
+ }
3803
+ }
3804
+
3805
+ ret = parse_output_fields (NULL , fields , 0 );
3806
+ if (ret < 0 )
3807
+ return ret ;
3808
+
3795
3809
itrace_parse_synth_opts (opt , "i0ns" , 0 );
3796
3810
symbol_conf .nanosecs = true;
3797
3811
return 0 ;
@@ -3937,7 +3951,7 @@ int cmd_script(int argc, const char **argv)
3937
3951
"only consider these symbols" ),
3938
3952
OPT_INTEGER (0 , "addr-range" , & symbol_conf .addr_range ,
3939
3953
"Use with -S to list traced records within address range" ),
3940
- OPT_CALLBACK_OPTARG (0 , "insn-trace" , & itrace_synth_opts , NULL , NULL ,
3954
+ OPT_CALLBACK_OPTARG (0 , "insn-trace" , & itrace_synth_opts , NULL , "raw|disasm" ,
3941
3955
"Decode instructions from itrace" , parse_insn_trace ),
3942
3956
OPT_CALLBACK_OPTARG (0 , "xed" , NULL , NULL , NULL ,
3943
3957
"Run xed disassembler on output" , parse_xed ),
0 commit comments