File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1404,7 +1404,11 @@ let init_with_root ~(root : Workspace_root.t) (builder : Builder.t) =
14041404 ];
14051405 Dune_console. separate_messages c.builder.separate_error_messages;
14061406 Option. iter c.stats ~f: (fun stats ->
1407- let event = Dune_trace.Event. config () in
1407+ let event =
1408+ Dune_trace.Event. config
1409+ ~version:
1410+ (Build_info.V1. version () |> Option. map ~f: Build_info.V1.Version. to_string)
1411+ in
14081412 Dune_trace. emit stats event);
14091413 (* Setup hook for printing GC stats to a file *)
14101414 at_exit (fun () ->
Original file line number Diff line number Diff line change 1+ - Add ` argv ` , the process environment, and the dune version to the config event
2+ in the trace (#12909 , @rgrinberg )
Original file line number Diff line number Diff line change 11open Stdune
22module Timestamp = Chrome_trace.Event. Timestamp
3- module Json = Json
43
54module Mac = struct
65 external open_fds : pid :int -> int = " dune_trace_open_fds"
@@ -135,9 +134,19 @@ module Event = struct
135134 Event. counter common args
136135 ;;
137136
138- let config () =
137+ let config ~version =
138+ let args =
139+ let args =
140+ [ " build_dir" , `String (Path.Build. to_string Path.Build. root)
141+ ; " argv" , `List (Array. to_list Sys. argv |> List. map ~f: Json. string )
142+ ; " env" , `List (Unix. environment () |> Array. to_list |> List. map ~f: Json. string )
143+ ]
144+ in
145+ match version with
146+ | None -> args
147+ | Some v -> (" version" , Stdune.Json. string v) :: args
148+ in
139149 let open Chrome_trace in
140- let args = [ " build_dir" , `String (Path.Build. to_string Path.Build. root) ] in
141150 let ts = Event.Timestamp. of_float_seconds (Unix. gettimeofday () ) in
142151 let common = Event. common_fields ~cat: [ " config" ] ~name: " config" ~ts () in
143152 Event. instant ~args common
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ module Event : sig
6868
6969 val scan_source : name :string -> start :float -> stop :float -> dir :Path .Source .t -> t
7070 val scheduler_idle : unit -> t
71- val config : unit -> t
71+ val config : version : string option -> t
7272
7373 module Rpc : sig
7474 type stage =
You can’t perform that action at this time.
0 commit comments