format using 0.27

This commit is contained in:
Simon Cruanes 2025-04-11 12:25:21 -04:00
parent d737022e11
commit 477cc21bf1
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
3 changed files with 12 additions and 12 deletions

View file

@ -1,4 +1,4 @@
version = 0.26.2 version = 0.27.0
profile=conventional profile=conventional
margin=80 margin=80
if-then-else=k-r if-then-else=k-r

View file

@ -1,6 +1,6 @@
(** Write fuchsia events into buffers. (** Write fuchsia events into buffers.
Reference: https://fuchsia.dev/fuchsia-src/reference/tracing/trace-format *) Reference: https://fuchsia.dev/fuchsia-src/reference/tracing/trace-format *)
module Util = Util module Util = Util
module Buf = Buf module Buf = Buf
@ -37,7 +37,8 @@ end
open struct open struct
(** maximum length as specified in the (** maximum length as specified in the
{{: https://fuchsia.dev/fuchsia-src/reference/tracing/trace-format} spec} *) {{:https://fuchsia.dev/fuchsia-src/reference/tracing/trace-format} spec}
*)
let max_str_len = 32000 let max_str_len = 32000
(** Length of string, in words *) (** Length of string, in words *)
@ -68,8 +69,8 @@ module Str_ref = struct
(1 lsl 15) lor size (1 lsl 15) lor size
end end
(** [truncate_string s] truncates [s] to the maximum length allowed for (** [truncate_string s] truncates [s] to the maximum length allowed for strings.
strings. If [s] is already short enough, no allocation is done. *) If [s] is already short enough, no allocation is done. *)
let[@inline] truncate_string s : string = let[@inline] truncate_string s : string =
if String.length s <= max_str_len then if String.length s <= max_str_len then
s s

View file

@ -48,8 +48,8 @@ module Writer = struct
must_close: bool; (** Do we have to close the underlying channel [oc]? *) must_close: bool; (** Do we have to close the underlying channel [oc]? *)
pid: int; pid: int;
} }
(** A writer to a [out_channel]. It writes JSON entries in an array (** A writer to a [out_channel]. It writes JSON entries in an array and closes
and closes the array at the end. *) the array at the end. *)
let create ~(mode : [ `Single | `Jsonl ]) ~out () : t = let create ~(mode : [ `Single | `Jsonl ]) ~out () : t =
let jsonl = mode = `Jsonl in let jsonl = mode = `Jsonl in
@ -237,9 +237,8 @@ let print_non_closed_spans_warning spans =
!names; !names;
flush stderr flush stderr
(** Background thread, takes events from the queue, puts them (** Background thread, takes events from the queue, puts them in context using
in context using local state, and writes fully resolved local state, and writes fully resolved TEF events to [out]. *)
TEF events to [out]. *)
let bg_thread ~mode ~out (events : Event.t B_queue.t) : unit = let bg_thread ~mode ~out (events : Event.t B_queue.t) : unit =
block_signals (); block_signals ();
@ -308,8 +307,8 @@ let bg_thread ~mode ~out (events : Event.t B_queue.t) : unit =
if Span_tbl.length spans > 0 then print_non_closed_spans_warning spans; if Span_tbl.length spans > 0 then print_non_closed_spans_warning spans;
() ()
(** Thread that simply regularly "ticks", sending events to (** Thread that simply regularly "ticks", sending events to the background
the background thread so it has a chance to write to the file *) thread so it has a chance to write to the file *)
let tick_thread events : unit = let tick_thread events : unit =
block_signals (); block_signals ();
try try