Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf.pld@gmail.com>2017-09-29 01:21:50 +0300
committerBartosz Taudul <wolf.pld@gmail.com>2017-09-29 01:21:50 +0300
commit037b8ea0a949379dd4a81b2aa9cb87186ff00843 (patch)
tree2fc0ca671cb2633c4870805d9b53cf2617670134
parente9e848ecbd07e84aec84ef7414c7f14e56c53b8e (diff)
Add README.
-rw-r--r--README.md58
-rw-r--r--doc/cost.pngbin0 -> 2357 bytes
-rwxr-xr-xdoc/design.svg370
-rw-r--r--doc/profiler.pngbin0 -> 10463 bytes
4 files changed, 428 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 00000000..41819d1c
--- /dev/null
+++ b/README.md
@@ -0,0 +1,58 @@
+# Tracy Profiler
+
+Tracy is a frame profiler that can be used for remote or embedded telemetry of your application.
+
+![](doc/profiler.png)
+
+Tracy requires compiler support for C++14 and Thread Local Storage. There are no other requirements. The following platforms are confirmed to be working:
+
+- Windows (x64)
+- Linux (x64, ARM64)
+- Android (ARM)
+
+Other platforms should also work fine.
+
+### High-level overview
+
+![](doc/design.svg)
+
+Tracy is split into client and server side. The client side collects events using a high-efficiency queue and awaits for an incoming connection. The server part connects to client and receives collected data from the client, which is then reconstructed into a viewable timeline. The transfer is performed using a TCP connection.
+
+## Usage instructions
+
+#### Initial client setup
+
+Add source files from `tracy/client` and `tracy/common` to your project. That's all. Tracy is now integrated into your application.
+
+#### Marking zones
+
+To begin data collection, tracy requires that you manually instrument your application (automatic tracing of every entered function is not feasible due to the amount of data that would generate). All the user-facing interface is contained in the `tracy/client/Tracy.hpp` header file.
+
+To slice the program's execution recording into frame-sized chunks, put the `FrameMark` macro after you have completed rendering the frame. Ideally that would be right after the swap buffers command. Note that this step is optional, as some applications (for example: a compression utility) do not have the concept of a frame.
+
+To record a zone's execution time add the `ZoneScoped` macro at the beginning of the scope you want to measure. This will automatically record function name, source file name and location. Optionally you may use the `ZoneScopedC( 0xBBGGRR )` macro to set a custom color for the zone. Note that the color value will be constant in the recording (don't try to parametrize it). After you have marked the zone, you may further parametrize it.
+
+Use the `ZoneName( const char* name )` macro to set a custom name for the zone, which will be displayed instead of the function's name in the timeline view. The text string that you have provided **must** be accessible indefinitely at the given address. Tracy does not guarantee at which point in time it will be sent to the server and there is no notification when it happens.
+
+Use the `ZoneText( const char* text, size_t size )` macro to add a custom text string that will be displayed along the zone information (for example, name of the file you are opening). Note that every time `ZoneText` is invoked, a memory allocation is performed to store an internal copy of the data. The string you have provided is not used by tracy.
+
+#### Running the server
+
+The easiest way to get going is to build the standalone server, available in the `standalone` directory. You can connect to localhost or remote clients and view the collected data right away.
+
+Alternatively, you may want to embed the server in your application, the same which is running the client part of tracy. Doing so requires that you also include the `server` and `imgui` directories. Include the `tracy/server/TracyView.hpp` header file, create an instance of the `tracy::View` class and call its `Draw()` method every frame. Unfortunately, there's also the hard part - you need to integrate the imgui library into the innards of your program. How to do so is outside the scope of this document.
+
+## Good practices
+
+- Remember to set thread names for proper identification of threads. You may use the functions exposed in the `tracy/common/TracySystem.hpp` header to do so. Note that the max thread name length in pthreads is limited to 15 characters. Proper thread naming support is available in MSVC only if you are using Windows SDK 10.0.15063 or newer (a tracy-specific workaround may be added in the future).
+- Enable the MSVC String Pooling option (`/GF`) or the gcc counterpart, `-fmerge-constants`. This will reduce number of queries the server needs to perform to the client. Note that these options are enabled in optimized builds by default.
+
+## Practical considerations
+
+Tracy's time measurement precision is not infinite. It's only as good as the system-provided timers are.
+- On the embedded ARM-based systems you can expect to have something around 1 µs time resolution.
+- On x86 (currently only implemented on Windows) the time resolution depends on the hardware implementation of the RDTSCP instruction and typically is in the low nanoseconds. This may vary from one micro-architecture to another and requires a fairly modern (Sandy Bridge) processor for reliable results.
+
+While the data collection is very lightweight, it is not completely free. Each recorded zone event has a cost, which tracy tries to calculate and display on the timeline view, as a red zone. Note that this is an *approximation* of the real cost, which ignores many important factors. For example, you can't determine the impact of cache effects. The CPU frequency may be reduced in some situations, which will increase the recorded time, but the displayed profiler cost will not compensate for that.
+
+![](doc/cost.png)
diff --git a/doc/cost.png b/doc/cost.png
new file mode 100644
index 00000000..cd83e986
--- /dev/null
+++ b/doc/cost.png
Binary files differ
diff --git a/doc/design.svg b/doc/design.svg
new file mode 100755
index 00000000..d9ac570b
--- /dev/null
+++ b/doc/design.svg
@@ -0,0 +1,370 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ id="svg8"
+ version="1.1"
+ viewBox="0 0 139.17125 37.041668"
+ height="140"
+ width="526.00159">
+ <defs
+ id="defs2">
+ <marker
+ style="overflow:visible"
+ id="marker6660"
+ refX="0"
+ refY="0"
+ orient="auto">
+ <path
+ transform="matrix(-0.4,0,0,-0.4,-4,0)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
+ d="M 0,0 5,-5 -12.5,0 5,5 Z"
+ id="path6658" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="marker6158"
+ refX="0"
+ refY="0"
+ orient="auto">
+ <path
+ transform="matrix(-0.4,0,0,-0.4,-4,0)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
+ d="M 0,0 5,-5 -12.5,0 5,5 Z"
+ id="path6156" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="Arrow1Send"
+ refX="0"
+ refY="0"
+ orient="auto">
+ <path
+ transform="matrix(-0.2,0,0,-0.2,-1.2,0)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
+ d="M 0,0 5,-5 -12.5,0 5,5 Z"
+ id="path4694" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="marker5984"
+ refX="0"
+ refY="0"
+ orient="auto">
+ <path
+ transform="matrix(-0.4,0,0,-0.4,-4,0)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
+ d="M 0,0 5,-5 -12.5,0 5,5 Z"
+ id="path5982" />
+ </marker>
+ <marker
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="marker5482"
+ style="overflow:visible">
+ <path
+ id="path5480"
+ d="M 0,0 5,-5 -12.5,0 5,5 Z"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
+ transform="matrix(-0.4,0,0,-0.4,-4,0)" />
+ </marker>
+ <marker
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="marker5472"
+ style="overflow:visible">
+ <path
+ id="path5470"
+ d="M 0,0 5,-5 -12.5,0 5,5 Z"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
+ transform="matrix(-0.4,0,0,-0.4,-4,0)" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="marker5378"
+ refX="0"
+ refY="0"
+ orient="auto">
+ <path
+ transform="matrix(-0.4,0,0,-0.4,-4,0)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
+ d="M 0,0 5,-5 -12.5,0 5,5 Z"
+ id="path5376" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="marker5308"
+ refX="0"
+ refY="0"
+ orient="auto">
+ <path
+ transform="matrix(-0.4,0,0,-0.4,-4,0)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
+ d="M 0,0 5,-5 -12.5,0 5,5 Z"
+ id="path5306" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="Arrow1Mend"
+ refX="0"
+ refY="0"
+ orient="auto">
+ <path
+ transform="matrix(-0.4,0,0,-0.4,-4,0)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
+ d="M 0,0 5,-5 -12.5,0 5,5 Z"
+ id="path4688" />
+ </marker>
+ <marker
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="marker5170"
+ style="overflow:visible">
+ <path
+ id="path5168"
+ d="M 0,0 5,-5 -12.5,0 5,5 Z"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
+ transform="matrix(-0.8,0,0,-0.8,-10,0)" />
+ </marker>
+ <marker
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="marker4963"
+ style="overflow:visible">
+ <path
+ id="path4961"
+ d="M 0,0 5,-5 -12.5,0 5,5 Z"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
+ transform="matrix(-0.8,0,0,-0.8,-10,0)" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="marker6158-2"
+ refX="0"
+ refY="0"
+ orient="auto">
+ <path
+ transform="matrix(-0.4,0,0,-0.4,-4,0)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
+ d="M 0,0 5,-5 -12.5,0 5,5 Z"
+ id="path6156-2" />
+ </marker>
+ </defs>
+ <metadata
+ id="metadata5">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ transform="translate(-18.388332,-17.864582)"
+ id="layer1">
+ <g
+ id="g4666">
+ <rect
+ style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4607"
+ width="17.197916"
+ height="6.614583"
+ x="18.520834"
+ y="20.510416" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:2.82222223px;line-height:6.61458302px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="20.968229"
+ y="24.869841"
+ id="text4611"><tspan
+ id="tspan4609"
+ x="20.968229"
+ y="24.869841"
+ style="stroke-width:0.26458332px">Thread 1</tspan></text>
+ </g>
+ <g
+ id="g4661">
+ <rect
+ style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4607-4"
+ width="17.197916"
+ height="6.6145835"
+ x="18.520834"
+ y="32.416668" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:2.82222223px;line-height:6.61458349px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="20.979254"
+ y="36.776093"
+ id="text4611-8"><tspan
+ id="tspan4609-9"
+ x="20.979254"
+ y="36.776093"
+ style="stroke-width:0.26458332px">Thread 2</tspan></text>
+ </g>
+ <g
+ id="g4671">
+ <rect
+ style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4607-8"
+ width="17.197916"
+ height="6.6145835"
+ x="18.520832"
+ y="44.322918" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:2.82222223px;line-height:6.61458349px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="20.951002"
+ y="48.682343"
+ id="text4611-89"><tspan
+ id="tspan4609-6"
+ x="20.951002"
+ y="48.682343"
+ style="stroke-width:0.26458332px">Thread 3</tspan></text>
+ </g>
+ <g
+ id="g5096">
+ <ellipse
+ style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path4644"
+ cx="67.775978"
+ cy="36.3787"
+ rx="10.583333"
+ ry="4.6302085" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:2.82222223px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="67.733261"
+ y="35.623535"
+ id="text4648"><tspan
+ id="tspan4646"
+ x="67.733261"
+ y="35.623535"
+ style="text-align:center;text-anchor:middle;stroke-width:0.26458332px">Tracy</tspan><tspan
+ x="67.733261"
+ y="39.151314"
+ style="text-align:center;text-anchor:middle;stroke-width:0.26458332px"
+ id="tspan4650">client</tspan></text>
+ </g>
+ <path
+ id="path4673"
+ d="m 37.041666,24.479166 19.84375,7.937502"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker5472)" />
+ <path
+ id="path4675"
+ d="m 37.041666,46.968751 19.84375,-6.614584"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker5482)" />
+ <path
+ id="path4677"
+ d="M 37.041667,36.385417 H 55.5625"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker5378)" />
+ <path
+ id="path5059"
+ d="M 84.666667,17.864582 V 54.90625"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1.05833327, 2.11666654;stroke-dashoffset:0;stroke-opacity:1" />
+ <g
+ id="g5106">
+ <ellipse
+ style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path4644-1"
+ cx="101.98283"
+ cy="36.56768"
+ rx="10.583333"
+ ry="4.6302085" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:2.82222223px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="101.90772"
+ y="35.812515"
+ id="text4648-2"><tspan
+ id="tspan4646-5"
+ x="101.90772"
+ y="35.812515"
+ style="text-align:center;text-anchor:middle;stroke-width:0.26458332px">Tracy</tspan><tspan
+ x="101.90772"
+ y="39.340294"
+ style="text-align:center;text-anchor:middle;stroke-width:0.26458332px"
+ id="tspan4650-1">server</tspan></text>
+ </g>
+ <path
+ id="path5108"
+ d="M 79.375,37.708333 H 89.958333"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6660)" />
+ <path
+ id="path5110"
+ d="M 89.958333,35.0625 H 79.375"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker5308)" />
+ <g
+ transform="translate(-2.64619,-1.3704153)"
+ id="g6152">
+ <ellipse
+ style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path6114"
+ cx="128.98439"
+ cy="33.692333"
+ rx="4.6302085"
+ ry="1.2756696" />
+ <path
+ style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 124.36251,41.677042 c -0.004,0.01582 -0.007,0.03168 -0.008,0.04754 5.3e-4,0.704384 2.07327,1.275328 4.62995,1.275373 2.55689,3.5e-5 4.62988,-0.570931 4.63048,-1.275373 -10e-4,-0.01585 -0.003,-0.03171 -0.006,-0.04754"
+ id="path6114-1" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 124.35417,33.739583 v 8.021022"
+ id="path6138" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 133.61458,33.739582 v 8.051744"
+ id="path6140" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:2.82222223px;line-height:6.61458302px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="126.89217"
+ y="39.409225"
+ id="text6144"><tspan
+ id="tspan6142"
+ x="126.89217"
+ y="39.409225"
+ style="stroke-width:0.26458332px">DB</tspan></text>
+ </g>
+ <path
+ id="path6154"
+ d="m 113.77082,36.385418 h 6.61459"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6158)" />
+ <g
+ transform="translate(2.6458333,1.2715659e-6)"
+ id="g6241">
+ <rect
+ style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect6232"
+ width="17.197916"
+ height="5.291667"
+ x="137.58333"
+ y="33.739582" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:2.82222223px;line-height:6.61458302px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="140.8851"
+ y="37.164005"
+ id="text6236"><tspan
+ id="tspan6234"
+ x="140.8851"
+ y="37.164005"
+ style="stroke-width:0.26458332px">Display</tspan></text>
+ </g>
+ <path
+ id="path6154-3"
+ d="m 132.29166,36.385417 h 6.61459"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6158-2)" />
+ </g>
+</svg>
diff --git a/doc/profiler.png b/doc/profiler.png
new file mode 100644
index 00000000..3a6fe135
--- /dev/null
+++ b/doc/profiler.png
Binary files differ