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)
209209 * sent the notification in pm_system_resume().
210210 */
211211 k_sched_lock ();
212- pm_stats_start ();
212+
213+ if (IS_ENABLED (CONFIG_PM_STATS )) {
214+ pm_stats_start ();
215+ }
213216 /* Enter power state */
214217 pm_state_notify (true);
215218 atomic_set_bit (z_post_ops_required , id );
216219 pm_state_set (z_cpus_pm_state [id ]-> state , z_cpus_pm_state [id ]-> substate_id );
217- pm_stats_stop ();
218220
219221 /* 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+
221228 pm_system_resume ();
222229 k_sched_unlock ();
223230 SYS_PORT_TRACING_FUNC_EXIT (pm , system_suspend , ticks ,
Original file line number Diff line number Diff line change 1010
1111#include <zephyr/pm/state.h>
1212
13- #ifdef CONFIG_PM_STATS
1413void pm_stats_start (void );
1514void pm_stats_stop (void );
1615void 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 */
2216
2317#endif /* ZEPHYR_SUBSYS_PM_PM_STATS_H_ */
You can’t perform that action at this time.
0 commit comments