LogoAwesome Skills
  • Search
  • Category
  • Tag
  • Blog
LogoAwesome Skills
LogoAwesome Skills

Discover Open-Source Agent Skills for AI Coding Assistants

Product

  • Search
  • Category
  • Tag
  • Blog

Resources

  • Claude Skill Docs
  • Antigravity Skills Docs

Tools

  • Claude Code
  • OpenCode
  • Cursor
  • Codex
  • Antigravity

Company

  • Privacy Policy
  • Terms of Service
  • Sitemap

©2026 Awesome Skills. All rights reserved.

Privacy PolicyTerms
Back to Skills

Function Call Tracing

Instrument C/C++ with -finstrument-functions for execution tracing and Perfetto visualization

1,014stars119forksUpdated 1/23/2026
#perfetto#profiling#debugging#performance-optimization#tracing#instrumentation

Security Assessment

Safe(100/100)
Security Score100/100

About Function Call Tracing

The Function Call Tracing skill is designed to trace function calls within C/C++ programs, providing valuable insights into the execution flow of the code. It addresses the challenge of tracking function calls and visualizing their performance in a structured manner, which is particularly useful for debugging, profiling, and performance analysis. By leveraging function instrumentation and per-thread logging, the skill ensures that developers can track each function’s entry and exit, providing a detailed execution trace for deeper analysis and optimization. With integration into the Perfetto visualization tool, users can access high-fidelity performance data, making it easier to identify bottlenecks and optimize their code for better performance and resource utilization.

Main features of the skill include instrumentation through the `-finstrument-functions` GCC flag, capturing function calls with per-thread logs, and the ability to convert logs into a format suitable for viewing in the Perfetto Chrome UI. The logs capture the timestamp, call depth, and function name, allowing users to gain a clear understanding of how their program functions. Additionally, the solution offers an easy setup through a Makefile or CMake configuration to enable tracing conditionally. The final output consists of per-thread log files and a unified Perfetto JSON file, allowing seamless visualization and analysis of the collected data.

This skill is ideal for developers working with C/C++ codebases who need to monitor and analyze function execution in detail. It's particularly useful for performance engineers, software debuggers, and anyone aiming to improve the performance of their applications by understanding the execution flow at a granular level. By integrating this skill, users can gain deeper insights into their programs' behavior, enabling them to make data-driven decisions for optimization and troubleshooting.

FAQ

How do I enable function tracing in my project?

To enable function tracing, copy `trace_instrument.c` and `trace_to_perfetto.cpp` to your project, add `-finstrument-functions` to the CFLAGS, and link with the instrumentation library by adding `-L. -ltrace -ldl -lpthread` to LDFLAGS. Then build and run your program as usual.

What is the output format of the trace data?

The trace data is output as per-thread log files in the format `trace_<tid>.log`, which contain the function entry and exit events. These logs are then converted into a Perfetto JSON file (`trace.json`) for visualization in the Perfetto UI.

Can I use this tool with CMake?

Yes, you can use this tool with CMake. You can enable tracing by setting the `ENABLE_TRACE` option to `ON` in your CMake configuration. This will add the necessary compiler options and link libraries to enable tracing functionality.

What are the system requirements for using this skill?

This skill requires a C/C++ development environment with support for GCC or Clang for compilation. The system must also support Perfetto for visualization, and you need access to `libdl` and `libpthread` for linking the instrumentation library.

Is there any performance overhead when using function tracing?

Yes, there will be some performance overhead due to the logging and function instrumentation. However, the impact is typically minimal during the trace collection phase and is meant for profiling purposes rather than regular production use.

All Files

3 files
trace_to_perfetto.cpp5.5 KB
View
trace_instrument.c2.9 KB
View
SKILL.md2.5 KB
View

Install Function Call Tracing

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

gadievron/raptor

Related Skills

tigris-security-access-control

3

rebuttal-writing

362

building-blocks

189

docs-search

189