File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ let perf_callstack_entry_re = Re.Perl.re "^\t *([0-9a-f]+) (.*)$" |> Re.compile
22
22
23
23
let perf_branches_event_re =
24
24
Re.Perl. re
25
- {|^ * (call| return| tr strt| syscall| sysret| hw int | iret| tr end| tr strt tr end| tr end (?: call| return| syscall| sysret| iret)| jmp| jcc) + ([0-9 a- f]+ ) (.* ) => + ([0-9 a- f]+ ) (.* )$| }
25
+ {|^ * (call| return| tr strt| syscall| sysret| hw int | iret| tr end| tr strt tr end| tr end (?: async | call| return| syscall| sysret| iret)| jmp| jcc) + ([0-9 a- f]+ ) (.* ) => + ([0-9 a- f]+ ) (.* )$| }
26
26
|> Re. compile
27
27
;;
28
28
@@ -262,6 +262,16 @@ let parse_perf_branches_event ?perf_maps (thread : Event.Thread.t) time line : E
262
262
| "hw int" -> Some Hardware_interrupt
263
263
| "iret" -> Some Iret
264
264
| "sysret" -> Some Sysret
265
+ | "async" ->
266
+ (match trace_state_change with
267
+ | Some End -> Some Jump
268
+ | _ ->
269
+ raise_s
270
+ [% message
271
+ " BUG: async flag set on something other than a trace end event. Please \
272
+ report this to https://github.com/janestreet/magic-trace/issues/"
273
+ (trace_state_change : Trace_state_change.t option )
274
+ (line : string )])
265
275
| "" -> None
266
276
| _ ->
267
277
printf " Warning: skipping unrecognized perf output: %s\n %!" line;
@@ -688,6 +698,18 @@ let%test_module _ =
688
698
((thread ((pid (25375 )) (tid (25375 )))) (time 52 d4h33m11.343298468 s)
689
699
(data (Trace (kind Call ) (src 0x7f6fce0b71f4 ) (dst 0x7ffd193838e0 )))))) | }]
690
700
;;
701
+
702
+ let % expect_test " tr end async" =
703
+ check
704
+ {| 25375 / 25375 4509191.343298468 : 1 branches :uH: tr end async 7 f6fce0b71f4 [unknown] (foo .so) => 0 [unknown] ([unknown])|};
705
+ [% expect
706
+ {|
707
+ ((Ok
708
+ ((thread ((pid (25375 )) (tid (25375 )))) (time 52 d4h33m11.343298468 s)
709
+ (data
710
+ (Trace (trace_state_change End ) (kind Jump ) (src 0x7f6fce0b71f4 )
711
+ (dst 0x0 )))))) | }]
712
+ ;;
691
713
end )
692
714
;;
693
715
You can’t perform that action at this time.
0 commit comments