1HATARI_PROFILE(1)              Hatari utilities              HATARI_PROFILE(1)
2
3
4

NAME

6       hatari_profile - Post-processor for Hatari profiler data
7

SYNOPSIS

9       hatari_profile.py [options] <datafiles>
10

DESCRIPTION

12       A Python script to post-process data produced by Hatari profiler "save"
13       commands, both for CPU and DSP:
14            profile save <filename>
15            dspprofile save <filename>
16
17       It can provide function level (CPU and DSP) processor usage information
18       for  anything  Hatari  profiler  records: instruction counts, processor
19       cycles and depending on processor, also  instruction  cache  misses  or
20       cycle differences.
21
22       This  information  can be provided as ASCII list of heaviest functions,
23       as callgraphs (if profile data  includes  caller  information),  or  as
24       callgrind format export which can be viewed in (Linux) Kcachegrind GUI.
25

OPTIONS

27       Invoking hatari_profile without arguments lists all of its options.
28

USAGE EXAMPLES

30       Regardless  of  whether  profile data contains some symbol information,
31       you should always give script all  relevant  debug  symbols,  otherwise
32       costs  might  not  get  correctly  assigned  to symbols preceding those
33       costs.
34
35       This post-processes profile data for EmuTOS  (ROM),  with  symbol  file
36       having  fixed/absolute  addresses  (-a),  shows statistics (-s) and top
37       lists (-t), but limits list output to anything taking over  2%  (-l  2)
38       and includes "propagated" subroutine call costs (-p):
39       -------------------------------------------------------------
40       $ hatari_profile.py -a etos512k.sym -st -l 2 -p etos-boot.txt
41
42       Hatari profile data processor
43
44       Parsing absolute symbol address information from etos512k.sym...
45       1538 lines with 1236 code symbols/addresses parsed, 0 unknown.
46
47       Parsing profile information from etos-boot.txt...
48       16993 lines processed with 465 functions.
49
50       CPU profile information from 'etos-boot.txt':
51       - Hatari v1.6.2+ (Apr 15 2013), OldUAE CPU core
52
53       Time spent in profile = 4.60740s.
54
55       Calls:
56       - max = 1800, in ___mulsi3 at 0xe60790, on line 16477
57       - 16659 in total
58       Executed instructions:
59       - max = 315254, in _timeout_gpip+38 at 0xe06fd8, on line 3237
60       - 3074165 in total
61       Used cycles:
62       - max = 6311628, in _timeout_gpip+38 at 0xe06fd8, on line 3237
63       - 36957124 in total
64
65       Calls:
66        10.80%   10.88%      1800  ___mulsi3
67         8.04%    8.16%      1339  _memcpy
68         5.20%    0.26%       866  _int_timerc
69         4.61%                768  _call_user_wheel
70         3.86%    3.86%       643  _min
71         3.76%    3.82%       627  _sti
72         3.76%    3.76%       627  _cli
73         3.30%    3.30%       550  _bcostat4
74
75       Executed instructions:
76        61.58%   61.79%   1892940  _timeout_gpip
77         8.62%    9.33%    264918  _draw_rect
78         4.96%    4.98%    152582  _run_calibration
79         4.06%    4.09%    124944  _blank_out
80         3.22%              99134  meminit
81
82       Used cycles:
83        61.58%   62.01%  22759756  _timeout_gpip
84         5.69%    6.85%   2104464  _draw_rect
85         4.29%            1586108  meminit
86         4.19%    4.22%   1547768  _run_calibration
87         3.04%    3.07%   1122816  _blank_out
88         2.88%    2.98%   1065272  _stop_until_interrupt
89       -------------------------------------------------------------
90
91       This  creates  GraphViz  callgraph files (-g) and Kcachegrind callgrind
92       data file (-k) from Bad Mood (Doom BSP viewer)  profile.   Symbols  for
93       the  program  are  TEXT  section relative (-r), calls to some interrupt
94       routines in the program are ignored as they aren't  real  calls,  call‐
95       graph  nodes  using over 2% are highlighted, and there are some options
96       to limit and simplify the graph:
97       -------------------------------------------------------------
98       $ hatari_profile.py -r bmsym.sym \
99         -k -g -p --emph-limit 2.0 --limit 0.5 \
100         --ignore-to framecounter,new_vbi,stabilizer_b \
101         --compact --no-leafs --no-intermediate \
102         badmood-profile.txt
103
104       Hatari profile data processor
105
106       Parsing TEXT relative symbol address information from bmsym.sym...
107       1023 lines with 392 code symbols/addresses parsed, 0 unknown.
108
109       Parsing profile information from badmood-profile.txt...
110       1420 lines processed with 63 functions.
111       Ignoring 29 switches to framecounter
112       Ignoring 9 switches to stabilizer_b
113       Ignoring 8 switches to new_vbi
114       Of all 1562 switches, ignored 56 for type(s) ['r', 'u', 'x'].
115
116       Generating callgrind file 'badmood-profile.cg'...
117
118       Generating 'badmood-profile-0.dot' DOT callgraph file...
119
120       Generating 'badmood-profile-1.dot' DOT callgraph file...
121
122       Generating 'badmood-profile-2.dot' DOT callgraph file...
123
124       Generating 'badmood-profile-3.dot' DOT callgraph file...
125
126       CPU profile information from 'badmood-profile.txt':
127       - Hatari v1.6.2+ (Apr 10 2013), WinUAE CPU core
128       -------------------------------------------------------------
129

SEE ALSO

131       hatari(1), gst2ascii(1), hconsole(1) hatariui(1)
132

AUTHOR

134       Written by Eero Tamminen <oak at helsinkinet fi>.
135

LICENSE

137       This program is free software; you can redistribute it and/or modify it
138       under  the  terms of the GNU General Public License as published by the
139       Free Software Foundation; either version 2 of the License, or (at  your
140       option) any later version.
141

NO WARRANTY

143       This  program  is  distributed  in the hope that it will be useful, but
144       WITHOUT ANY  WARRANTY;  without  even  the  implied  warranty  of  MER‐
145       CHANTABILITY  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
146       Public License for more details.
147
148
149
150Hatari                            2013-04-15                 HATARI_PROFILE(1)
Impressum