Difference between revisions of "RTLLogFileAnalysis"

From Apache OpenOffice Wiki
Jump to: navigation, search
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= RTL_LOGFILE Analysis =
+
{{Performance}}
 
 
 
== Introduction ==
 
== Introduction ==
  
Line 22: Line 21:
 
In order to use RTL_LOGFILE as described above, two tasks need to be completed:
 
In order to use RTL_LOGFILE as described above, two tasks need to be completed:
  
* Additional RTL_LOGFILE macros have to be inserted into the OpenOffice.org source code that provide the information which documents have been loaded or saved.
+
* Additional macros have to be inserted into the OpenOffice.org source code that provide the information which documents have been loaded or saved. This implementation is in progress as [http://qa.openoffice.org/issues/show_bug.cgi?id=100301 task 100301] which is assigned to CWS perftest08.
* A configurable analysis tool is required that allows comparisons between load/save data for individual documents, and between load/save data for individual OpenOffice.org instances.
+
* A configurable analysis tool is required that allows comparisons between load/save data for individual documents, and between load/save data for individual OpenOffice.org instances. This tools is called '''RTLLog2ODF''' and is described [[RTLLog2ODF|here]].
 
 
Both implementations are in progress.
 
 
 
== RTL_LOGFILE Analysis Tool ==
 
 
 
=== Introduction ===
 
 
 
The new analysis tool is similar to the existing  RTL_LOGFILE analysis perl scripts, from which the parser logic has been adopted. It takes one or more RTL_LOGILEs as input, and creates an ODF spreadsheet. How the performance data is presented in the spreadsheet can be controlled by a set of [http://www.w3.org/TR/xpath XPath] expressions.
 
 
 
The creation of the spreadsheet takes places in two steps. In a first step, the text based RTL log file is converted into an [[#Intermediate_XML_File_Format|intermediate XML file]]. In a second step, the XML tree is converted into an ODF spreadsheet. Two kinds of conversions are available: In the ''detailed'' conversion, a set of sheets is created, there each sheet contains the data for a log file, a thread, a particular load save operation, or another sub tree of the log file. In the ''summary'' conversion, each sheet additionally contains column group where each group contains the data for load/save operation, ot another sub tree of the log file.
 
 
 
=== Command Line ===
 
 
 
The RTL_LOGFILE analysis tool is invoked by one of these commands:
 
 
 
java -jar rtllog2xml.jar  -d <rtl log file> [<rtl log file> ...] <xml file>
 
java -jar rtllog2xml.jar  [-t <xpath>] [-T <xpath>] [-i <xpath>] <rtl log file> [<rtl log file> ...] <ods file>
 
java -jar rtllog2xml.jar  -s [-t <xpath>] [-T <xpath>] -g <xpath> [-G <xpath>] [-i <xpath>] <rtl log file> [<rtl log file> ...] <ods file>
 
java -jar rtllog2xml.jar  -p <profile> <rtl log file> [<rtl log file> ...] <ods file>
 
 
 
If '''-d''' is not provided, the given RTL log files ''<rtl log file>'' are transformed into a spreadsheet document ''<ods file>''. A sheet is created for each node in the [[#Intermediate_XML_File_Format|intermediate XML file] that is matched by the [http://www.w3.org/TR/xpath XPath] expression specified with the option '''-t'''. A title for the spreadsheet can be specified by the option '''-T'''. The [http://www.w3.org/TR/xpath XPath] expression specified by this option is evaluated with the nodes selected by '''-t''' as context nodes, and the resulting string value is used as title.
 
 
 
If '''-s''' is provided, the results on the sheet are grouped into columns. For each sub tree in the [[#Intermediate_XML_File_Format|intermediate XML file]], a set of columns is created that contains the entries for that group. The groups are selected by the '''-g''' option, which takes an XPath expression that is evaluated with the nodes specified by '''-t''' as context nodes. The number of entries must be the same for each group. The same applies to their function names and messages. A title for each group can be specified by the '''-G''' option, which takes an [http://www.w3.org/TR/xpath XPath] expression that is evaluated with the nodes selected by the '''-g''' option as context nodes.
 
 
 
The '''-i''' option allows to specify an include filter. It takes a boolean [http://www.w3.org/TR/xpath XPath] expression, which is evaluated for each descendant node of the nodes selected by the '''-t''' and '''-g''' options. Only nodes where the result of evaluating the expression is ''true'' are included.
 
 
 
If '''-d''' is provided, the given RTL log files are transformed into an [[#Intermediate_XML_File_Format|XML file]] only.
 
 
 
If '''-p''' is specified a [[#Profiles|profile]] is selected. A profile is a set of XPath expressions for the above options.
 
 
 
=== Profiles ===
 
 
 
The following profiles are predefined. To get a list of all profiles that are available '''RTLLog2XML''' may be called without arguments.
 
 
 
==== threads ====
 
 
 
Displays the data of each thread on a separate sheet. The corresponding options command line options are:
 
 
 
-t "//thread" -T "concat('Thread ',@thread-id)"
 
 
 
==== files ====
 
 
 
Displays the data of each log file on a separate sheet. The corresponding options command line options are:
 
 
 
-t "//file" -T "@name"
 
 
 
==== load-writer-summary ====
 
 
 
Displays the data of each log file on a separate sheet, where the data on the sheets is grouped by the ODT files that are loaded.  The corresponding options command line options are:
 
 
 
-t "//file" -T "rtllog:filename(@name)" -g ".//block[@function='::SfxFrameLoader::load']"
 
-G "rtllog:filename(substring-after(.//stamp[@function='SfxObjectShell::LoadOwnFormat' and starts-with(.,'loading ')],' '))"
 
-i "@function='ReadThroughComponent'"
 
 
 
==== save-writer-summary ====
 
 
 
Displays the data of each log file on a separate sheet, where the data on the sheets is grouped by the ODT files that are saved.  The corresponding options command line options are:
 
 
 
-t "//file" -T "rtllog:filename(@name)" -g ".//block[@function='SfxObjectShell::SaveTo_Impl']"
 
-G "rtllog:filename(substring-after(.//stamp[@function='SfxObjectShell::SaveTo_Impl' and starts-with(.,'saving ')],' '))"
 
-i "@function='SwXMLWriter::WriteThroughComponent'"
 
 
 
=== Intermediate XML File Format===
 
 
 
The intermediate XML File contains the following elements and attributes:
 
 
 
==== <root> ====
 
 
 
<tt><root></tt> is the root element. It has no attributes. The child elements are <tt><comment></tt> and <tt><file></tt>.
 
 
 
==== <comment> ====
 
 
 
The <tt><comment></tt> element contains a comment. It is created for all lines in the RTL log file which do not start with a time stamp.
 
 
 
==== <file> ====
 
 
 
The <tt><file></tt> element contains the data for a single log file. One <tt><file></tt> element is created for each file name that is passed as parameter to ''RTLLog2XML''. The file name is included in the attribute <tt>name</tt>. The child elements are <tt><thread></tt>.
 
 
 
==== <file> ====
 
 
 
The <tt><thread></tt> element contains the data for a single thread. The thread id is included in the attribute <tt>thread-id</tt>. The child elements are <tt><block></tt> and <tt><stamp></tt>.
 
 
 
==== <block> ====
 
 
 
The <tt><block></tt> element contains the data of RTL log file lines which have a type '''{''' or '''}'''. A single <tt><block></tt> element is created for each matching pair of these lines. The <tt>function</tt> attribute contains the function name, if present in the log file line. The <tt>owner</tt> attribute contains the author, if present in the log file line. The <tt>component</tt> attribute contains the component, if present in the log file line. The <tt>start-time</tt> attribute contains the time stamp included in the '''{''' line. The <tt>end-time</tt> attribute contains the time stamp included in the '''}''' line. Both time stamps are specified as [http://www.w3.org/TR/xmlschema-2/#duration XSD durations].
 
 
 
==== <stamp> ====
 
 
 
The <tt><stamp></tt> element contains the data of RTL log file lines which have a type '''|'''. The <tt>function</tt> attribute contains the function name, if present in the log file line. The <tt>owner</tt> attribute contains the author, if present in the log file line. The <tt>component</tt> attribute contains the component, if present in the log file line. The <tt>time</tt> attribute contains the time stamp included in the '''|''' line as [http://www.w3.org/TR/xmlschema-2/#duration XSD duration].
 

Latest revision as of 10:16, 8 May 2009

Performance 170.png
Performance Project

performance.openoffice.org

Quick Navigation

Team

Communication

Activities

About this template


Introduction

RTL_LOGFILE is a developer feature of OpenOffice.org that can be used to get wall clock based time stamps for particular code points. It can be used for instance in automated performance tests. This section describes its use for profiling load and save operations of ODF documents.

Use Cases

The use of RTL_LOGFILE is advantageous, compared to for instance the use of a profiler, if the performance data is required for a large amount of load or save operations, or if the performance of two OpenOffice.org builds shall be compared with as little effort as possible. The data that can be collected by RTL_LOGFILE is neither precise nor detailed enough to actually profile for instance the loading or saving a particular document, but it is still is detailed and precise enough for a rough analysis, for regression tests or performance metrics, or to figure out which effect a particular performance improvement has for a large set of data.

Possible use cases are:

  • The comparison of load save times for a large set of document between a master build and a CWS.
  • The comparison of load save times for a large set of document between a master build and a developer build that implements a particular improvement.
  • To provide metrics that show performance improvements that have been achieved.
  • To find documents whose load or save time is significant above or below the average, and which therefore are either
    • worth a deeper investigation (with other tools), or
    • appear to be non appropriate as test documents for a performance improvement that is assumed to effect all documents.

Implementation

In order to use RTL_LOGFILE as described above, two tasks need to be completed:

  • Additional macros have to be inserted into the OpenOffice.org source code that provide the information which documents have been loaded or saved. This implementation is in progress as task 100301 which is assigned to CWS perftest08.
  • A configurable analysis tool is required that allows comparisons between load/save data for individual documents, and between load/save data for individual OpenOffice.org instances. This tools is called RTLLog2ODF and is described here.
Personal tools