lkml.org 
[lkml]   [2022]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v6 2/4] perf jevents: Add python converter script
From
On 27/06/2022 03:57, Ian Rogers wrote:
> +
> + def unit_to_pmu(unit: str) -> str:
> + """Convert a JSON Unit to Linux PMU name."""
> + if not unit:
> + return None
> + # Comment brought over from jevents.c:
> + # it's not realistic to keep adding these, we need something more scalable ...

Since we're converting to python it might be a good idea to consider
this - ever have an ideas on something better?

Thanks,
John

> + table = {
> + 'CBO': 'uncore_cbox',
> + 'QPI LL': 'uncore_qpi',
> + 'SBO': 'uncore_sbox',
> + 'iMPH-U': 'uncore_arb',
> + 'CPU-M-CF': 'cpum_cf',
> + 'CPU-M-SF': 'cpum_sf',
> + 'UPI LL': 'uncore_upi',
> + 'hisi_sicl,cpa': 'hisi_sicl,cpa',
> + 'hisi_sccl,ddrc': 'hisi_sccl,ddrc',
> + 'hisi_sccl,hha': 'hisi_sccl,hha',
> + 'hisi_sccl,l3c': 'hisi_sccl,l3c',
> + 'imx8_ddr': 'imx8_ddr',
> + 'L3PMC': 'amd_l3',
> + 'DFPMC': 'amd_df',
> + 'cpu_core': 'cpu_core',
> + 'cpu_atom': 'cpu_atom',
> + }
> + return table[unit] if unit in table else f'uncore_{unit.lower()}'
> +

\
 
 \ /
  Last update: 2022-06-29 18:58    [W:0.094 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site