package memtrace_viewer

  1. Overview
  2. Docs
Interactive memory profiler based on Memtrace

Install

Dune Dependency

Authors

Maintainers

Sources

memtrace_viewer-v0.16.0.tar.gz
sha256=bb50fc48fef748dffe7ff1e151021b1361500c432a8c2991065fd31fd474f817

doc/src/memtrace_viewer.common/filter.ml.html

Source file filter.ml

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
open! Core

module String_relation = struct
  type t =
    | Equals
    | Contains
  [@@deriving sexp, bin_io, equal]
end

module Location_predicate = struct
  type t =
    | Defname_related of
        { relation : String_relation.t
        ; rhs : string
        }
  [@@deriving sexp, bin_io, equal]
end

type t =
  { allocated_range : Range.Time_ns_span.t
  ; collected_range : Range.Time_ns_span.Or_empty.t
  ; size_range : Range.Byte_units.t
  ; lifetime_range : Range.Time_ns_span.t
  ; required_locations : Location_predicate.t list
  ; forbidden_locations : Location_predicate.t list
  ; hidden_locations : Location_predicate.t list
  ; include_minor_heap : bool
  ; include_major_heap : bool
  }
[@@deriving sexp, bin_io, equal]

let default =
  { allocated_range = Range.Time_ns_span.all
  ; collected_range = Non_empty Range.Time_ns_span.all
  ; size_range = Range.Byte_units.all
  ; lifetime_range = Range.Time_ns_span.all
  ; required_locations = []
  ; forbidden_locations = []
  ; hidden_locations = []
  ; include_minor_heap = true
  ; include_major_heap = true
  }
;;

let is_always_true = function
  | { allocated_range
    ; collected_range
    ; size_range
    ; lifetime_range
    ; required_locations
    ; forbidden_locations
    ; hidden_locations
    ; include_minor_heap
    ; include_major_heap
    } ->
    Range.Time_ns_span.is_all allocated_range
    && Range.Time_ns_span.Or_empty.is_all collected_range
    && Range.Byte_units.is_all size_range
    && Range.Time_ns_span.is_all lifetime_range
    && List.is_empty required_locations
    && List.is_empty forbidden_locations
    && List.is_empty hidden_locations
    && include_minor_heap
    && include_major_heap
;;

let is_default t = is_always_true t
OCaml

Innovation. Community. Security.