[cairo] cairo-trace and cairo-perf-trace with new backend

Chris Wilson chris at chris-wilson.co.uk
Thu Nov 5 01:14:55 PST 2009


Excerpts from aymen chehaider's message of Wed Nov 04 17:46:32 +0000 2009:
> Hi,
> 
> Thank you very much for your response.
> 
> I have encountered other problems :
> 
> 1- I have coupled in the boilerplate/ for my backend ==> but test results
> are FAIL (out of memory !!!)

Hmm, sounds like an error is being returned somewhere. I've actually
been meaning to change that FAIL to an ERROR to distinguish these
cases. This is likely to be somewhere in your backend either as an error
return, or you have not implemented a required interface (but that
should lead to an assert). If you have wrapped all instances of
CAIRO_STATUS_NO_MEMORY with _cairo_error(), then you can attach a
debugger and set a breakpoint on _cairo_error -- which will trap the
faulting instruction.

If you want to post your backend for review, I'm happy to do so, as will
other members of this list.

> 2- I have generate a cairo trace for my application (Browser OWB), but when
> I use the cairo-perf-trace, I have this error :
> *[ # ]  backend                         test   min(s) median(s) stddev.
> count
> [  0]   sahgfx                 Error during replay, line 5: invalid value
> (typically too big) for the size of the input (surface, pattern, etc.)
[snip]
> dict
>   /type /sahgfx set
>   surface dup /s0 exch def    *<==== the problem is in this line 5*

Ok, I realise I haven't documented the requirements at all for
tracing...

In order to reconstruct a surface, the minimum we need is a content type
and size.  During the trace these are added to the surface dictionary,
like for example:

  dict
    /content //COLOR_ALPHA set
    /width 128 set
    /height 64 set
  surface

The error that the script is reporting is the absent width or height,
content defaults to COLOR_ALPHA.

There is a supply of pre-traced applications available from
anongit.freedesktop.org/cairo-traces if you want to use some existing
behaviour for profiling whilst developing the backend.

It sounds like your backend is developing at quite a pace - I hope you
are enjoying working with Cairo! :-)
-ickle
-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the cairo mailing list