From: Maynard J. <may...@us...> - 2008-11-17 22:53:43
|
Robert Richter wrote: > This adds an xsl script allowing the creation of one event per line > dumps with opreport. The dump is usefull to get text formated output > of all the data in the sampling buffer. The script is installed in the > /usr/share/oprofile/xslt directory. I'll admit to being pretty clueless about xslt. But I couldn't get this patch to give me any output. Would this be depdendent on some particular version of xsltproce Can you paste in an example of what the output looks like? What exactly can you get from this that you can't get from a text report? -Maynard > > Usage: > > opreport -X | xsltproc /usr/share/oprofile/xslt/opreport-denormalize.xsl - > > Signed-off-by: Robert Richter <rob...@am...> > --- > pp/Makefile.am | 23 ++++++++ > pp/xslt/opreport-denormalize.xsl | 105 ++++++++++++++++++++++++++++++++++++++ > 2 files changed, 128 insertions(+), 0 deletions(-) > create mode 100644 pp/xslt/opreport-denormalize.xsl > > diff --git a/pp/Makefile.am b/pp/Makefile.am > index 1436473..adb34e9 100644 > --- a/pp/Makefile.am > +++ b/pp/Makefile.am > @@ -43,3 +43,26 @@ oparchive_SOURCES = oparchive.cpp \ > oparchive_options.h oparchive_options.cpp \ > $(pp_common) > oparchive_LDADD = $(common_libs) > + > +xslt_files = \ > + xslt/opreport-denormalize.xsl > + > +install-data-local: > + for i in ${xslt_files} ; do \ > + dir=`dirname $$i` ; \ > + mkdir -p $(DESTDIR)$(pkgdatadir)/$$dir ; \ > + $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(pkgdatadir)/$$i ; \ > + done > + > +uninstall-local: > + for i in ${xslt_files} ; do \ > + dir=`dirname $$i` ; \ > + if test -f $(DESTDIR)$(pkgdatadir)/$$i ; then \ > + rm $(DESTDIR)$(pkgdatadir)/$$i ; \ > + fi; \ > + if test -d $(DESTDIR)$(pkgdatadir)/$$dir ; then \ > + rmdir --ignore-fail-on-non-empty $(DESTDIR)$(pkgdatadir)/$$dir ; \ > + fi; \ > + done > + > +EXTRA_DIST = $(xslt_files) > diff --git a/pp/xslt/opreport-denormalize.xsl b/pp/xslt/opreport-denormalize.xsl > new file mode 100644 > index 0000000..8437827 > --- /dev/null > +++ b/pp/xslt/opreport-denormalize.xsl > @@ -0,0 +1,105 @@ > +<xsl:stylesheet version="1.0" > +xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > + > +<xsl:key name="get_class" match="class" use="@name" /> > +<xsl:key name="get_event" match="eventsetup" use="@id" /> > +<xsl:key name="get_symbol" match="symboldata" use="@id" /> > + > +<xsl:template match="/"> > + > +<xsl:text>schemaversion: </xsl:text><xsl:value-of select="profile/@schemaversion"/><xsl:text>
</xsl:text> > +<xsl:text>cputype : </xsl:text><xsl:value-of select="profile/@cputype"/><xsl:text>
</xsl:text> > +<xsl:text>processor : </xsl:text><xsl:value-of select="profile/@processor"/><xsl:text>
</xsl:text> > +<xsl:text>separatedcpus: </xsl:text><xsl:value-of select="profile/@separatedcpus"/><xsl:text>
</xsl:text> > +<xsl:text>mhz : </xsl:text><xsl:value-of select="profile/@mhz"/><xsl:text>
</xsl:text> > +<xsl:text>title : </xsl:text><xsl:value-of select="profile/@title"/><xsl:text>
</xsl:text> > +<xsl:text>
</xsl:text> > + > +<xsl:for-each select="profile/binary"> > + > +<xsl:for-each select="count"> > +<xsl:apply-templates select="key('get_class', @class)"/> > +<xsl:text>	</xsl:text> > +<xsl:value-of select="../@name"/> > +<xsl:text>	</xsl:text> > +<xsl:text>(mod)	</xsl:text> > +<xsl:text>(sym)	</xsl:text> > +<xsl:number value="."/> > +<xsl:text>
</xsl:text> > +</xsl:for-each> > + > +<xsl:for-each select="symbol"> > + > +<xsl:for-each select="count"> > +<xsl:apply-templates select="key('get_class', @class)"/> > +<xsl:text>	</xsl:text> > +<xsl:value-of select="../../@name"/> > +<xsl:text>	</xsl:text> > +<xsl:text>(mod)	</xsl:text> > +<xsl:apply-templates select="key('get_symbol', ../@idref)"/> > +<xsl:text>	</xsl:text> > +<xsl:number value="."/> > +<xsl:text>
</xsl:text> > +</xsl:for-each> > + > +</xsl:for-each> > + > +<xsl:for-each select="module"> > + > +<xsl:for-each select="count"> > +<xsl:apply-templates select="key('get_class', @class)"/> > +<xsl:text>	</xsl:text> > +<xsl:value-of select="../../@name"/> > +<xsl:text>	</xsl:text> > +<xsl:value-of select="../@name"/> > +<xsl:text>	</xsl:text> > +<xsl:text>(sym)	</xsl:text> > +<xsl:number value="."/> > +<xsl:text>
</xsl:text> > +</xsl:for-each> > + > +<xsl:for-each select="symbol"> > + > +<xsl:for-each select="count"> > +<xsl:apply-templates select="key('get_class', @class)"/> > +<xsl:text>	</xsl:text> > +<xsl:value-of select="../../../@name"/> > +<xsl:text>	</xsl:text> > +<xsl:value-of select="../../@name"/> > +<xsl:text>	</xsl:text> > +<xsl:apply-templates select="key('get_symbol', ../@idref)"/> > +<xsl:text>	</xsl:text> > +<xsl:number value="."/> > +<xsl:text>
</xsl:text> > +</xsl:for-each> > + > +</xsl:for-each> > + > +</xsl:for-each> > + > +</xsl:for-each> > + > +</xsl:template> > + > +<xsl:template match="class"> > +<xsl:apply-templates select="key('get_event', @event)"/> > +<xsl:text>	</xsl:text> > +<xsl:value-of select="@cpu"/> > +</xsl:template> > + > +<xsl:template match="eventsetup"> > +<xsl:value-of select="@eventname"/> > +<xsl:text>	</xsl:text> > +<xsl:value-of select="@unitmask"/> > +<xsl:text>	</xsl:text> > +<xsl:value-of select="@setupcount"/> > +</xsl:template> > + > +<xsl:template match="symboldata"> > +<xsl:value-of select="@name"/> > +<xsl:text>(</xsl:text> > +<xsl:value-of select="@startingaddr"/> > +<xsl:text>)</xsl:text> > +</xsl:template> > + > +</xsl:stylesheet> |