Skip to content

Commit

Permalink
Fix macro to access overflow node
Browse files Browse the repository at this point in the history
Previously accessing the ccnt_num_overflows
value using the NODE_STATE macro. In SMP
configurations, this looks for this value
in the system node state, however, it
resides in the cpu arch node state. This should
therefore be accessed using the ARCH_NODE_STATE.

Signed-off-by: Krishnan Winter <[email protected]>
  • Loading branch information
Kswin01 authored and Indanz committed Mar 27, 2024
1 parent 4d7cde0 commit 21d6998
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions include/arch/arm/arch/benchmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static inline void handleOverflowIRQ(void)
if (likely(NODE_STATE(benchmark_log_utilisation_enabled))) {
NODE_STATE(ksCurThread)->benchmark.utilisation += UINT32_MAX - NODE_STATE(ksCurThread)->benchmark.schedule_start_time;
NODE_STATE(ksCurThread)->benchmark.schedule_start_time = 0;
NODE_STATE(ccnt_num_overflows)++;
ARCH_NODE_STATE(ccnt_num_overflows)++;
}
armv_handleOverflowIRQ();
}
Expand All @@ -46,7 +46,7 @@ static inline void handleOverflowIRQ(void)
static inline void benchmark_arch_utilisation_reset(void)
{
#ifdef CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT
NODE_STATE(ccnt_num_overflows) = 0;
ARCH_NODE_STATE(ccnt_num_overflows) = 0;
#endif /* CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT */
}
#endif /* CONFIG_ENABLE_BENCHMARKS */
Expand Down
2 changes: 1 addition & 1 deletion src/benchmark/benchmark_utilisation.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void benchmark_track_utilisation_dump(void)
/* Total counters */
#ifdef CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT
buffer[BENCHMARK_TOTAL_UTILISATION] =
(NODE_STATE(ccnt_num_overflows) * 0xFFFFFFFFU) + NODE_STATE(benchmark_end_time) - NODE_STATE(benchmark_start_time);
(ARCH_NODE_STATE(ccnt_num_overflows) * 0xFFFFFFFFU) + NODE_STATE(benchmark_end_time) - NODE_STATE(benchmark_start_time);
#else
buffer[BENCHMARK_TOTAL_UTILISATION] = NODE_STATE(benchmark_end_time) - NODE_STATE(
benchmark_start_time); /* Overall time */
Expand Down

0 comments on commit 21d6998

Please sign in to comment.