File tree Expand file tree Collapse file tree 4 files changed +21
-4
lines changed
Expand file tree Collapse file tree 4 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ module Kind = struct
88 | Syscall
99 | Sysret
1010 | Hardware_interrupt
11+ | Interrupt
1112 | Iret
1213 | Jump
1314 | Tx_abort
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ module Kind : sig
88 | Syscall
99 | Sysret
1010 | Hardware_interrupt
11+ | Interrupt
1112 | Iret
1213 | Jump
1314 | Tx_abort
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ let perf_callstack_entry_re = Re.Perl.re "^\t *([0-9a-f]+) (.*)$" |> Re.compile
2121
2222let perf_branches_event_re =
2323 Re.Perl. re
24- {|^ * (call| return| tr strt| syscall| sysret| hw int | iret| tx abrt| tr end| tr strt tr end| tr end (?: async| call| return| syscall| sysret| iret)| jmp| jcc) + (\(x\) + )?([0-9 a- f]+ ) (.* ) => + ([0-9 a- f]+ ) (.* )$| }
24+ {|^ * (call| return| tr strt| syscall| sysret| hw int | iret| int | tx abrt| tr end| tr strt tr end| tr end (?: async| call| return| syscall| sysret| iret)| jmp| jcc) + (\(x\) + )?([0-9 a- f]+ ) (.* ) => + ([0-9 a- f]+ ) (.* )$| }
2525 |> Re. compile
2626;;
2727
@@ -259,6 +259,7 @@ let parse_perf_branches_event ?perf_maps (thread : Event.Thread.t) time line : E
259259 match String. strip kind with
260260 | "call" -> Some Call
261261 | "return" -> Some Return
262+ | "int" -> Some Interrupt
262263 | "jmp" -> Some Jump
263264 | "jcc" -> Some Jump
264265 | "syscall" -> Some Syscall
@@ -519,6 +520,19 @@ let%test_module _ =
519520 (data (Trace (kind Call ) (src 0x56234f77576b ) (dst 0x56234f4bc7a0 )))))) | }]
520521 ;;
521522
523+ let % expect_test " software interrupts" =
524+ check
525+ " 1907478/1909463 457407.880965552: 1 \
526+ branches:uH: int 564aa58813d4 \
527+ Builtins_RunMicrotasks+0x554 (/usr/local/bin/workload) => 564aa584fa00 \
528+ Builtins_Call_ReceiverIsNotNullOrUndefined+0x0 (/usr/local/bin/workload)" ;
529+ [% expect
530+ {|
531+ ((Ok
532+ ((thread ((pid (1907478 )) (tid (1909463 )))) (time 5 d7h3m27.880965552 s)
533+ (data (Trace (kind Interrupt ) (src 0x564aa58813d4 ) (dst 0x564aa584fa00 )))))) | }]
534+ ;;
535+
522536 let % expect_test " decode error with a timestamp" =
523537 check
524538 " instruction trace error type 1 time 47170.086912826 cpu -1 pid 293415 tid \
Original file line number Diff line number Diff line change @@ -1126,12 +1126,13 @@ and write_event' (T t) ?events_writer event =
11261126 | Return
11271127 | Hardware_interrupt
11281128 | Iret
1129+ | Interrupt
11291130 | Sysret
1130- | Jump
1131+ | Jump
11311132 | Tx_abort )
11321133 , Some Start )
11331134 | Some Async , None
1134- | Some (Hardware_interrupt | Jump | Tx_abort ), Some End ->
1135+ | Some (Hardware_interrupt | Jump | Interrupt | Tx_abort ), Some End ->
11351136 raise_s
11361137 [% message
11371138 " BUG: magic-trace devs thought this event was impossible, but you just \
@@ -1223,7 +1224,7 @@ and write_event' (T t) ?events_writer event =
12231224 ~time ;
12241225 check_current_symbol t thread_info ~time dst)
12251226 | Some Tx_abort , None -> check_current_symbol t thread_info ~time dst
1226- | Some Jump , None ->
1227+ | Some ( Jump | Interrupt ) , None ->
12271228 Ocaml_hacks. check_current_symbol_track_entertraps t thread_info ~time dst
12281229 (* (None, _) comes up when perf spews something magic-trace doesn't recognize.
12291230 Instead of crashing, ignore it and keep going. *)
You can’t perform that action at this time.
0 commit comments