How To 生成する Profiling Data
Andre Fischer and Carsten Driesner, July 11th , 2001. Last change on August 2nd , 2001.
Introduction
The 仕事 that is to be solved is the 世代 of profiling data for a manually selected 始める,決める of points in programs of the OpenOffice/Sun One Webtop family. Moreover this should be 遂行するd as automatically as possible, so that タイミングs of different program 見解/翻訳/版s can be compared to each other automatically.
The main 推論する/理由 for not using an 存在するing 道具 like Truetime or Quantify is the 抱擁する 量 of data 生成するd by these programs. In general the developers of the different modules of the office know about the time 批判的な parts of their code. Therefore only profiling (警察などへの)密告,告訴(状)s about these code parts are of 利益/興味. Everything else only obscures the 見解(をとる) to the 関連した data.
With this in mind we use a different approach. Instead of blindly 器具ing---i.e. 追加するing code that 生成するs profiling data---all とじ込み/提出するs, we concentrate of the areas of 利益/興味. The developers have to 追加する once manually 命令(する)s into their code that 放出するs time stamps together with 状況 (警察などへの)密告,告訴(状). From then on everything else goes automatically. If the those とじ込み/提出するs are 収集するd with a 確かな preprocessor symbol defined and the office is run with a 確かな 環境 variable 始める,決める, then profiling (警察などへの)密告,告訴(状) is written to a スピードを出す/記録につける とじ込み/提出する (or, to be more 正確な, to one スピードを出す/記録につける とじ込み/提出する per 過程). These スピードを出す/記録につける とじ込み/提出するs are then 過程d by a Perl script and are transfomed into a Calc 文書.
The 詳細(に述べる)s of this 過程 are explained below. 公式文書,認める that this is a work in 進歩. 特に the 変形 of the スピードを出す/記録につける とじ込み/提出するs into a Calc 文書 will have to be adapted to the needs of those who use those 文書s.
器具ing the source とじ込み/提出するs
The header とじ込み/提出する <rtl/logfile.hxx> (guarded by the
preprocessor symbol _RTL_LOGFILE_HXX_) 含む/封じ込めるs a 始める,決める of
大型のs that can be used to 放出する time stamps at 確かな points in the
code. The 推論する/理由 for using 大型のs instead of a more decent C++
建設する is to 供給する a way of 除去するing the code for 令状ing
profiling data 完全に from the 収集するd executable and it's
libraries. The 大型のs 包む calls to the class ::rtl::Logfile
(宣言するd in <rtl/logfile.hxx>) and the 機能(する)/行事
rtl_logfile_trace (宣言するd in <rtl/logfile.h>). They 生成する
actual code only when at 収集する time the preprocessor symbol TIMELOG
is defined. This is either 遂行するd by building a special office
見解/翻訳/版 (which will be the normal プロの/賛成の-見解/翻訳/版) or by setting an
環境 variable ENVCDEFS to 含む -DTIMELOG.
Depending on the 爆撃する you use
始める,決める ENVCDEFS=-DTIMELOG
will do that (4NT).
The 大型のs can be used in two ways:
RTL_LOGFILE_CONTEXT_AUTHOR(instance,事業/計画(する),author,指名する)creates a 状況 instance that can be 言及/関連d byinstance. The three remaining parameters 含む/封じ込める the 指名する of the 事業/計画(する) in which the 大型の is used, the Sun id of the author beeing responsible for the code in which the 大型の is used (for example af119097 for one of the authors) and the指名するof the 機能(する)/行事 or other 範囲 that this 状況 言及するs to. The 状況 instance 放出するs one time stamp when it is created and one when it is destroyed. Therefore, if placed as first 声明 of a 機能(する)/行事 鮮明度/定義, a time stamp is written to the スピードを出す/記録につける とじ込み/提出する when the 機能(する)/行事 is entered and one when it is 出口d even when there is more then one (implicit) return 声明.The 指名する passed to the 状況 instantiation is written with every time stamp that 起こる/始まるs from such a 状況. This is also true for the に引き続いて 大型のs.
RTL_LOGFILE_CONTEXT_TRACE(instance,message),RTL_LOGFILE_CONTEXT_TRACE1(instance,message,arg1),RTL_LOGFILE_CONTEXT_TRACE2(instance,message,arg1,arg2), andRTL_LOGFILE_CONTEXT_TRACE3(instance,message,arg1,arg2,arg3)令状 time stamps with 独断的な messages to the スピードを出す/記録につける とじ込み/提出する. The actual message is given by the stringmessage. Together with 無 to three arguments it is passed to a printf style 生産(高) 機能(する)/行事. That means that for every argument there has to be a suitable % 判型 string inmessage. ーするために 許す the スピードを出す/記録につける とじ込み/提出する be parsed by the 存在するing Perl scripts message may 含む/封じ込める newlines. Each message is prefixed with the 状況 指名する.These 大型のs 存在する also in a 状況 解放する/自由な 見解/翻訳/版.
RTL_LOGFILE_TRACE_AUTHOR(事業/計画(する),author,message),RTL_LOGFILE_TRACE_AUTHOR1(事業/計画(する),author,message,arg1),RTL_LOGFILE_TRACE_AUTHOR2(事業/計画(する),author,message,arg1,arg2), andRTL_LOGFILE_TRACE_AUTHOR3(事業/計画(する),author,message,arg1,arg2,arg3)do the same thing as their 状況 twins except that the messages are not prefixed with a 状況 指名する. As you can see, the 事業/計画(する) and author have to given to each trace 大型の instead of just to the one creating a 状況. They are defined in <rtl/logfile.h> which is 含むd from <rtl/logfile.hxx>. Therefore for only using the 状況 解放する/自由な 大型のs it is 十分な to 含む <rtl/logfile.h>.
For every introduced above there is an analogon without the
_AUTHOR suffix which do not 受託する the 事業/計画(する)
and author arguments. Because both of these are used
later in the 地位,任命する 過程ing 行う/開催する/段階 we discourage you to use these
other 大型の 見解/翻訳/版s.
Depending on which of these two ways is used to 生成する a time stamp, they are 指名するd 機能(する)/行事/範囲 time stamps それぞれ message time stamps.
Creating profiling (警察などへの)密告,告訴(状)
If you have 器具d your code like 述べるd above and have
収集するd and 任命する/導入するd it you can create profiling (警察などへの)密告,告訴(状) by
starting the office with the bootsrap variable RTL_LOGFILE
始める,決める to a とじ込み/提出する 指名する prefix. This prefix is 完全にするd by appending an
強調する, the 過程 id and a .スピードを出す/記録につける suffix. 公式文書,認める that
backslashes have to be escaped by another backslash. The variable
RTL_LOGFILE can be 始める,決める in one of the に引き続いて ways:
Setting the 環境 variable
RTL_LOGFILE. This for instance be done with始める,決める RTL_LOGFILE=c:\\logfilefrom a 4NT 爆撃する.
Passing the argument
-env:RTL_LOGFILon the commandline to the office.E=c:\\logfilePut an 入ること/参加(者) into <executable>
.inior <executable>rcとじ込み/提出する (the first with, the second without a dot) where <executable> is the 指名する of the executable. For more (警察などへの)密告,告訴(状) on this method please 言及する to http://udk.openoffice.org/ありふれた/man/概念/uno_default_bootstrapping.html
Transforming the スピードを出す/記録につける とじ込み/提出するs into Calc 文書s
Once you have created a スピードを出す/記録につける とじ込み/提出する you may want to 変える it into a more readable form. There is a 始める,決める of Perl scripts that create a Calc 文書 from a スピードを出す/記録につける とじ込み/提出する that 含む/封じ込めるs for every thread a 始める,決める of pages with different 見解(をとる)s of the profiling data.
The first page shows a pretty printed 見解/翻訳/版 of the 名簿(に載せる)/表(にあげる) of time stamps. They are indented によれば the calling 階層制度. For each time stamp you can see the time it has been written (or to be more 正確な the time on which it's 令状ing has been requested), if applicable the time the 機能(する)/行事/範囲 took to 計算する and the 機能(する)/行事/範囲 指名する and message.
The second page shows a 名簿(に載せる)/表(にあげる) of all 機能(する)/行事s/範囲s for which タイミング (警察などへの)密告,告訴(状)s 存在する. Every 名簿(に載せる)/表(にあげる) 入ること/参加(者) shows the 機能(する)/行事/範囲 指名する, total, 極小の, maximal, and 普通の/平均(する) time and the number of calls.
Filtering
The 名簿(に載せる)/表(にあげる) of time stamps can be filtered ーするために 減ずる a large
量 of data to a managable size and to 除外する profiling
(警察などへの)密告,告訴(状) from 事業/計画(する)s you are not 利益/興味d in. There are two
filters. One is for explicit 傾向 of time stamps, the other for
explicit 除外. Each is initialized from a とじ込み/提出する 含む/封じ込めるing
正規の/正選手 表現s (Perl style) given on the 命令(する) line. The とじ込み/提出する
after the -i switch defines those time stamps that are
to be 含むd in the 報告(する)/憶測s and the とじ込み/提出する after the -e
switch defines those time stamps that are to be 除外するd. The とじ込み/提出するs
may 含む/封じ込める empty lines or comment lines whose first character is an
'#'. An empty 傾向 filter does have no 影響. If both filters
are 明示するd, then a time stamp is written to the 報告(する)/憶測 if it
matches at least one of the 正規の/正選手 表現 of the 傾向
filter and 非,不,無 of the 除外 filter.
The idea is to use the 傾向 filter if you have just a small number of 機能(する)/行事s or messages you are 利益/興味d in and to use the 除外 filter if there is only a small number you would not like in your 報告(する)/憶測s.
An 傾向 とじ込み/提出する might look like this.
# 正規の/正選手 表現 matching all 機能(する)/行事 指名するs that shall
show up
# in the 報告(する)/憶測s.
# Show calls to BuildChart in the chart 事業/計画(する).
BuildChart
見通し
The form and number of 報告(する)/憶測s will of course have to be changed and 延長するd. We are looking 今後 to your feedback.
その上の Documentation
Furthor documentation can be 設立する in the C++ header とじ込み/提出するs
<rtl/logfile.h> and <rtl/logfile.hxx>
and the Perl scripts in 事業/計画(する) 道具s/contrib/profiling.
You can use for instance pod2html to 抽出する and
transform the Perl scripts documentation in HTML 文書s.
Documentation of the time stamp 判型 can be 設立する here.
接触する
You can 接触する the authors under andre.w.fischer@sun.com or carsten.driesner@sun.com.

