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 calcuated by peak cycle's average
multiply with margin, after technical discussion, module CPC
change to module's peak max.

Signed-off-by: Baofeng Tian <[email protected]>
  • Loading branch information
btian1 committed Nov 7, 2023
1 parent 19a0efc commit 624dd9c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 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 @@ -274,8 +271,8 @@ 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
comp_peak_max_cycles = perf_info.groupby('COMP_ID')['CPU_PEAK'].max()
perf_stats['MODULE_CPC'] = comp_peak_max_cycles
# change data type from float to int
perf_stats['MODULE_CPC'] = perf_stats['MODULE_CPC'].astype(int)

Expand Down

0 comments on commit 624dd9c

Please sign in to comment.