[cairo] libcairowrap

Chris Wilson chris at chris-wilson.co.uk
Sat Dec 1 00:31:34 PST 2007


On Fri, 2007-11-30 at 16:10 -0800, Carl Worth wrote:
> On Thu, 29 Nov 2007 21:07:54 +0100, "Benjamin Otte" wrote:
> > > And thanks for the report from libcairowrap. That tool's output is
> > > definitely looking really good.
> > >
> > Thanks. It's currently "just" a neat printf wrapper around cairo
> > functions where I made the printfs emit something that looks close to
> > compilable C code, so it fits into a simple C file.

I needed a mechanism for replaying cairo operations, with an emphasis on
generating benchmarks, and similarly adapted libcairowrap. As the traces
can grow very large, very quickly, I switched to using a binary file
which could then be either replayed or printed. I included a simple hash
table and tracked lifetime of objects in order to convert pointers back
to short tokens - originally I used glib, but grew a little wary of
trying to initialise it in a potentially multi-threaded library.

Anyway just food for thought:
git://annarchy.freedesktop.org/~ickle/cairo-trace
http://cgit.freedesktop.org/~ickle/cairo-trace

The downside of using an intermediate binary file is that is adds a
burdensome extra step to when you just want to snoop. The benefit is
that it allows for setting /etc/ld.so.preload and then capturing usage
across an entire desktop.


> Welcome, Benjamin! Please have fun hacking on cairo!
/me breaks out the Champagne.

Now you have no excuse but to implement filters for yourself. ;-)
--
Chris Wilson



More information about the cairo mailing list