Skip to content

Commit

Permalink
Add support for Num_CPUs aux value
Browse files Browse the repository at this point in the history
Num_CPUs is special in that the # prefix is missing. It maps to the
perf num_cpus_online literal.
  • Loading branch information
captain5050 committed Jan 4, 2024
1 parent a510771 commit e150754
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/create_perf_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ def is_topdown_row(key: str) -> bool:
form = find_form()
if form and form != '#NA':
aux_name = field('Level1')
assert aux_name.startswith('#')
assert aux_name.startswith('#') or aux_name == 'Num_CPUs'
aux[aux_name] = form
_verboseprint3(f'Adding aux {aux_name}: {form}')

Expand Down Expand Up @@ -1103,8 +1103,11 @@ def bracket(expr):
return expr

def resolve_aux(v: str) -> str:
if any(v == i for i in ['#core_wide', '#Model', '#SMT_on', '#num_dies','#has_pmem']):
if any(v == i for i in ['#core_wide', '#Model', '#SMT_on', '#num_dies',
'#has_pmem', '#num_cpus_online']):
return v
if v == 'Num_CPUs':
return '#num_cpus_online'
if v == '#PMM_App_Direct':
return '#has_pmem > 0'
if v == '#DurationTimeInSeconds':
Expand Down Expand Up @@ -1150,7 +1153,7 @@ def resolve(v: str) -> str:
return expand_hhq(v[3:])
if v.startswith('##'):
return expand_hh(v[2:])
if v.startswith('#'):
if v.startswith('#') or v == 'Num_CPUs':
return resolve_aux(v)
return resolve_info(v)

Expand Down Expand Up @@ -1194,7 +1197,7 @@ def save_form(name, group, form, desc, locate, scale_unit, threshold,
'num_packages', 'num_cores', 'SYSTEM_TSC_FREQ',
'filter_tid', 'TSC', 'cha', 'config1',
'source_count', 'slots', 'thresh', 'has_pmem',
'num_dies']:
'num_dies', 'num_cpus_online']:
continue
if v.startswith('tma_') or v.startswith('topdown\\-'):
continue
Expand Down

0 comments on commit e150754

Please sign in to comment.