diff options
author | David Sommerseth <davids@redhat.com> | 2011-10-07 13:56:06 +0200 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2011-10-07 18:11:06 +0200 |
commit | a5e7518839e3054cfb05c9b12094c5a27b199e56 (patch) | |
tree | 621d499b0f0aa620eb0399947f6c6d7f9bcce165 /server/parser/xmlparser.xsl | |
parent | e1182d1a0a5f3a8f7ddba70d0a49720e5f069ce1 (diff) | |
download | rteval-a5e7518839e3054cfb05c9b12094c5a27b199e56.tar.gz rteval-a5e7518839e3054cfb05c9b12094c5a27b199e56.tar.xz rteval-a5e7518839e3054cfb05c9b12094c5a27b199e56.zip |
Added support for PostgreSQL arrays + store cpu_topology CPU spread as an array
Implemented a new value type for the internal <sqldata/> XML format, which will
store data in an PostgreSQL array. This is used now to store the CPU core spread
of the socket in a sepearate field in rtevalruns_details.
Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'server/parser/xmlparser.xsl')
-rw-r--r-- | server/parser/xmlparser.xsl | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/server/parser/xmlparser.xsl b/server/parser/xmlparser.xsl index 005d303..2ee9370 100644 --- a/server/parser/xmlparser.xsl +++ b/server/parser/xmlparser.xsl @@ -23,6 +23,9 @@ <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> + <!-- Used for iterating CPU topology information --> + <xsl:key name="pkgkey" match="cpu" use="@physical_package_id"/> + <xsl:template match="/rteval"> <xsl:choose> <!-- TABLE: systems --> @@ -132,7 +135,7 @@ <xsl:text>Invalid 'rterid' parameter value: </xsl:text><xsl:value-of select="$rterid"/> </xsl:message> </xsl:if> - <sqldata schemaver="1.3" table="rtevalruns_details"> + <sqldata schemaver="1.4" table="rtevalruns_details"> <fields> <field fid="0">rterid</field> <field fid="1">numa_nodes</field> @@ -140,6 +143,7 @@ <field fid="3">num_cpu_sockets</field> <field fid="4">xmldata</field> <field fid="5">annotation</field> + <field fid="6">cpu_core_spread</field> </fields> <records> <record> @@ -167,6 +171,13 @@ </rteval_details> </value> <value fid="5"><xsl:value-of select="run_info/annotate"/></value> + <value fid="6" type="array"> + <xsl:for-each select="hardware/cpu_topology/cpu[generate-id() = generate-id(key('pkgkey', @physical_package_id)[1])]"> + <xsl:call-template name="count_core_spread"> + <xsl:with-param name="pkgid" select="@physical_package_id"/> + </xsl:call-template> + </xsl:for-each> + </value> </record> </records> </sqldata> @@ -290,4 +301,12 @@ <value fid="3"><xsl:value-of select="@value"/></value> </record> </xsl:template> + + <!-- Helper "function" for generating a core per physical socket spread overview --> + <xsl:template name="count_core_spread"> + <xsl:param name="pkgid"/> + <value> + <xsl:value-of select="count(/rteval/hardware/cpu_topology/cpu[@physical_package_id = $pkgid])"/> + </value> + </xsl:template> </xsl:stylesheet> |