# Automated Function Tracing

**URL:** <https://ziggit.dev/t/automated-function-tracing/12923>\
**Category:** Help\
**Tags:** comptime\
**Created:** [November 8, 2025, 4:03pm UTC](https://ziggit.dev/t/automated-function-tracing/12923 "2025-11-08T16:03:04Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Sze](https://ziggit.dev/user_avatar/ziggit.dev/sze/32/496_2.png) [@Sze](https://ziggit.dev/u/Sze)\
**Post date:** [November 9, 2025, 1:42am UTC](https://ziggit.dev/t/automated-function-tracing/12923/4 "2025-11-09T01:42:52Z")

</div>

## tracy

Maybe look into using tracy, it allows you to interact with live-updating tracing profiles mark/time sections of code and log messages, I haven’t yet (but it is one of the tools I want to add eventually) and it seems like it may involve some work to get it running, but if you can get it running, I think it could be helpful for that and a lot more.

With tracy you would have to pass the data to be recorded manually, instead of magically.

## zigft

I think you could use [GitHub - chung-leong/zigft: Zig function transform library](https://ziggit.dev/t/github-chung-leong-zigft-zig-function-transform-library/9222) to create wrapper functions that replace the original functions but add logging [zigft - adding-debug-output-to-a-function](https://github.com/chung-leong/zigft?tab=readme-ov-file#adding-debug-output-to-a-function)

## scripted debugger

Another approach might be to run the program via a debugger and script it to set a breakpoint, inspect and print the variables and then continue, I think somebody in this forum wrote a post about something like that, but can’t find it right now.

## in the future maybe via build system or compiler protocol?

I think it might be nice if Zig eventually had a way to automatically add tracing to some functions via some kind of build-system api or maybe by requesting it by communicating with the compiler while incremental reload is enabled.

## DynamoRIO

> **[Home](https://dynamorio.org/)**
>
> DynamoRIO Dynamic Instrumentation Tool Platform

Haven’t tested it, but it seems interesting and useful:

> DynamoRIO is a system for runtime code manipulation that is efficient, transparent, and comprehensive, able to observe and manipulate every executed instruction in an unmodified application running on a stock operating system and commodity hardware.

This page explains it quite well [DynamoRIO System Overview](https://dynamorio.org/overview.html).  
If somebody finds the time to try it out, let us know how it worked out!

---

_[View the full topic](https://ziggit.dev/t/automated-function-tracing/12923)._
