File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1424,7 +1424,11 @@ let init_with_root ~(root : Workspace_root.t) (builder : Builder.t) =
14241424 Option. iter c.stats ~f: (fun stats ->
14251425 if Dune_trace. extended_build_job_info stats
14261426 then (
1427- let event = Dune_trace.Event. config () in
1427+ let event =
1428+ Dune_trace.Event. config
1429+ ~version:
1430+ (Build_info.V1. version () |> Option. map ~f: Build_info.V1.Version. to_string)
1431+ in
14281432 Dune_trace. emit stats event));
14291433 (* Setup hook for printing GC stats to a file *)
14301434 at_exit (fun () ->
Original file line number Diff line number Diff line change @@ -137,9 +137,21 @@ module Event = struct
137137 Event. counter common args
138138 ;;
139139
140- let config () =
140+ let config ~ version =
141141 let open Chrome_trace in
142- let args = [ " build_dir" , `String (Path.Build. to_string Path.Build. root) ] in
142+ let args =
143+ let args =
144+ [ " build_dir" , `String (Path.Build. to_string Path.Build. root)
145+ ; " argv" , `List (Array. to_list Sys. argv |> List. map ~f: Stdune.Json. string )
146+ ; ( " env"
147+ , `List (Unix. environment () |> Array. to_list |> List. map ~f: Stdune.Json. string )
148+ )
149+ ]
150+ in
151+ match version with
152+ | None -> args
153+ | Some v -> (" version" , Stdune.Json. string v) :: args
154+ in
143155 let ts = Event.Timestamp. of_float_seconds (Unix. gettimeofday () ) in
144156 let common = Event. common_fields ~cat: [ " config" ] ~name: " config" ~ts () in
145157 Event. instant ~args common
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ module Event : sig
6969
7070 val scan_source : name :string -> start :float -> stop :float -> dir :Path .Source .t -> t
7171 val scheduler_idle : unit -> t
72- val config : unit -> t
72+ val config : version : string option -> t
7373
7474 module Rpc : sig
7575 type stage =
You can’t perform that action at this time.
0 commit comments