@@ -63,11 +63,10 @@ pub fn map_logs(
6363
6464fn slice_to_log ( slice : & PerfettoSlice , converter : & TimestampConverter ) -> LogRecord {
6565 let ts = converter. to_realtime ( slice. ts ) . ok ( ) . flatten ( ) . unwrap_or ( 0 ) ;
66- let dur_ns = slice. dur as u64 ;
67- let dur_us = dur_ns as f64 / 1000.0 ;
66+ let dur_us = slice. dur as f64 / 1000.0 ;
6867 let name = slice. name . as_deref ( ) . unwrap_or ( "(unnamed)" ) ;
6968
70- let body = format ! ( "{name} ts={ts} dur={dur_us:.1}us depth={}" , slice. depth) ;
69+ let body = format ! ( "{name} dur={dur_us:.1}us depth={}" , slice. depth) ;
7170
7271 LogRecord {
7372 time_unix_nano : ts,
@@ -103,9 +102,10 @@ fn slice_to_log(slice: &PerfettoSlice, converter: &TimestampConverter) -> LogRec
103102
104103fn sched_slice_to_log ( s : & PerfettoSchedSlice , converter : & TimestampConverter ) -> LogRecord {
105104 let ts = converter. to_realtime ( s. ts ) . ok ( ) . flatten ( ) . unwrap_or ( 0 ) ;
106- let dur_us = s. dur as f64 / 1000.0 ;
107105 let end = s. end_state . as_deref ( ) . unwrap_or ( "?" ) ;
108- let body = format ! ( "cpu={} dur={dur_us:.1}us state={end} utid={} ts={ts}" , s. cpu, s. utid) ;
106+ let dur_ns = s. dur as u64 ;
107+ let dur_us = dur_ns as f64 / 1000.0 ;
108+ let body = format ! ( "cpu={} state={end} utid={} dur={dur_us:.1}us" , s. cpu, s. utid) ;
109109
110110 LogRecord {
111111 time_unix_nano : ts,
@@ -122,6 +122,10 @@ fn sched_slice_to_log(s: &PerfettoSchedSlice, converter: &TimestampConverter) ->
122122 key: "perfetto.sched.cpu" . to_string( ) ,
123123 value: Some ( AnyValue { value: Some ( Value :: IntValue ( s. cpu) ) } ) ,
124124 } ,
125+ KeyValue {
126+ key: "perfetto.sched.dur_ns" . to_string( ) ,
127+ value: Some ( AnyValue { value: Some ( Value :: IntValue ( s. dur) ) } ) ,
128+ } ,
125129 KeyValue {
126130 key: "perfetto.sched.end_state" . to_string( ) ,
127131 value: Some ( AnyValue { value: Some ( Value :: StringValue ( end. to_string( ) ) ) } ) ,
0 commit comments