# Magic-trace: Diagnosing tricky performance issues easily with Intel Processor Trace

DevFeed: [Magic-trace: Diagnosing tricky performance issues easily with Intel Processor Trace](<https://devfeed.tech/articles/magic-trace-diagnosing-tricky-performance-issues-easily-with-intel-processor-trace-20193.md>)

Original publisher: [Read original article](<https://blog.janestreet.com/magic-trace/>)

Author: Tristan Hume

Published: 2022-01-11T00:00:00Z

Content type: article

Language: en

Sources: [Jane Street](<https://devfeed.tech/sources/jane-street.md>)

Topics: [Tool](<https://devfeed.tech/topics/tool.md>), [perfetto](<https://devfeed.tech/topics/perfetto.md>)

Tags: [google](<https://devfeed.tech/tags/google.md>), [intel](<https://devfeed.tech/tags/intel.md>), [latency](<https://devfeed.tech/tags/latency.md>), [network-packets](<https://devfeed.tech/tags/network-packets.md>), [ocaml](<https://devfeed.tech/tags/ocaml.md>), [perfetto](<https://devfeed.tech/tags/perfetto.md>), [performance](<https://devfeed.tech/tags/performance.md>), [performance-analysis](<https://devfeed.tech/tags/performance-analysis.md>), [trace](<https://devfeed.tech/tags/trace.md>)

## AI overview

Magic-trace uses Intel Processor Trace to capture about 10 ms of execution before a selected function call, then displays the call stack and durations on a zoomable timeline in Perfetto. Users can add an instrumentation call or select an existing function, run the program, and choose a process. The excerpt says Processor Trace provides timing around 30 ns, making it useful for latency events too brief or rare for sampling profilers, which sample roughly every 250 microseconds. It notes that the article also covers implementation difficulties and bugs, but this excerpt does not provide those details.

## Source excerpt

Intel Processor Trace is a hardware technology that can record all program execution flow along with timing information accurate to around 30ns. As far as I can tell almost nobody uses it, seemingly because capturing the data is tricky and, without any visualization tools, you're forced to read enormous text dumps.