lkml.org 
[lkml]   [2021]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 11/13] perf tools: improve IBS error handling


On October 4, 2021 6:57:09 PM GMT-03:00, Kim Phillips <kim.phillips@amd.com> wrote:
>On 9/13/21 2:34 PM, Arnaldo Carvalho de Melo wrote:
>> Em Thu, Sep 09, 2021 at 12:56:58AM -0700, Stephane Eranian escreveu:
>>> From: Kim Phillips <kim.phillips@amd.com>
>>> +static void detect_amd(void)
>>> +{
>>> + FILE *inf = fopen("/proc/cpuinfo", "r");
>>> + char *res;
>>> +
>>> + if (!inf)
>>> + return;
>>> +
>>> + res = fgrep(inf, "vendor_id");
>>> +
>>> + if (res) {
>>> + char *s = strchr(res, ':');
>>> +
>>> + is_amd = s && !strcmp(s, ": AuthenticAMD\n");
>>> + free(res);
>>> + }
>>> + fclose(inf);
>>> +}
>>> +
>>
>> We have perf_env for such details, for instance in
>> tools/perf/util/sample-raw.c we have:o
>>
>> const char *arch_pf = perf_env__arch(evlist->env);
>> const char *cpuid = perf_env__cpuid(evlist->env);
>>
>> else if (arch_pf && !strcmp("x86", arch_pf) &&
>> cpuid && strstarts(cpuid, "AuthenticAMD") &&
>> evlist__has_amd_ibs(evlist)) {
>
>OK, I've rebased this 11/13 patch onto the new perf_env__{arch,cpuid}
>code, and posted it here:
>
>https://lore.kernel.org/lkml/20211004214114.188477-1-kim.phillips@amd.com/T/#mc4c9c582e3816ab31af6d0187e6803de1a98ac84
>
>The following 12/13 patch in this series changes, too, but since it
>depends on prior patches in the series, I'll reply-all to 12/13 with its
>new version.
>
>Arnaldo, would it be ok to apply the two new patches that replace this
>11/13? They don't depend on any others in this series, and it would
>save Stephane from having to carry them.


I'll work in this tomorrow, thanks

- Arnaldo
>
>Thanks,
>
>Kim

\
 
 \ /
  Last update: 2021-10-05 01:47    [W:0.066 / U:0.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site