File tree 4 files changed +21
-4
lines changed
4 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ module Kind = struct
8
8
| Syscall
9
9
| Sysret
10
10
| Hardware_interrupt
11
+ | Interrupt
11
12
| Iret
12
13
| Jump
13
14
| Tx_abort
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ module Kind : sig
8
8
| Syscall
9
9
| Sysret
10
10
| Hardware_interrupt
11
+ | Interrupt
11
12
| Iret
12
13
| Jump
13
14
| 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
21
21
22
22
let perf_branches_event_re =
23
23
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]+ ) (.* )$| }
25
25
|> Re. compile
26
26
;;
27
27
@@ -259,6 +259,7 @@ let parse_perf_branches_event ?perf_maps (thread : Event.Thread.t) time line : E
259
259
match String. strip kind with
260
260
| "call" -> Some Call
261
261
| "return" -> Some Return
262
+ | "int" -> Some Interrupt
262
263
| "jmp" -> Some Jump
263
264
| "jcc" -> Some Jump
264
265
| "syscall" -> Some Syscall
@@ -519,6 +520,19 @@ let%test_module _ =
519
520
(data (Trace (kind Call ) (src 0x56234f77576b ) (dst 0x56234f4bc7a0 )))))) | }]
520
521
;;
521
522
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
+
522
536
let % expect_test " decode error with a timestamp" =
523
537
check
524
538
" 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 =
1126
1126
| Return
1127
1127
| Hardware_interrupt
1128
1128
| Iret
1129
+ | Interrupt
1129
1130
| Sysret
1130
- | Jump
1131
+ | Jump
1131
1132
| Tx_abort )
1132
1133
, Some Start )
1133
1134
| Some Async , None
1134
- | Some (Hardware_interrupt | Jump | Tx_abort ), Some End ->
1135
+ | Some (Hardware_interrupt | Jump | Interrupt | Tx_abort ), Some End ->
1135
1136
raise_s
1136
1137
[% message
1137
1138
" BUG: magic-trace devs thought this event was impossible, but you just \
@@ -1223,7 +1224,7 @@ and write_event' (T t) ?events_writer event =
1223
1224
~time ;
1224
1225
check_current_symbol t thread_info ~time dst)
1225
1226
| Some Tx_abort , None -> check_current_symbol t thread_info ~time dst
1226
- | Some Jump , None ->
1227
+ | Some ( Jump | Interrupt ) , None ->
1227
1228
Ocaml_hacks. check_current_symbol_track_entertraps t thread_info ~time dst
1228
1229
(* (None, _) comes up when perf spews something magic-trace doesn't recognize.
1229
1230
Instead of crashing, ignore it and keep going. *)
You can’t perform that action at this time.
0 commit comments