public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Leah Leshchinsky <lleshchi@redhat.com>
To: jkacur@redhat.com
Cc: linux-rt-users@vger.kernel.org
Subject: Re: [PATCH v2] rteval: Add measurement and load location to run report
Date: Fri, 5 Aug 2022 09:37:59 -0400	[thread overview]
Message-ID: <Yu0dNzEf76KtzQ+I@lleshchi.bos.csb> (raw)
In-Reply-To: <20220804154807.252163-1-lleshchi@redhat.com>

On Thu, Aug 04, 2022 at 11:48:07AM -0400, Leah Leshchinsky wrote:
> The run report produced at the end of a run does not contain information
> on load and measurement thread locations.
> 
> Adjust MakeReport() functions of LoadModules and MeasurementModules
> class so that new properties with number of loads and cpu information
> are added to the XML report and can be read by rteval_text.xsl.
> 
> Signed-off-by: Leah Leshchinsky <lleshchi@redhat.com>
> 
> diff --git a/rteval/modules/loads/__init__.py b/rteval/modules/loads/__init__.py
> index 2c2105efa964..5e5a5d85b616 100644
> --- a/rteval/modules/loads/__init__.py
> +++ b/rteval/modules/loads/__init__.py
> @@ -30,6 +30,7 @@ import libxml2
>  from rteval.Log import Log
>  from rteval.rtevalConfig import rtevalCfgSection
>  from rteval.modules import RtEvalModules, rtevalModulePrototype
> +from rteval.systopology import collapse_cpulist, SysTopology
>  
>  class LoadThread(rtevalModulePrototype):
>      def __init__(self, name, config, logger=None):
> @@ -131,6 +132,12 @@ class LoadModules(RtEvalModules):
>      def MakeReport(self):
>          rep_n = RtEvalModules.MakeReport(self)
>          rep_n.newProp("load_average", str(self.GetLoadAvg()))
> +        rep_n.newProp("loads", str(self.ModulesLoaded()))
> +        cpulist = self._cfg.GetSection(self._module_config).cpulist
> +        if not cpulist:
> +            st = SysTopology()
> +            cpulist = collapse_cpulist(st.online_cpus())
> +        rep_n.newProp("loadcpus", cpulist)
>  
>          return rep_n
>  
> diff --git a/rteval/modules/measurement/__init__.py b/rteval/modules/measurement/__init__.py
> index 318248bd7e35..371fc5d08f44 100644
> --- a/rteval/modules/measurement/__init__.py
> +++ b/rteval/modules/measurement/__init__.py
> @@ -24,7 +24,7 @@
>  
>  import libxml2
>  from rteval.modules import RtEvalModules, ModuleContainer
> -
> +from rteval.systopology import collapse_cpulist, SysTopology
>  
>  class MeasurementProfile(RtEvalModules):
>      """Keeps and controls all the measurement modules with the same measurement profile"""
> @@ -189,6 +189,12 @@ measurement profiles, based on their characteristics"""
>  
>          # Get the reports from all meaurement modules in all measurement profiles
>          rep_n = libxml2.newNode("Measurements")
> +        cpulist = self.__cfg.GetSection("measurement").cpulist
> +        if not cpulist:
> +            st = SysTopology()
> +            cpulist = collapse_cpulist(st.online_cpus())
> +        rep_n.newProp("measurecpus", cpulist)
> +
>          for mp in self.__measureprofiles:
>              mprep_n = mp.MakeReport()
>              if mprep_n:
> diff --git a/rteval/rteval_text.xsl b/rteval/rteval_text.xsl
> index c40063e3dd19..7ecfac6b6140 100644
> --- a/rteval/rteval_text.xsl
> +++ b/rteval/rteval_text.xsl
> @@ -13,6 +13,14 @@
>      <xsl:value-of select="run_info/date"/><xsl:text> </xsl:text><xsl:value-of select="run_info/time"/>
>      <xsl:text>&#10;</xsl:text>
>  
> +    <xsl:text>   Loads:        </xsl:text>
> +    <xsl:value-of select="loads/@loads"/><xsl:text> loads run on cores </xsl:text><xsl:value-of select="loads/@loadcpus"/>
> +    <xsl:text>&#10;</xsl:text>
> +
> +    <xsl:text>   Measurement:  </xsl:text>
> +    <xsl:text>measurement threads run on cores </xsl:text><xsl:value-of select="Measurements/@measurecpus"/>
> +    <xsl:text>&#10;</xsl:text>
> +
>      <xsl:text>   Run time:     </xsl:text>
>      <xsl:value-of select="run_info/@days"/><xsl:text> days </xsl:text>
>      <xsl:value-of select="run_info/@hours"/><xsl:text>h </xsl:text>
> -- 
> 2.31.1
> 

Hi John,

I do believe the cpulist variable can be empty. I was able to test this by running rteval without specifying and load and measurement cpus.

This patch is attempting to replicate the behavior found in rteval/__init.py lines 187-201, which also finds the cpulist using
            cpulist = self._loadmods._cfg.GetSection("loads").cpulist
and if the cpulist is empty, defaults to reporting the online cpus. I assume this is because the rteval program uses all available cpus
to run measurement and load threads if no specific cpus are specified.

Please let me know if I am misunderstanding any of the above.

I will investigate why the xsl code is not working for you. It seems to be working for me at the moment.

Thank you for the review,
Leah


  parent reply	other threads:[~2022-08-05 13:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-04 15:48 [PATCH v2] rteval: Add measurement and load location to run report Leah Leshchinsky
2022-08-04 23:56 ` John Kacur
2022-08-05 13:37 ` Leah Leshchinsky [this message]
2022-08-05 16:32   ` John Kacur
2022-08-05 17:03     ` Leah Leshchinsky
2022-08-05 17:14       ` John Kacur

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=Yu0dNzEf76KtzQ+I@lleshchi.bos.csb \
    --to=lleshchi@redhat.com \
    --cc=jkacur@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    /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