mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
Land Sysprof 2.x
This is a major redesign a modernization of Sysprof. The core data structures and design are largely the same, but it has been ported to Gtk3 and has lots of additions that should make your profiling experience smoother. Especially for those that are new to profiling. There are some very simple help docs added, but we really need the experts to come in and write some documentation here.
This commit is contained in:
18
help/C/index.page
Normal file
18
help/C/index.page
Normal file
@ -0,0 +1,18 @@
|
||||
<page xmlns="http://projectmallard.org/1.0/"
|
||||
xmlns:its="http://www.w3.org/2005/11/its"
|
||||
type="guide"
|
||||
id="index">
|
||||
|
||||
<info>
|
||||
<revision pkgversion="3.20" date="2016-01-23" status="stub" />
|
||||
|
||||
<include href="legal.xml" xmlns="http://www.w3.org/2001/XInclude"/>
|
||||
</info>
|
||||
|
||||
<title>Sysprof</title>
|
||||
|
||||
<section id="profiling" style="2column">
|
||||
<title>Profiling</title>
|
||||
</section>
|
||||
|
||||
</page>
|
||||
57
help/C/introduction.page
Normal file
57
help/C/introduction.page
Normal file
@ -0,0 +1,57 @@
|
||||
<page xmlns="http://projectmallard.org/1.0/"
|
||||
xmlns:its="http://www.w3.org/2005/11/its"
|
||||
type="topic"
|
||||
id="introduction">
|
||||
|
||||
<info>
|
||||
<link type="guide" xref="index"/>
|
||||
<!--
|
||||
<link type="guide" xref="index#features"/>
|
||||
<link type="seealso" xref="anotherpageid"/>
|
||||
-->
|
||||
<revision pkgversion="3.20" date="2016-04-04" status="stub" />
|
||||
|
||||
<credit type="author">
|
||||
<name>Christian Hergert</name>
|
||||
<email its:translate="no">christian@hergert.me</email>
|
||||
<years>2016</years>
|
||||
</credit>
|
||||
|
||||
<include href="legal.xml" xmlns="http://www.w3.org/2001/XInclude"/>
|
||||
|
||||
<desc>Welcome to <app>Sysprof</app>!</desc>
|
||||
</info>
|
||||
|
||||
<title>Introduction</title>
|
||||
|
||||
<p><app>Sysprof</app> is a system profiler for Linux that targets
|
||||
the GNOME desktop.</p>
|
||||
|
||||
<section id="what-is-a-profiler">
|
||||
<info>
|
||||
<link type="guide" xref="index"/>
|
||||
<desc>Differences between tracing and sampling</desc>
|
||||
</info>
|
||||
<title>What is a Profiler?</title>
|
||||
|
||||
<p>A profiler is an application that records information about an
|
||||
application or system while it runs. That information can be explored to
|
||||
gain insight into how the application could be changed to perform
|
||||
better.</p>
|
||||
|
||||
<p>Two common categories of software profilers exist, commonly referred
|
||||
to as either tracing or sampling profilers. What is meant by tracing
|
||||
profiler is that every function call executed by the program is known to the
|
||||
profiler. A sampling profiler works by inspecting the state of the
|
||||
program on a regular frequency and therefore does not see every function
|
||||
call executed by the program.</p>
|
||||
|
||||
<p>Both tracing and sampling profilers have their advantages. A
|
||||
notable advtantage of a sampling profiler is that the overhead is much
|
||||
less than that of a tracing profiler, making it easier to use for
|
||||
software that requires interactivity.</p>
|
||||
|
||||
<p><app>Sysprof</app> is a sampling profiler.</p>
|
||||
</section>
|
||||
|
||||
</page>
|
||||
12
help/C/legal.xml
Normal file
12
help/C/legal.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<license xmlns="http://projectmallard.org/1.0/"
|
||||
href="http://creativecommons.org/licenses/by-sa/4.0/">
|
||||
|
||||
<p>This work is licensed under a
|
||||
<link href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons
|
||||
Attribution-ShareAlike 4.0 International</link> license.</p>
|
||||
|
||||
<p>As a special exception, the copyright holders give you permission to copy,
|
||||
modify, and distribute the example code contained in this documentation under
|
||||
the terms of your choosing, without restriction.</p>
|
||||
|
||||
</license>
|
||||
140
help/C/profiling.page
Normal file
140
help/C/profiling.page
Normal file
@ -0,0 +1,140 @@
|
||||
<page xmlns="http://projectmallard.org/1.0/"
|
||||
xmlns:its="http://www.w3.org/2005/11/its"
|
||||
type="topic"
|
||||
id="profiling">
|
||||
|
||||
<section id="system-profiling">
|
||||
<info>
|
||||
<link type="guide" xref="index#profiling"/>
|
||||
</info>
|
||||
<title>How to profile your system</title>
|
||||
<p>When <app>Sysprof</app> profiles your system, it records stack
|
||||
information for all applications executing, including the Linux kernel. This
|
||||
can sometimes be confusing if you only want to look at a single process. If
|
||||
your application does not interact much with the host system, you may have more
|
||||
success with <link href="profiling#new-process-profiling">profiling an existing
|
||||
process</link>.</p>
|
||||
|
||||
<p>To profile your entire system, ensure the target button is set to
|
||||
<em>All Processes</em> and click <em>Record</em>.</p>
|
||||
|
||||
<p>At this point, you may be asked to <em>authorize</em> access to
|
||||
profile the system. This is required as the Linux kernel's perf
|
||||
implementation requires root to perform whole-system profiling.</p>
|
||||
|
||||
<p>During the profiling session, you will see the number of
|
||||
seconds the profile has been active. Clicking the <em>Record</em>
|
||||
button again will stop the profiling session. Afterwhich, the callgraph
|
||||
will be displayed.</p>
|
||||
|
||||
<note>
|
||||
<p>If you find that the <app>sysprof</app> application is showing up in
|
||||
your profiling callgraph, you might consider recording the profiling session
|
||||
with <cmd>sysprof-cli</cmd>. This is a command line program that will capture
|
||||
your profiling session to disk to be viewed at a later time.</p>
|
||||
</note>
|
||||
|
||||
<p>See <link href="profiling#interpreting-results">interpreting
|
||||
results</link> for more guidance.</p>
|
||||
|
||||
</section>
|
||||
|
||||
<section id="existing-process-profiling">
|
||||
<info>
|
||||
<link type="guide" xref="index#profiling"/>
|
||||
</info>
|
||||
<title>Profile an existing process</title>
|
||||
<p>With <app>Sysprof</app>, you can profile one or more existing
|
||||
processes on your system. First, select the <em>profiling target</em>
|
||||
button next to the <em>Record</em> button. Select <em>Existing Process</em>
|
||||
in the popover that is displayed. Next, select as many processes as you'd
|
||||
like to profile. Processes selected for profiling will have a checkmark
|
||||
next to their name.</p>
|
||||
|
||||
<p>After selecting your target processes, click the <em>Record</em>
|
||||
button to start profiling.</p>
|
||||
|
||||
<p>When you have completed, click the <em>Record</em> button again
|
||||
to stop profiling.</p>
|
||||
|
||||
<p>See <link href="profiling#interpreting-results">interpreting
|
||||
results</link> for more guidance.</p>
|
||||
|
||||
</section>
|
||||
|
||||
<section id="new-process-profiling">
|
||||
<info>
|
||||
<link type="guide" xref="index#profiling"/>
|
||||
</info>
|
||||
<title>Profile a new process</title>
|
||||
|
||||
<p>Often times, you may need to spawn a new process to profile.
|
||||
First, select the <em>profiling target</em> button next to the
|
||||
<em>Record</em> button. Next, select <em>New Process</em> and fill
|
||||
out the necessary information to spawn the process.</p>
|
||||
|
||||
<note>
|
||||
<p>If you are spawning a process that requires access to your current
|
||||
display, such as a GTK+ application, you will want to make sure <em>Inherit
|
||||
current environment</em> is set.</p>
|
||||
</note>
|
||||
|
||||
</section>
|
||||
|
||||
<section id="sysprof-cli">
|
||||
<info>
|
||||
<link type="guide" xref="index#profiling"/>
|
||||
</info>
|
||||
<title>Profiling with the sysprof-cli command line tool</title>
|
||||
|
||||
<p>For minimal overhead, you might consider using the <cmd>sysprof-cli</cmd>
|
||||
command line tool. When run without any arguments, it will record your entire
|
||||
system and save the output to <file>capture.syscap</file>. This file can be
|
||||
opened with the <app>Sysprof</app> application to view the callgraph.</p>
|
||||
|
||||
<p>You can also attach to an existing process using
|
||||
<cmd>sysprof-cli -p pid</cmd>.</p>
|
||||
|
||||
<p>If you would like to spawn a new process, use <cmd>sysprof-cli -c
|
||||
'command'</cmd> to specify a command to be launched. The command will inherit
|
||||
the current environment.</p>
|
||||
|
||||
</section>
|
||||
|
||||
<section id="interpreting-results">
|
||||
<info>
|
||||
<link type="guide" xref="index#profiling"/>
|
||||
</info>
|
||||
<title>Interpreting results</title>
|
||||
|
||||
<p>The profiling results in <app>Sysprof</app> are split into three
|
||||
sections. On the top left is a list of all the functions profiled. They
|
||||
are sorted by how often they were called during the sampling frequency.</p>
|
||||
|
||||
<note>
|
||||
<p>It is important to note that the amount of time spent in each function
|
||||
is not captured. That would require a tracing profiler to accurately record.
|
||||
The percentage is calculated by determining how often that function showed
|
||||
up in the current stacktrace when a sample was recorded.</p>
|
||||
</note>
|
||||
|
||||
<p>After selecting a function from the functions list, all of the recorded
|
||||
callers of that function will be displayed on the bottom left. They are also
|
||||
sorted by the percentage of samples that included that function in the
|
||||
stacktrace.</p>
|
||||
|
||||
<p>On the right, are all of the decendants of a selected function. You can
|
||||
select a function either from the functions list, or the callers list.</p>
|
||||
|
||||
<p>You can jump into a function by activating a row in the tree of descendants
|
||||
with a double-click or by pressing <key>Enter</key> or <key>Spacebar</key>.</p>
|
||||
|
||||
<note>
|
||||
<p>If you see <em>- - kernel - -</em> in your results, that means that the
|
||||
application transitioned into or from the Linux kernel. There can be many reasons
|
||||
for this such as a <em>syscall</em> or <em>signal</em>.</p>
|
||||
</note>
|
||||
|
||||
</section>
|
||||
|
||||
</page>
|
||||
18
help/Makefile.am
Normal file
18
help/Makefile.am
Normal file
@ -0,0 +1,18 @@
|
||||
@YELP_HELP_RULES@
|
||||
|
||||
HELP_ID = sysprof
|
||||
|
||||
# Media files
|
||||
HELP_MEDIA =
|
||||
|
||||
# Help pages
|
||||
HELP_FILES = \
|
||||
index.page \
|
||||
introduction.page \
|
||||
profiling.page \
|
||||
legal.xml
|
||||
|
||||
# Translated languages
|
||||
HELP_LINGUAS =
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
Reference in New Issue
Block a user