remove dead code and on_tracing_error

This commit is contained in:
Simon Cruanes 2026-01-17 10:42:45 -05:00
parent 40335815b3
commit e98c11c9e0
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
10 changed files with 0 additions and 66 deletions

View file

@ -2,8 +2,6 @@ open Common_
open Types
open Trace_core
let on_tracing_error = on_tracing_error
type t = {
active: bool A.t;
pid: int;

View file

@ -13,9 +13,3 @@ val callbacks : t Collector.Callbacks.t
val collector : t -> Collector.t
(** Subscriber that writes json into this writer *)
(**/**)
val on_tracing_error : (string -> unit) ref
(**/**)

View file

@ -1,8 +1,5 @@
module A = Trace_core.Internal_.Atomic_
let on_tracing_error =
ref (fun s -> Printf.eprintf "trace-fuchsia error: %s\n%!" s)
let ( let@ ) = ( @@ )
let spf = Printf.sprintf

View file

@ -1,4 +1,3 @@
open Common_
module Buf = Buf
module Buf_chain = Buf_chain
module Buf_pool = Buf_pool
@ -49,6 +48,4 @@ module Internal_ = struct
let mock_all_ () =
Trace_util.Mock_.mock_all ();
()
let on_tracing_error = on_tracing_error
end

View file

@ -41,8 +41,6 @@ val with_setup : ?out:[< output | `Env > `Env ] -> unit -> (unit -> 'a) -> 'a
(**/**)
module Internal_ : sig
val on_tracing_error : (string -> unit) ref
val mock_all_ : unit -> unit
(** use fake, deterministic timestamps, TID, PID *)
end

View file

@ -33,8 +33,6 @@ val with_setup : ?out:[ output | `Env ] -> unit -> (unit -> 'a) -> 'a
module Private_ : sig
val mock_all_ : unit -> unit
(** use fake, deterministic timestamps, TID, PID *)
val on_tracing_error : (string -> unit) ref
end
(**/**)

View file

@ -16,21 +16,6 @@ open struct
Int64.div t 1_000L |> Int64.to_float
end
let on_tracing_error = ref (fun s -> Printf.eprintf "%s\n%!" s)
(*
type span_info = {
tid: int;
name: string;
start_us: float;
mutable data: (string * user_data) list;
(* NOTE: thread safety: this is supposed to only be modified by the thread
that's running this (synchronous, stack-abiding) span. *)
}
(** Information we store about a span begin event, to emit a complete event when
we meet the corresponding span end event *)
*)
type t = {
active: bool A.t;
pid: int;
@ -40,29 +25,6 @@ type t = {
}
(** Subscriber state *)
(* TODO: this is nice to have, can we make it optional?
open struct
let print_non_closed_spans_warning spans =
let module Str_set = Set.Make (String) in
let spans = Span_tbl.to_list spans in
if spans <> [] then (
!on_tracing_error
@@ Printf.sprintf "trace-tef: warning: %d spans were not closed"
(List.length spans);
let names =
List.fold_left
(fun set (_, span) -> Str_set.add span.name set)
Str_set.empty spans
in
Str_set.iter
(fun name ->
!on_tracing_error @@ Printf.sprintf " span %S was not closed" name)
names;
flush stderr
)
end
*)
let close (self : t) : unit =
if A.exchange self.active false then
(* FIXME: print_non_closed_spans_warning self.spans; *)

View file

@ -21,9 +21,3 @@ val callbacks_collector : t Collector.Callbacks.t
val collector : t -> Collector.t
(** Subscriber that writes json into this writer *)
(**/**)
val on_tracing_error : (string -> unit) ref
(**/**)

View file

@ -104,8 +104,6 @@ module Private_ = struct
Trace_util.Mock_.mock_all ();
()
let on_tracing_error = Collector_tef.on_tracing_error
let collector_jsonl ~finally ~out () : collector =
collector_ ~finally ~mode:`Jsonl ~out ()

View file

@ -43,8 +43,6 @@ module Private_ : sig
val mock_all_ : unit -> unit
(** use fake, deterministic timestamps, TID, PID *)
val on_tracing_error : (string -> unit) ref
val collector_jsonl :
finally:(unit -> unit) ->
out:[ `File_append of string | `Output of out_channel ] ->