lkml.org 
[lkml]   [2021]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] perf annotate: Add fusion logic for AMD microarchs
Em Fri, Sep 10, 2021 at 04:47:31PM +0530, Ravi Bangoria escreveu:
>
> >> +static bool x86__ins_is_fused(struct arch *arch, const char *ins1,
> >> + const char *ins2)
> >> +{
> >> + if (strstarts(arch->vendor, "AuthenticAMD"))
> >> + return amd__ins_is_fused(arch, ins1, ins2);
> >> +
> >> + return intel__ins_is_fused(arch, ins1, ins2);
> >> +}
> >> +
> >
> > Can we instead make x86__ins_is_fused be a pointer and instead of
> > storing arch->vendor we set it to one of amd__ins_is_fused() or
> > intel__ins_is_fused()?
> >
> > I.e. here:
> >
> >> static int x86__cpuid_parse(struct arch *arch, char *cpuid)
> >> {
> >> unsigned int family, model, stepping;
> >> @@ -184,6 +216,9 @@ static int x86__cpuid_parse(struct arch *arch, char *cpuid)
> >> if (ret == 3) {
> >> arch->family = family;
> >> arch->model = model;
> >> + arch->vendor = strndup(cpuid, 12);
> >
> > x86__ins_is_fused = strstarts(cpuid, "AuthenticAMD") ?
> > amd__ins_is_fused :
> > intel__ins_is_fused;
>
> Sure. Will post v2.

Thanks, if you're quick we may get this into this merge window :-)

> Thanks for the review Arnaldo,

- Arnaldo

\
 
 \ /
  Last update: 2021-09-10 16:20    [W:0.067 / U:1.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site