-
Notifications
You must be signed in to change notification settings - Fork 129
Expand file tree
/
Copy pathevent.mli
More file actions
100 lines (88 loc) · 2.21 KB
/
event.mli
File metadata and controls
100 lines (88 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
open! Core
module Kind : sig
type t =
| Async
| Call
| Return
| Syscall
| Sysret
| Hardware_interrupt
| Interrupt
| Iret
| Jump
| Tx_abort
[@@deriving sexp, compare]
end
module Thread : sig
type t =
{ pid : Pid.t option
; tid : Pid.t option
}
[@@deriving sexp, compare, hash]
end
module Location : sig
type t =
{ instruction_pointer : int64
; symbol : Symbol.t
; symbol_offset : int
}
[@@deriving sexp, fields, bin_io]
val unknown : t
val untraced : t
val returned : t
val syscall : t
end
module Ok : sig
module Data : sig
type t =
| Trace of
{ trace_state_change : Trace_state_change.t option
; kind : Kind.t option
; src : Location.t
; dst : Location.t
} (** Represents an event collected from Intel PT. *)
| Power of { freq : int } (** Power event collected by Intel PT. *)
| Stacktrace_sample of
{ callstack : Location.t list (** Oldest to most recent calls in order. *) }
(** Represents cycles event collected through sampling. *)
| Event_sample of
{ location : Location.t
; count : int
; name : Collection_mode.Event.Name.t
} (** Represents counter based events collected through sampling. *)
| Ptwrite of
{ location : Location.t
; data : string
} (** Represents ptwrite events collected through Intel PT using PTWRITE. *)
[@@deriving sexp]
end
type t =
{ thread : Thread.t
; time : Time_ns.Span.t
; data : Data.t
; in_transaction : bool
}
[@@deriving sexp]
end
module Decode_error : sig
type t =
{ thread : Thread.t
; time : Time_ns_unix.Span.Option.t
; instruction_pointer : int64 option
; message : string
}
[@@deriving sexp]
end
type t = (Ok.t, Decode_error.t) Result.t [@@deriving sexp, bin_io]
val thread : t -> Thread.t
val time : t -> Time_ns_unix.Span.Option.t
val change_time : t -> f:(Time_ns.Span.t -> Time_ns.Span.t) -> t
module With_write_info : sig
type outer = t
type t =
{ event : outer
; should_write : bool
}
[@@deriving sexp_of, fields]
val create : ?should_write:bool -> outer -> t
end