[cairo] Re: [poppler] Re: poppler profiling on geode with
jeff at infidigm.net
Tue Nov 14 22:32:48 PST 2006
On Wed, Nov 15, 2006 at 12:49:30AM -0500, Behdad Esfahbod wrote:
> On Tue, 2006-11-14 at 22:39 -0500, Jeff Muizelaar wrote:
> > On Tue, Nov 14, 2006 at 08:05:19PM -0500, Behdad Esfahbod wrote:
> > > I sure am interested. Actually it should be very easy to add some
> > > script magic to cairo to generate such a bprobe probe automatically
> > > using the header files. /me heads hacking that. Thanks for the idea!
> > I generate my wrappers using the dwarf debugging information.
> Interesting. I never used dwarf before. Can you summarize how you do
> it in a paragraph? :)
First, generate a list of target symbols by choosing all of the global
functions from the elf symbol table. Next for each of these symbols you
find the corresponding subprogram debug information entry (DIE). This
entry contains links to the return type and all of the paramters and
types. For each of the types, I walk down the typedef chain until they
turn into pointers, integers or enumerations. I then substitute the
compatible type in so that I do not need to worry about having correct
type definitions. (In the future it should be possible to export type
information so that things like enumerations can be pretty printed.) I
then generate the appropriate code to wrap all of the functions.
To do the above, I basically hacked pahole
uses libdw from elfutils.
If you really want I can send you the code. However, it is poorly done
and frankly I am embarrassed by it. If you aren't in a hurry, I still
plan to clean it up and release it when I get the time.
More information about the cairo