Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
(depends
(ocaml (>= "5.0.0~"))
hdr_histogram
(cmdliner (and (>= 1.1.0) (< 2.0)))
(trace-fuchsia (>= 0.10))
(trace (>= 0.10))
(cmdliner (>= 2.0.0))
(trace-fuchsia (>= 0.11))
(trace (>= 0.11))
(menhir :with-test)
(ocamlformat (and :with-dev-setup (= 0.27.0)))
(alcotest (and :with-test (>= 1.9.0)))))
Expand Down
13 changes: 7 additions & 6 deletions lib/olly_common/cli.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ let help man_format cmds topic =
| None -> `Help (`Pager, None) (* help about the program. *)
| Some topic -> (
let topics = "topics" :: cmds in
let conv, _ = Cmdliner.Arg.enum (List.rev_map (fun s -> (s, s)) topics) in
match conv topic with
| `Error e -> `Error (false, e)
| `Ok t when t = "topics" ->
let conv = Cmdliner.Arg.enum (List.rev_map (fun s -> (s, s)) topics) in
let parse = Cmdliner.Arg.Conv.parser conv in
match parse topic with
| Error e -> `Error (false, e)
| Ok t when t = "topics" ->
List.iter print_endline topics;
`Ok ()
| `Ok t when List.mem t cmds -> `Help (man_format, Some t)
| `Ok _t ->
| Ok t when List.mem t cmds -> `Help (man_format, Some t)
| Ok _t ->
let page =
((topic, 7, "", "", ""), [ `S topic; `P "Say something" ])
in
Expand Down
12 changes: 6 additions & 6 deletions lib/olly_trace/olly_format_backend/olly_format_fuchsia.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Trace = Trace_fuchsia.Writer
type trace = {
doms : Trace.Thread_ref.t array;
buf : Trace_fuchsia.Buf_chain.t;
subscriber : Trace_fuchsia.Subscriber.t;
collector : Trace_fuchsia.Collector_fuchsia.t;
exporter : Trace_fuchsia.Exporter.t;
}

Expand All @@ -22,22 +22,22 @@ let create ~filename =
let buf = Trace_fuchsia.Buf_chain.create ~sharded:true ~buf_pool () in
let oc = Out_channel.open_bin filename in
let exporter = Trace_fuchsia.Exporter.of_out_channel ~close_channel:true oc in
let subscriber =
Trace_fuchsia.Subscriber.create ~buf_pool ~pid:0 ~exporter ()
let collector =
Trace_fuchsia.Collector_fuchsia.create ~buf_pool ~pid:0 ~exporter ()
in
(* Adds the headers to output *)
Trace_fuchsia.Subscriber.Callbacks.on_init subscriber ~time_ns:0L;
Trace_fuchsia.Collector_fuchsia.callbacks.init collector;
let doms =
let max_doms = 128 in
Array.init max_doms (fun i ->
(* Use a different pid for each domain *)
Trace.Thread_ref.ref (i + 1))
in
{ doms; buf; subscriber; exporter }
{ doms; buf; collector; exporter }

let close trace =
flush trace;
Trace_fuchsia.Subscriber.close trace.subscriber
Trace_fuchsia.Collector_fuchsia.close trace.collector

let emit trace evt =
let open Event in
Expand Down
6 changes: 3 additions & 3 deletions runtime_events_tools.opam
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ depends: [
"dune" {>= "3.18"}
"ocaml" {>= "5.0.0~"}
"hdr_histogram"
"cmdliner" {>= "1.1.0" & < "2.0"}
"trace-fuchsia" {>= "0.10"}
"trace" {>= "0.10"}
"cmdliner" {>= "2.0.0"}
"trace-fuchsia" {>= "0.11"}
"trace" {>= "0.11"}
"menhir" {with-test}
"ocamlformat" {with-dev-setup & = "0.27.0"}
"alcotest" {with-test & >= "1.9.0"}
Expand Down
Loading