File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -95,10 +95,12 @@ executor-thread = []
95
95
executor-interrupt = []
96
96
# # Enable tracing support (adds some overhead)
97
97
trace = []
98
+ # # Enable selective tracing support
99
+ trace-mode-selective = [" trace" ]
98
100
# # Enable support for rtos-trace framework (traces all tasks by default)
99
101
rtos-trace = [" dep:rtos-trace" , " trace" , " dep:embassy-time-driver" ]
100
102
# # Only trace tasks that are explicitly marked for tracing (selective mode)
101
- rtos-trace-selective = [" rtos-trace" ]
103
+ rtos-trace-selective = [" rtos-trace" , " trace-mode-selective " ]
102
104
103
105
# ! ### Timer Item Payload Size
104
106
# ! Sets the size of the payload for timer items, allowing integrated timer implementors to store
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ pub(crate) struct TaskHeader {
93
93
pub ( crate ) name : Option < & ' static str > ,
94
94
#[ cfg( feature = "trace" ) ]
95
95
pub ( crate ) id : u32 ,
96
- #[ cfg( feature = "trace" ) ]
96
+ #[ cfg( feature = "trace-mode-selective " ) ]
97
97
pub ( crate ) trace_excluded : bool ,
98
98
#[ cfg( feature = "trace" ) ]
99
99
all_tasks_next : AtomicPtr < TaskHeader > ,
@@ -196,7 +196,7 @@ impl<F: Future + 'static> TaskStorage<F> {
196
196
name : None ,
197
197
#[ cfg( feature = "trace" ) ]
198
198
id : 0 ,
199
- #[ cfg( feature = "trace" ) ]
199
+ #[ cfg( feature = "trace-mode-selective " ) ]
200
200
trace_excluded : cfg ! ( feature = "rtos-trace-selective" ) ,
201
201
#[ cfg( feature = "trace" ) ]
202
202
all_tasks_next : AtomicPtr :: new ( core:: ptr:: null_mut ( ) ) ,
Original file line number Diff line number Diff line change @@ -213,14 +213,22 @@ impl TaskRefTrace for TaskRef {
213
213
}
214
214
215
215
fn is_trace_excluded ( & self ) -> bool {
216
- self . header ( ) . trace_excluded
216
+ #[ cfg( feature = "trace-mode-selective" ) ]
217
+ {
218
+ self . header ( ) . trace_excluded
219
+ }
220
+ #[ cfg( not( feature = "trace-mode-selective" ) ) ]
221
+ false
217
222
}
218
223
219
224
fn set_trace_excluded ( & self , excluded : bool ) {
225
+ #[ cfg( feature = "trace-mode-selective" ) ]
220
226
unsafe {
221
227
let header_ptr = self . ptr . as_ptr ( ) as * mut TaskHeader ;
222
228
( * header_ptr) . trace_excluded = excluded;
223
229
}
230
+ #[ cfg( not( feature = "trace-mode-selective" ) ) ]
231
+ let _ = excluded;
224
232
}
225
233
}
226
234
You can’t perform that action at this time.
0 commit comments