File tree Expand file tree Collapse file tree 3 files changed +21
-18
lines changed Expand file tree Collapse file tree 3 files changed +21
-18
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ features = [ "full" ]
60
60
61
61
[dependencies .usdt ]
62
62
version = " 0.3.2"
63
+ optional = true
63
64
default-features = false
64
65
65
66
[dependencies .uuid ]
Original file line number Diff line number Diff line change @@ -578,6 +578,7 @@ pub(crate) struct ResponseInfo {
578
578
message : String ,
579
579
}
580
580
581
+ #[ cfg( feature = "usdt-probes" ) ]
581
582
#[ usdt:: provider( provider = "dropshot" ) ]
582
583
mod probes {
583
584
use crate :: { RequestInfo , ResponseInfo } ;
Original file line number Diff line number Diff line change @@ -162,25 +162,26 @@ impl<C: ServerContext> HttpServerStarter<C> {
162
162
} ;
163
163
info ! ( self . app_state. log, "listening" ) ;
164
164
165
- let probe_registration = if cfg ! ( feature = "usdt-probes" ) {
166
- match usdt:: register_probes ( ) {
167
- Ok ( _) => {
168
- debug ! (
169
- self . app_state. log,
170
- "successfully registered DTrace USDT probes"
171
- ) ;
172
- ProbeRegistration :: Succeeded
173
- }
174
- Err ( e) => {
175
- let msg = e. to_string ( ) ;
176
- error ! (
177
- self . app_state. log,
178
- "failed to register DTrace USDT probes: {}" , msg
179
- ) ;
180
- ProbeRegistration :: Failed ( msg)
181
- }
165
+ #[ cfg( feature = "usdt-probes" ) ]
166
+ let probe_registration = match usdt:: register_probes ( ) {
167
+ Ok ( _) => {
168
+ debug ! (
169
+ self . app_state. log,
170
+ "successfully registered DTrace USDT probes"
171
+ ) ;
172
+ ProbeRegistration :: Succeeded
182
173
}
183
- } else {
174
+ Err ( e) => {
175
+ let msg = e. to_string ( ) ;
176
+ error ! (
177
+ self . app_state. log,
178
+ "failed to register DTrace USDT probes: {}" , msg
179
+ ) ;
180
+ ProbeRegistration :: Failed ( msg)
181
+ }
182
+ } ;
183
+ #[ cfg( not( feature = "usdt-probes" ) ) ]
184
+ let probe_registration = {
184
185
debug ! (
185
186
self . app_state. log,
186
187
"DTrace USDT probes compiled out, not registering"
You can’t perform that action at this time.
0 commit comments