lkml.org 
[lkml]   [2020]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH v2] tools/x86: add kcpuid tool to show raw CPU features
From
Date
On 9/21/20 10:27 PM, Feng Tang wrote:
> +static void parse_text(void)
> +{
> + FILE *file;
> + char *line = NULL;
> + size_t len = 0;
> + int ret;
> +
> + file = fopen("cpuid.txt", "r");
> + if (!file) {
> + printf("Error in opening 'cpuid.txt'\n");
> + return;
> + }

This mostly looks fine to me. A few things about cpuid.txt, though...
It needs to be read out of *some* location which is not the current
directory. Maybe:

/usr/share/hwdata/cpu.ids

or something. It also needs a "-f" argument to override this default
location. I don't know if there's a better per-kernel place to put this
file, though.

\
 
 \ /
  Last update: 2020-09-22 21:38    [W:0.152 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site