@@ -8,9 +8,9 @@ use std::time::Duration;
88
99use aws_config:: BehaviorVersion ;
1010use clap:: Parser ;
11- use dial9_tokio_telemetry:: telemetry:: {
12- CpuProfilingConfig , RotatingWriter , SchedEventConfig , TracedRuntime ,
13- } ;
11+ use dial9_tokio_telemetry:: telemetry:: { RotatingWriter , TracedRuntime } ;
12+ # [ cfg ( target_os = "linux" ) ]
13+ use dial9_tokio_telemetry :: telemetry :: { CpuProfilingConfig , SchedEventConfig } ;
1414use tokio:: runtime:: Builder ;
1515use tokio_util:: sync:: CancellationToken ;
1616
@@ -81,14 +81,18 @@ fn main() -> std::io::Result<()> {
8181
8282 let mut builder = Builder :: new_multi_thread ( ) ;
8383 builder. worker_threads ( args. worker_threads ) . enable_all ( ) ;
84- let ( runtime, guard) = TracedRuntime :: builder ( )
85- . with_task_tracking ( true )
86- . with_cpu_profiling ( CpuProfilingConfig :: default ( ) )
87- . with_inline_callframe_symbols ( true )
88- . with_sched_events ( SchedEventConfig {
89- include_kernel : true ,
90- } )
91- . build ( builder, Box :: new ( writer) ) ?;
84+ #[ allow( unused_mut) ]
85+ let mut traced_builder = TracedRuntime :: builder ( ) . with_task_tracking ( true ) ;
86+ #[ cfg( target_os = "linux" ) ]
87+ {
88+ traced_builder = traced_builder
89+ . with_cpu_profiling ( CpuProfilingConfig :: default ( ) )
90+ . with_inline_callframe_symbols ( true )
91+ . with_sched_events ( SchedEventConfig {
92+ include_kernel : true ,
93+ } ) ;
94+ }
95+ let ( runtime, guard) = traced_builder. build ( builder, Box :: new ( writer) ) ?;
9296 guard. enable ( ) ;
9397 let handle = guard. handle ( ) ;
9498
0 commit comments