* [PATCH v3] rteval: Add measurement and load location to run report
@ 2022-08-16 16:20 Leah Leshchinsky
2022-08-16 17:27 ` John Kacur
0 siblings, 1 reply; 2+ messages in thread
From: Leah Leshchinsky @ 2022-08-16 16:20 UTC (permalink / raw)
To: jkacur; +Cc: linux-rt-users
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..2f7f1d4356ae 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, CpuList, SysTopology as SysTop
class LoadThread(rtevalModulePrototype):
def __init__(self, name, config, logger=None):
@@ -131,6 +132,13 @@ 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 cpulist:
+ cpulist = CpuList(cpulist).cpulist
+ else:
+ cpulist = SysTop().online_cpus()
+ rep_n.newProp("loadcpus", collapse_cpulist(cpulist))
return rep_n
diff --git a/rteval/modules/measurement/__init__.py b/rteval/modules/measurement/__init__.py
index 318248bd7e35..90e1839333bb 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, CpuList, SysTopology as SysTop
class MeasurementProfile(RtEvalModules):
"""Keeps and controls all the measurement modules with the same measurement profile"""
@@ -189,6 +189,13 @@ 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 cpulist:
+ cpulist = CpuList(cpulist).cpulist
+ else:
+ cpulist = SysTop().online_cpus()
+ rep_n.newProp("measurecpus", collapse_cpulist(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> </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> </xsl:text>
+
+ <xsl:text> Measurement: </xsl:text>
+ <xsl:text>measurement threads run on cores </xsl:text><xsl:value-of select="Measurements/@measurecpus"/>
+ <xsl:text> </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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v3] rteval: Add measurement and load location to run report
2022-08-16 16:20 [PATCH v3] rteval: Add measurement and load location to run report Leah Leshchinsky
@ 2022-08-16 17:27 ` John Kacur
0 siblings, 0 replies; 2+ messages in thread
From: John Kacur @ 2022-08-16 17:27 UTC (permalink / raw)
To: Leah Leshchinsky; +Cc: linux-rt-users
On Tue, 16 Aug 2022, 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..2f7f1d4356ae 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, CpuList, SysTopology as SysTop
>
> class LoadThread(rtevalModulePrototype):
> def __init__(self, name, config, logger=None):
> @@ -131,6 +132,13 @@ 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 cpulist:
> + cpulist = CpuList(cpulist).cpulist
> + else:
> + cpulist = SysTop().online_cpus()
> + rep_n.newProp("loadcpus", collapse_cpulist(cpulist))
>
> return rep_n
>
> diff --git a/rteval/modules/measurement/__init__.py b/rteval/modules/measurement/__init__.py
> index 318248bd7e35..90e1839333bb 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, CpuList, SysTopology as SysTop
>
> class MeasurementProfile(RtEvalModules):
> """Keeps and controls all the measurement modules with the same measurement profile"""
> @@ -189,6 +189,13 @@ 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 cpulist:
> + cpulist = CpuList(cpulist).cpulist
> + else:
> + cpulist = SysTop().online_cpus()
> + rep_n.newProp("measurecpus", collapse_cpulist(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> </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> </xsl:text>
> +
> + <xsl:text> Measurement: </xsl:text>
> + <xsl:text>measurement threads run on cores </xsl:text><xsl:value-of select="Measurements/@measurecpus"/>
> + <xsl:text> </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
>
>
Great!
I tested this with:
no args
--measurement-cpulist=CPULIST
--loads-cpulist=CPULIST
--measurement-cpulist =CPULIST1 --loads-cpulist=CPULIST2
and they all worked as expected.
Then I repeated all of the above after turning off cpu3
The only thing I would request is to add a hash style comment above
the two lines
cpulist = CpuList(cpulist).cpulist
to explain that this takes a string and transforms it to a list and
removes any cpus that are offline. I'll let you figure out how to say that
succinctly! After that it's ready to be integrated.
Thanks
John
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-16 17:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-16 16:20 [PATCH v3] rteval: Add measurement and load location to run report Leah Leshchinsky
2022-08-16 17:27 ` John Kacur
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox