lkml.org 
[lkml]   [2022]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v6 2/4] perf jevents: Add python converter script
On Wed, Jun 29, 2022 at 9:56 AM John Garry <john.garry@huawei.com> wrote:
>
> 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?

I think it is something ripe for cleanup, no particular thoughts on
this case. I'd like to make it so that jevents/pmu-events is aligned
with sysfs, which this relates to.

Thanks,
Ian

> 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 20:13    [W:0.402 / U:0.840 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site