Function Call Tracing

Trace C/C++ program function calls into per-thread logs and Perfetto JSON via -finstrument-functions.

482|72|Updated Apr 5, 2026
One-click install
npx skills add https://github.com/deonmenezes/mantishack --skill function-call-tracing-deonmenezes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Function Call Tracing
Source: https://github.com/deonmenezes/mantishack/tree/main/.claude/skills/crash-analysis/function-tracing
Command: npx skills add https://github.com/deonmenezes/mantishack --skill function-call-tracing-deonmenezes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Instrument C/C++ programs to collect per-thread function-call data and enable Perfetto visualization for performance analysis.

Core Features & Use Cases

  • Instrumentation Library trace_instrument.c captures function entry/exit and writes per-thread logs.
  • Perfetto Converter trace_to_perfetto.cpp transforms logs into Perfetto-compatible Chrome JSON for visualization.
  • Build & Run workflow demonstrates end-to-end tracing: enabling -finstrument-functions, building libraries, running the instrumented program, and converting logs to trace.json for UI.

Quick Start

Add instrumentation to your build, run the instrumented program to generate trace_<tid>.log files, and convert them to trace.json 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 for per-thread performance analysis?

You can trace C/C++ function calls by compiling with the -finstrument-functions flag to capture entry and exit events, generating per-thread logs for detailed performance analysis and debugging.

How does function call tracing visualize native application execution?

Function call tracing visualizes native execution by converting per-thread instrumentation logs into a Perfetto-compatible trace.json file, allowing you to view end-to-end execution timelines in the Perfetto UI.

Can I use Perfetto visualization for C/C++ programs without external profiling libraries?

Yes, you can use built-in compiler instrumentation like -finstrument-functions to capture function entry and exit, then transform the resulting per-thread logs into Perfetto-compatible Chrome JSON for visualization.

What is the best way to debug native applications with end-to-end function tracing?

The best way to debug native applications with end-to-end function tracing is to instrument C/C++ programs to collect per-thread function-call data and convert those logs into a UI-ready trace for Perfetto visualization.

Do I need -finstrument-functions support to generate per-thread logs?

Yes, -finstrument-functions support is required to automatically capture function entry and exit events, which the instrumentation library uses to write the per-thread trace logs.

What are the limitations of using -finstrument-functions for program profiling?

Using -finstrument-functions for profiling requires a compatible log converter to produce UI-ready trace files, and it primarily targets native C/C++ applications requiring end-to-end function tracing and performance analysis.