package magic-trace

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file trace_mode.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
open! Core

type t =
  | Userspace
  | Kernel
  | Userspace_and_kernel
[@@deriving sexp_of, compare, equal]

let commands_and_docs =
  [ ( Userspace_and_kernel
    , "trace-include-kernel"
    , "Trace userspace and the kernel. Requires root." )
  ; ( Kernel
    , "trace-kernel-only"
    , "Trace the kernel and do not trace userspace. Requires root." )
  ]
;;

let param =
  Command.Param.choose_one
    ~if_nothing_chosen:(Default_to Userspace)
    (List.map commands_and_docs ~f:(fun (variant, flag, doc) ->
         Command.Param.flag flag (Command.Param.no_arg_some variant) ~doc))
;;
OCaml

Innovation. Community. Security.