Lines Matching +full:system +full:- +full:trace

2 *This page provides a birds-eye view of performance analysis.
17 complicated, having a lot of components and a web of cross-interactions.
18 Techniques which help engineers understand the execution of a system
21 **Tracing** and **profiling** are two such widely-used techniques for
22 performance analysis. **Perfetto** is an open-source suite of tools, combining
23 tracing and profiling to give users powerful insights into their system.
27 of a system. A single continuous session of recording is called a trace file
28 or **trace** for short.
31 They often include low-level kernel events like scheduler context switches,
32 thread wakeups, syscalls, etc. With the "right" trace, reproduction of a
33 performance bug is not needed as the trace provides all necessary context.
43 **trace analysis** libraries and **trace viewers** are used. Trace analysis
44 libraries provide a way for users to extract and summarize trace events in
45 a programmatic manner. Trace viewers visualize the events in a trace on a
46 timeline which give users a graphical view of what their system was doing
52 logging: instead of having arbitrary strings emitted from parts of the system,
53 tracing reflects the detailed state of a system in a structured way to allow
63 a logging system as well. However, the utilization of each in practice is
67 Metrics are numerical values which track the performance of a system over time.
68 Usually metrics map to high-level concepts. Examples of metrics include: CPU
70 the app or operating system while the program is running.
75 right approach. In local and lab situations using **trace-based metrics**,
77 is a powerful approach. If a metric regresses, it's easy to open the trace
80 However, trace-based metrics are not a universal solution. When running in
82 them 24/7. Computing a metric with a trace can take megabytes of data vs bytes
86 of a system over time but do not want to or can not pay the cost of collecting
87 traces. In these situations, traces should be used as a **root-causing** tool.
108 also be done when certain events happen in the operating system.
112 1. Why profile my program statistically when I can just trace *everything*?
126 [magic-trace](https://github.com/janestreet/magic-trace)) but they output
136 application instrumentation and low-level kernel events together provide
149 we call everything a "trace" even if it may contain (only) profiling data
155 collected, how it should be collected, how much information a trace should
158 [Record traces on Linux quickstart](/docs/quickstart/linux-tracing.md) is
161 [Record traces on Android quickstart](/docs/quickstart/android-tracing.md) will
162 be more applicable. The [trace configuration](/docs/concepts/config.md) page
165 The following sub-sections give an overview of various points worth considering
170 [ftrace](https://www.kernel.org/doc/Documentation/trace/ftrace.txt) tracing
171 system to record kernel events (e.g. scheduling, syscalls, wakeups). The
172 [scheduling](/docs/data-sources/cpu-scheduling.md),
173 [syscall](/docs/data-sources/syscalls.md) and
174 [CPU frequency](/docs/data-sources/cpu-freq.md) data source pages give
178 [this proto message](/docs/reference/trace-packet-proto.autogen#FtraceEvent).
181 ["generic"](/docs/reference/trace-packet-proto.autogen#GenericFtraceEvent)
182 events. These events are encoded as key-value pairs, similar to a JSON
186 the inefficient encoding causes trace size bloat and the
187 [trace processor](/docs/analysis/trace-processor.md) cannot parse them
190 [here](/docs/contributing/common-tasks.md#add-a-new-ftrace-event) is a simple
194 Perfetto has a [C++ SDK](https://perfetto.dev/docs/instrumentation/tracing-sdk)
196 designed to be very low-overhead and is distributed in an "amalgamated" form
198 system.
201 usage by Q2 2023. See [this doc](https://bit.ly/perfetto-c) for details (note
203 [this group](https://groups.google.com/forum/#!forum/perfetto-dev))
210 ##### android.os.Trace (atrace) vs Perfetto SDK
217 * performance: tracing to Perfetto from system/app code requires just a memory
219 generally makes Perfetto anywhere from 3-4x faster than atrace
222 natural representation of data-flow.
223 * trace size: Perfetto supports various features (delta encoded timestamps,
224 interned strings, protobuf encoding) which vastly reduce to size of trace
229 process which wants to trace to Perfetto.
236 from the SDK, please reach out to the team directly. By mid-2023, significant
240 <!--
262 * Trace processing
282 -->