Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Sep 2023 21:24:32 +0200
From:      Domagoj Stolfa <domagoj.stolfa@gmail.com>
To:        freebsd-hackers@freebsd.org, freebsd-dtrace@freebsd.org
Subject:   Structured/machine-readable output for DTrace
Message-ID:  <8670bde3-58bf-66db-b228-a7d7bc94a48b@gmail.com>

next in thread | raw e-mail | index | archive | help
Hi:


I've implemented machine-readable output in the form of JSON, XML and 
HTML into libdtrace, and by extension dtrace(1) using libxo. The goal is 
not to replace linking to libdtrace in any way when one wishes to build 
a custom application around it, but rather to supplement it (as it would 
now also support this form of output by default) and act as a 
middle-ground between linking directly to libdtrace and parsing the 
pretty-printed dtrace(1) output that is available today (but not replace 
it).


In order to get it to work, you can simply run dtrace(1) as normal, but 
add -x oformat=json|xml|html|plain.


I've posted the patch up for review if anyone wants to take a look or 
try it out [1] and posted a hacked up Python program (by no means good 
Python code) as an example of how this might be used [2]. I would 
appreciate any feedback you might have.


As this patch is still in its early stages however, there isn't much 
documentation available for it. I aim to address this soon.


[1]: https://reviews.freebsd.org/D41745

[2]: https://reviews.freebsd.org/D41745


-- 

Domagoj




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8670bde3-58bf-66db-b228-a7d7bc94a48b>