Function Call Tracing

Instrument C/C++ programs to trace function calls into per-thread logs and Perfetto JSON.

Updated Apr 28, 2026
One-click install
npx skills add https://github.com/roberttmadsen13-del/TOURney --skill function-call-tracing-roberttmadsen13-del
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Function Call Tracing
Source: https://github.com/roberttmadsen13-del/TOURney/tree/main/SKILLS/raptor-main/.claude/skills/crash-analysis/function-tracing
Command: npx skills add https://github.com/roberttmadsen13-del/TOURney --skill function-call-tracing-roberttmadsen13-del

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Instrument C/C++ programs to trace function entry and exit with per-thread logs and Perfetto visualization.

Core Features & Use Cases

  • Instrumentation Library: trace function calls and generate per-thread logs for analysis.
  • Perfetto Conversion: convert logs into Perfetto-compatible JSON for UI visualization.
  • Use Case: diagnose hot paths in multi-threaded C/C++ programs, correlating events across threads.

Quick Start

Integrate the instrumentation library into your project, build it, run your program to generate per-thread trace_<tid>.log files, and convert them to a Perfetto trace using trace_to_perfetto.

Frequently Asked Questions about Function Call Tracing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I trace C/C++ function calls in a multi-threaded application?

To trace C/C++ function calls, integrate an instrumentation library into your program to log function entry and exit events. When run, it generates per-thread trace logs for multi-threaded applications to collect detailed call traces.

How do I visualize C/C++ function traces in Perfetto?

To visualize C/C++ function traces in Perfetto, use a converter to transform generated per-thread log files into Perfetto-compatible JSON. This produces a trace.json file you can load into the Perfetto UI for visual analysis.

What is the best way to profile hot paths across multiple threads in C++?

Profiling hot paths across multiple threads requires instrumenting C/C++ programs to generate per-thread logs. This allows you to correlate events across threads and diagnose performance bottlenecks visually.

Can I use Perfetto to diagnose performance issues in C/C++ programs?

Yes, you can use Perfetto to diagnose C/C++ performance issues. By instrumenting your code to generate trace logs and converting them to Perfetto JSON, you can visualize call traces to identify hot paths.

What format do the trace logs produce before converting to Perfetto JSON?

Before converting to Perfetto JSON, the trace logs produce per-thread files named trace_<tid>.log. These files capture function call instrumentation data for each thread individually.

Are there limitations to using function call tracing for C/C++ performance analysis?

Function call tracing for C/C++ performance analysis requires integrating an instrumentation library and building the program with it. It is specifically designed for diagnosing multi-threaded applications by correlating events across threads.