Skip to content

Commit

Permalink
audio: perf: change module CPC calculation
Browse files Browse the repository at this point in the history
Previously, module CPC is calculated by multiplying the mean
value of cpu_peak with a margin scalar, after internal technical
discussion, change module CPC to the maximum value of module's
cpu_peak as aligned.

Signed-off-by: Baofeng Tian <[email protected]>
  • Loading branch information
btian1 committed Nov 13, 2023
1 parent 6715ffb commit 1a8f8ec
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions tools/sof_perf_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@

import pandas as pd

# currently, keep CPC = avg_cpu_peak * CPC_MARGIN
CPC_MARGIN = 1.15

@dataclass()
class TraceItem:
'''The structural representation for a single, parsed line of trace'''
Expand Down Expand Up @@ -237,8 +234,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)']
comp_peak_avg_cycles = perf_info.groupby('COMP_ID')['CPU_PEAK'].mean()
perf_stats['MODULE_CPC'] = comp_peak_avg_cycles * CPC_MARGIN
perf_stats['MODULE_CPC'] = perf_info.groupby('COMP_ID')['CPU_PEAK'].max()
# change data type from float to int
perf_stats['MODULE_CPC'] = perf_stats['MODULE_CPC'].astype(int)

Expand Down

0 comments on commit 1a8f8ec

Please sign in to comment.