Skip to content

Commit d6ae791

Browse files
btian1Chao Song
authored andcommitted
tools: sof_perf_analyzer: change module CPC calculation
In daily performance test, we have a high and abnormal peak cycle for some module, recently, we find this abnormal peak cycle is caused by IRQ. Previously, module CPC is calculated by multiplying the mean value of cpu_peak with a margin scalar. With further team discussion based on the new finding, an agreement is reached to use the product of module average cycle and a margin as module CPC. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
1 parent 5639d86 commit d6ae791

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

tools/sof_perf_analyzer.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,14 @@
2727

2828
import pandas as pd
2929

30-
# currently, keep CPC = max(module peak) * CPC_MARGIN
31-
CPC_MARGIN = 1.1
30+
# CPC_MARGIN is set to 1.5, because there is some inactive code for some module
31+
# due to unmet condition. For example:
32+
# volume: ramp operation only run on volume change, but we don't do volume
33+
# change in our test.
34+
35+
# So, we set a relative high margin for avg cycles.
36+
# CPC = AVG(module) * CPC_MARGIN
37+
CPC_MARGIN = 1.5
3238

3339
@dataclass()
3440
class TraceItem:
@@ -243,7 +249,7 @@ def analyze_perf_info():
243249
perf_stats.columns = ['CPU_AVG(MIN)', 'CPU_AVG(AVG)', 'CPU_AVG(MAX)',
244250
'CPU_PEAK(MIN)', 'CPU_PEAK(AVG)', 'CPU_PEAK(MAX)']
245251
perf_stats['PEAK(MAX)/AVG(AVG)'] = perf_stats['CPU_PEAK(MAX)'] / perf_stats['CPU_AVG(AVG)']
246-
perf_stats['MODULE_CPC'] = perf_info.groupby('COMP_ID')['CPU_PEAK'].max() * CPC_MARGIN
252+
perf_stats['MODULE_CPC'] = perf_info.groupby('COMP_ID')['CPU_AVG'].mean() * CPC_MARGIN
247253
# change data type from float to int
248254
perf_stats['MODULE_CPC'] = perf_stats['MODULE_CPC'].astype(int)
249255

0 commit comments

Comments
 (0)