Skip to content

Commit

Permalink
tools: sof_perf_analyzer: change module CPC calculation
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
btian1 authored and Chao Song committed Dec 5, 2023
1 parent 5639d86 commit d6ae791
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tools/sof_perf_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@

import pandas as pd

# currently, keep CPC = max(module peak) * CPC_MARGIN
CPC_MARGIN = 1.1
# CPC_MARGIN is set to 1.5, because there is some inactive code for some module
# due to unmet condition. For example:
# volume: ramp operation only run on volume change, but we don't do volume
# change in our test.

# So, we set a relative high margin for avg cycles.
# CPC = AVG(module) * CPC_MARGIN
CPC_MARGIN = 1.5

@dataclass()
class TraceItem:
Expand Down Expand Up @@ -243,7 +249,7 @@ def analyze_perf_info():
perf_stats.columns = ['CPU_AVG(MIN)', 'CPU_AVG(AVG)', 'CPU_AVG(MAX)',
'CPU_PEAK(MIN)', 'CPU_PEAK(AVG)', 'CPU_PEAK(MAX)']
perf_stats['PEAK(MAX)/AVG(AVG)'] = perf_stats['CPU_PEAK(MAX)'] / perf_stats['CPU_AVG(AVG)']
perf_stats['MODULE_CPC'] = perf_info.groupby('COMP_ID')['CPU_PEAK'].max() * CPC_MARGIN
perf_stats['MODULE_CPC'] = perf_info.groupby('COMP_ID')['CPU_AVG'].mean() * CPC_MARGIN
# change data type from float to int
perf_stats['MODULE_CPC'] = perf_stats['MODULE_CPC'].astype(int)

Expand Down

0 comments on commit d6ae791

Please sign in to comment.