Zig NEWS

Discussion on: trace.zig: A small and simple tracing client library

Collapse
 
huntrss profile image
huntrss

Thanks for your comment.

At the moment trace.zig logs to stderr (using std.log.info) and using ; between the relevant data elements of a logged trace point. This means it can be used as CSV and processed further with CSV tooling (open office, libre office, Excel, etc.). It makes sens to filter the log output for all lines that contain "tp;". This way other log statements are not contained in the CSV.

Unfortunately there is no more sophisticated tooling at the moment, but it could be added to the "ecosystem", e.g. that the output is converted to something usable in the Open Telemetry ecosystem with another CLI tool etc.. The basic idea of trace.zig is, to collect the data with as minimal output as possible and getting it "off" the process or even the device (in case of an embedded device). Post processing is solely done after the trace data has been collected. Therefore the collected trace point data is as minimal as required.

Thanks for pointing out the usage of tracy in the compiler. I did see it, but I kind of liked the idea of having a tracing in Zig only. Also trace.zig does not aim to be as powerful, sophisticated and feature-full as tracy is. But I can imagine a future version, where the trace output of trace.zig can be converted to a tracy compatible output to tap into the tracy tool chain. I am not sure if this is possible though.