6
6
<div class="profiling_info" id="profiling_info"
7
7
tal:define="actions options/actions;
8
8
help actions/help|nothing;
9
log actions/log|nothing;
10
stdlib actions/stdlib|nothing;
9
callgrind actions/callgrind|nothing;
10
pstats actions/pstats|nothing;
11
log python: callgrind or pstats;
12
log_conflict python: callgrind and pstats;
11
13
show actions/show|nothing;
12
14
always_log options/always_log;
13
15
dump_path options/dump_path;
29
31
you'll always see some logging information below. In order to also
30
32
get immediate profiling results in the browser, use
31
33
<code>++profile++show</code>.</tal:block> <tal:block condition="not:
32
always_log">In order to get profiling results, you need to ask for
33
an HTML view (<code>++profile++show</code>), a KCacheGrind-friendly
34
log on the filesystem (<code>++profile++log</code>), or both
35
(<code>++profile++show,log</code>).</tal:block> This can usually go
36
anywhere in the URL (e.g.,
37
<code>http://launchpad.dev/++profile++show</code> or
34
always_log">In order to get profiling results, you need to ask for an HTML
35
view (<code>++profile++show</code>), a KCacheGrind-friendly log on the
36
filesystem (<code>++profile++callgrind</code>), or a PStats-friendly log
37
(Python standard library) on the filesystem
38
(<code>++profile++pstats</code>). You can also ask for local HTML
39
profiling plus one of the two log files
40
(<code>++profile++show,callgrind</code> or
41
<code>++profile++show,pstats</code>).</tal:block></p>
42
<p>The "++profile++" path segment can usually go anywhere in the URL
43
(e.g., <code>http://launchpad.dev/++profile++show</code> or
38
44
<code>http://launchpad.dev/++profile++show/Firefox</code> or
39
<code>http://launchpad.dev/Firefox/++profile++show</code>) but some
40
pages do seem to redirect in surprising ways, so experimentation may
45
<code>http://launchpad.dev/Firefox/++profile++show</code>) but some pages
46
do seem to redirect in surprising ways, so experimentation may be
43
49
<h2>Log information</h2>
44
50
<tal:block condition="not:log">
45
51
<p>Profile was not logged to file.</p>
46
<p>Use <code>++profile++log</code> in your URL in order to log the
47
information to file for later KCacheGrind analysis (or
48
<code>++profile++log,show</code> to see both the log information and
49
immediate results). Profiles are logged to
50
<tal:block replace="dump_path" />.</p>
51
<p>KCacheGrind is great for visualizing a profile, but it only allows
52
analyzing a limited depth of calls. If you want a greater profile depth,
53
or if for any other reason you want to use the standard Python library's
54
pstats analysis instead, you can. To do this, include "stdlib" as part of
55
your ++profile++ request, as in <code>++profile++log,stdlib</code> or
56
<code>++profile++log,show,stdlib</code>.</p>
52
<p>Use <code>++profile++callgrind</code> in your URL in order to log the
53
information to file for later KCacheGrind analysis. KCacheGrind is great
54
for visualizing a profile, but it only allows analyzing a limited depth of
55
calls. If you want a greater profile depth, or if for any other reason
56
you want to use the standard Python library's pstats analysis instead, you
57
can. To do this, use "pstats" instead as part of your ++profile++ request,
58
as in <code>++profile++pstats</code>. Profiles are logged to <tal:block
59
replace="dump_path" />.</p>
60
<p> You can see both the log information and immediate results with
61
<code>++profile++callgrind,show</code> or
62
<code>++profile++pstats,show</code>.</p>
58
64
<tal:block condition="log">
59
65
<p tal:condition="always_log"><strong>You have configured every
61
67
<code>profile_all_requests: True</code> in the
62
68
<code>[profiling]</code> section of your launchpad-lazr.conf.</p>
63
69
<p>Profile was logged to <tal:block replace="dump_path" />.</p>
64
<p tal:condition="not:stdlib">You should be able to use this
70
<p tal:condition="callgrind">You should be able to use this
65
71
simply by entering <code>kcachegrind <tal:block replace="dump_path"
66
72
/></code> in the console for a great visualization of the profile. The <a
67
73
href="https://dev.launchpad.net/Debugging#Profiling%%20page%%20requests"
68
74
>dev wiki</a> may have more information on how to use this.</p>
69
<p tal:condition="stdlib">You should be able to use this
75
<p tal:condition="not:callgrind">You should be able to use this
70
76
simply by entering <code>python -m pstats <tal:block replace="dump_path"
71
77
/></code> in the console to use the normal Python profile statistics
72
78
interface. Type "help" at the prompt, or see the <a
73
79
href="http://docs.python.org/library/profile.html#instant-user-s-manual"
74
80
>Python documentation</a>.</p>
81
<p tal:condition="log_conflict"><strong>You asked for both callgrind and
82
pstats logging. We can only choose one at a time, and the default is
83
callgrind. If you want a pstats profile as well, request it
84
separately.</strong></p>
76
86
<h2>Profile quick view</h2>
77
87
<tal:block condition="not:show">
78
<p>Use <code>++profile++show</code> in your URL in order to see
79
immediate profile results (or <code>++profile++log,show</code> to
80
see both the log information and immediate results).</p>
88
<p>Use <code>++profile++show</code> in your URL in order to see immediate
89
profile results (or <code>++profile++callgrind,show</code> or
90
<code>++profile++pstats,show</code> to see both the log information and
91
immediate results).</p>
82
93
<tal:block condition="show">
83
94
<h3>Top Inline Time</h3>