@@ -4,7 +4,7 @@ use std::io::BufWriter;
44use std:: path:: PathBuf ;
55use std:: time:: { Duration , SystemTime , UNIX_EPOCH } ;
66
7- use analyzeme:: { ProfilingData , Timestamp } ;
7+ use analyzeme:: { ProfilingData , Timestamp , Event as analyzemeEvent } ;
88
99use serde:: ser:: SerializeSeq ;
1010use serde:: { Serialize , Serializer } ;
@@ -116,6 +116,21 @@ fn generate_thread_to_collapsed_thread_mapping(
116116 thread_to_collapsed_thread
117117}
118118
119+ fn get_args ( full_event : & analyzemeEvent ) -> Option < FxHashMap < String , String > > {
120+ if !full_event. additional_data . is_empty ( ) {
121+ Some (
122+ full_event
123+ . additional_data
124+ . iter ( )
125+ . enumerate ( )
126+ . map ( |( i, arg) | ( format ! ( "arg{}" , i) . to_string ( ) , arg. to_string ( ) ) )
127+ . collect ( ) ,
128+ )
129+ } else {
130+ None
131+ }
132+ }
133+
119134fn main ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
120135 let opt = Opt :: from_args ( ) ;
121136
@@ -151,7 +166,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
151166 thread_id : * thread_to_collapsed_thread
152167 . get ( & event. thread_id )
153168 . unwrap_or ( & event. thread_id ) ,
154- args : None ,
169+ args : get_args ( & full_event ) ,
155170 } ;
156171 seq. serialize_element ( & crox_event) ?;
157172 }
0 commit comments