public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: John Kacur <jkacur@redhat.com>
To: Punit Agrawal <punitagrawal@gmail.com>
Cc: Clark Williams <williams@redhat.com>,
	RT <linux-rt-users@vger.kernel.org>,
	Punit Agrawal <punit1.agrawal@toshiba.co.jp>
Subject: Re: [PATCH 2/5 V2] rteval: Construct a 'model name' on architectures that don't have one
Date: Mon, 13 Sep 2021 08:37:20 -0400 (EDT)	[thread overview]
Message-ID: <618d5d5d-4215-adaf-692b-e18fc7c4d5b@redhat.com> (raw)
In-Reply-To: <87tuip9oea.fsf@stealth>



On Mon, 13 Sep 2021, Punit Agrawal wrote:

> Hi John,
> 
> John Kacur <jkacur@redhat.com> writes:
> 
> > This is based on an idea from Punit Agrawal <punit1.agrawal@toshiba.co.jp>
> >
> > On architectures that lack 'model name' in /proc/cpuinfo
> > create 'model name' Unknown when creating the per core dictionaries
> > in cpuinfo
> >
> > For arm, we can construct the 'model name' from the
> > 'CPU implementer'
> > 'CPU architecture'
> > 'CPU variant'
> > 'CPU part'
> > 'CPU revision'
> >
> > Suggested-by: Punit Agrawal <punit1.agrawal@toshiba.co.jp>
> > Signed-off-by: John Kacur <jkacur@redhat.com>
> > ---
> >  rteval/misc.py | 21 +++++++++++++++++++++
> >  1 file changed, 21 insertions(+)
> >
> > diff --git a/rteval/misc.py b/rteval/misc.py
> > index 0dd361ff19fd..c1d2a972430d 100644
> > --- a/rteval/misc.py
> > +++ b/rteval/misc.py
> > @@ -77,6 +77,27 @@ def cpuinfo():
> >              info[core] = {}
> >              continue
> >          info[core][key] = val
> > +
> > +    for (core, pcdict) in info.items():
> > +        if not 'model name' in pcdict:
> > +            # On Arm CPU implementer is present
> > +            # Construct the model_name from the following fields
> > +            if 'CPU implementer' in pcdict:
> > +                model_name = [pcdict.get('CPU implementer')]
> > +                model_name.append(pcdict.get('CPU architecture'))
> > +                model_name.append(pcdict.get('CPU variant'))
> > +                model_name.append(pcdict.get('CPU part'))
> > +                model_name.append(pcdict.get('CPU revision', ''))
> 
> Is there a reason to use an empty default for "CPU revision" but not for
> the other components? Maybe a left-over from original patch.

Not sure of the origin of that typo, but thanks for catching it, removing.

> 
> > +
> > +                # If a list item is None, remove it
> > +                model_name = [name for name in model_name if name]
> > +
> > +                # Convert the model_name list into a string
> > +                model_name = " ".join(model_name)
> > +                pcdict['model name'] = model_name
> > +            else:
> > +                pcdict['model name'] = 'Unknown'
> > +
> >      return info
> >  
> >  if __name__ == "__main__":
> 
> With the above comment addressed, fwiw -
> 
> Reviewed-by: Punit Agrawal <punit1.agrawal@toshiba.co.jp>
> Tested-by: Punit Agrawal <punit1.agrawal@toshiba.co.jp>
> 
> Thanks,
> Punit
> 


      reply	other threads:[~2021-09-13 12:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-12 15:45 [PATCH 2/5 V2] rteval: Construct a 'model name' on architectures that don't have one John Kacur
2021-09-13  2:53 ` Punit Agrawal
2021-09-13 12:37   ` John Kacur [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=618d5d5d-4215-adaf-692b-e18fc7c4d5b@redhat.com \
    --to=jkacur@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=punit1.agrawal@toshiba.co.jp \
    --cc=punitagrawal@gmail.com \
    --cc=williams@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox