File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -209,15 +209,22 @@ bool pm_system_suspend(int32_t kernel_ticks)
209
209
* sent the notification in pm_system_resume().
210
210
*/
211
211
k_sched_lock ();
212
- pm_stats_start ();
212
+
213
+ if (IS_ENABLED (CONFIG_PM_STATS )) {
214
+ pm_stats_start ();
215
+ }
213
216
/* Enter power state */
214
217
pm_state_notify (true);
215
218
atomic_set_bit (z_post_ops_required , id );
216
219
pm_state_set (z_cpus_pm_state [id ]-> state , z_cpus_pm_state [id ]-> substate_id );
217
- pm_stats_stop ();
218
220
219
221
/* Wake up sequence starts here */
220
- pm_stats_update (z_cpus_pm_state [id ]-> state );
222
+
223
+ if (IS_ENABLED (CONFIG_PM_STATS )) {
224
+ pm_stats_stop ();
225
+ pm_stats_update (z_cpus_pm_state [id ]-> state );
226
+ }
227
+
221
228
pm_system_resume ();
222
229
k_sched_unlock ();
223
230
SYS_PORT_TRACING_FUNC_EXIT (pm , system_suspend , ticks ,
Original file line number Diff line number Diff line change 10
10
11
11
#include <zephyr/pm/state.h>
12
12
13
- #ifdef CONFIG_PM_STATS
14
13
void pm_stats_start (void );
15
14
void pm_stats_stop (void );
16
15
void pm_stats_update (enum pm_state state );
17
- #else
18
- static inline void pm_stats_start (void ) {}
19
- static inline void pm_stats_stop (void ) {}
20
- static inline void pm_stats_update (enum pm_state state ) {}
21
- #endif /* CONFIG_PM_STATS */
22
16
23
17
#endif /* ZEPHYR_SUBSYS_PM_PM_STATS_H_ */
You can’t perform that action at this time.
0 commit comments