Commit graph

55 commits

Author SHA1 Message Date
Andrea Canciani
549b1f8d4b boilerplate: Remove unused thread id parameter
The thread id is not used anymore (it is always == 0), so it can be
removed.
2011-11-12 20:49:08 +01:00
Andrea Canciani
c8b5d270f6 Improve the documentation of the flags
Some utilities were providing incorrect or incomplete usage
information.
2011-11-12 20:49:08 +01:00
Andrea Canciani
6a0ba30303 Sort option flags
Keep the option flags in alphabetical order. This makes it easier to
check for collisions or missing handlers.

Avoids an internal error when passing flags -c, -r or -v to
cairo-analyse-trace.
2011-11-12 20:49:08 +01:00
Chris Wilson
af9fbd176b Introduce a new compositor architecture
Having spent the last dev cycle looking at how we could specialize the
compositors for various backends, we once again look for the
commonalities in order to reduce the duplication. In part this is
motivated by the idea that spans is a good interface for both the
existent GL backend and pixman, and so they deserve a dedicated
compositor. xcb/xlib target an identical rendering system and so they
should be using the same compositor, and it should be possible to run
that same compositor locally against pixman to generate reference tests.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

P.S. This brings massive upheaval (read breakage) I've tried delaying in
order to fix as many things as possible but now this one patch does far,
far, far too much. Apologies in advance for breaking your favourite
backend, but trust me in that the end result will be much better. :)
2011-09-12 08:29:48 +01:00
Andrea Canciani
761ef7ae8b cairo-missing: Fix and cleanup ssize_t type definition
The definition of ssize_t is needed in cairo-missing.h and can be
dropped from files which include it.
2011-09-04 16:23:37 -07:00
Andrea Canciani
dcd3e2cde1 perf: Get rid of cairo_perf_ticks_per_second()
The cairo_time_from_s() and cairo_time_to_s() functions should be used
instead.
2011-09-02 12:45:49 +02:00
Andrea Canciani
9172e2aec0 perf: Drop cairo_perf_ticks_t in favor of cairo_time_t
cairo_time_t offers a superset of the functions provided by
cairo_perf_ticks_t.
2011-09-02 12:45:49 +02:00
Andrea Canciani
6d6bfbd641 Introduce the cairo-missing library
The cairo-missing library provides the functions which are needed in
order to correctly compile cairo (or its utilities) and which were not
found during configuration.

Fixes the build on MacOS X Lion, which failed because of collisons
between the cairo internal getline and strndup and those in libc:

cairo-analyse-trace.c:282: error: static declaration of ‘getline’ follows non-static declaration
/usr/include/stdio.h:449: error: previous declaration of ‘getline’ was here
cairo-analyse-trace.c:307: error: static declaration of ‘strndup’ follows non-static declaration
...
2011-09-02 12:27:13 +02:00
Chris Wilson
6b1daace57 perf: Print a summary of each operation for a trace (using '-s')
In order for this to be effective on small system we also need to
disable the recording of the long traces which exhaust all memory...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-30 13:28:47 +01:00
Chris Wilson
6cdad1931a observe: Provide the sum of the elapsed time of the individual operations
We can use the elapsed time of the indiividual operations to profile the
synchronous throughput of a trace and eliminate all replay overhead. At
the cost of running the trace synchronously of course.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-23 14:41:10 +01:00
Chris Wilson
713c8069be perf: Cleanup target after each run
As the trace may leak surfaces over its lifetime, we are forced to
teardown the connection between runs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-19 22:32:31 +01:00
Andrea Canciani
e04e368748 Remove useless checks for NULL before freeing
This patch has been generated by the following Coccinelle semantic patch:
// Remove useless checks for NULL before freeing
//
// free (NULL) is a no-op, so there is no need to avoid it

@@
expression E;
@@
+ free (E);
+ E = NULL;
- if (unlikely (E != NULL)) {
-   free(E);
(
-   E = NULL;
|
-   E = 0;
)
   ...
- }

@@
expression E;
@@
+ free (E);
- if (unlikely (E != NULL)) {
-   free (E);
- }
2011-07-31 16:46:36 +02:00
Andrea Canciani
463a8b67a3 perf: Fix build on win32
The performance tools build system for Win32 hasn't been maintained
for some time.  The makefiles are now structured as in other
directories (Makefile.sources used by both Makefile.am and
Makefile.win32) and some additional code hides os-specific parts.
2011-06-24 14:13:09 +02:00
Andrea Canciani
f21ac5b13b error: Do not define _cairo_error twice
cairo-perf-trace uses cairo-hash.c, which calls _cairo_error.

Instead of redefining it in cairo-perf-trace.c it can be abstracted in
a separate source which is directly included in the build of
cairo-perf-trace.

This avoids visibility issues when compiling cairo-perf-trace with a
statically linked cairo library on architectures which do not support
hidden visibility (example: win32).
2011-06-24 11:57:22 +02:00
Chris Wilson
bf1b08d066 perf 2011-06-02 08:57:13 +01:00
Chris Wilson
c6c3bdba4b perf: Only print description once per backend
Currently we print the backend description before every time, which is
overly verbose. As the information doesn't^Wshouldn't change, simply
print it before running the first test of each target.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-20 14:26:37 +01:00
Benjamin Otte
9ce87c67ff perf: print comment describing backend
Use the descibe string to output information about the backend we're
testing.
2010-07-03 02:55:52 +02:00
M Joonas Pihlaja
b036a09972 whitespace: Fixup formal arguments and tabs in boilerplate/ and perf/.
Ran a script to align the formal parameters of functions and
collapse spaces to tabs in code.
2010-06-24 15:02:53 +03:00
Chris Wilson
97f8c20727 boilerplate: Create an image16 target
In order to exercise the newly restored r5g6g5 support, we need to
create an appropriate surface and feed it through the test and
performance suites.
2010-03-27 21:53:55 +00:00
Chris Wilson
25a77b263d boilerplate: Cleanup the list of backends upon shutdown. 2010-03-23 16:49:21 +00:00
Chris Wilson
e1f0c2e73f perf: Check for and include unistd.h
isatty() and access() require unistd.h, so include it!
2010-03-04 17:11:58 +00:00
Chris Wilson
411c09eed7 perf: Enable a surface cache for perf-trace
Real applications that control their Drawable externally to Cairo are
'disadvantaged' by cairo-perf-trace when it creates a similar surface
for each new instance of the same Drawable. The difficulty in
maintaining one perf surface for every application surface is that the
traces do not track lifetimes for the application surfaces, so we would
just accumulate stale surfaces. The surface cache takes a different
approach and returns the same surface for each active Drawable, and
maintains a hold-over of the MRU 16 surfaces. This achieves 60-80% hit
rate with firefox, which is probably as good as can be expected.
Obviously for double-buffered applications we only every draw to freshly
created surfaces (and Gtk+ bypasses cairo to do the final copy -- the
ideal application would just use a push-group for double buffering, in
which case we would capture and replay the entire expose event).

To enable use of the surface cache whilst replaying use -c:

  ./cairo-perf-trace -c firefox-talos-gfx
2010-01-22 23:01:46 +00:00
M Joonas Pihlaja
43a775f60d [meta] Rename cairo_meta_surface_t to cairo_recording_surface_t.
The new name is more descriptive than the rather opaque meta surface.
Discussed with vigour on the mailing list and #cairo:

http://lists.cairographics.org/archives/cairo/2009-July/017571.html
2009-10-22 02:29:47 +03:00
Vladimir Vukicevic
d7faec024a Add skia backend
Originally written by Vladimir Vukicevic to investigate using Skia for
Mozilla, it provides a nice integration with a rather interesting code
base. By hooking Skia underneath Cairo it allows us to directly compare
code paths... which is interesting.

[updated by Chris Wilson]
2009-08-29 17:07:35 +01:00
Chris Wilson
bdd3c5ba69 [perf] Match directory names
In order to handle 'cairo-perf-trace benchmark', we need to perform the
can_run? test on the directory name as opposed to the individual trace
names. Make it so.
2009-08-29 08:08:26 +01:00
Chris Wilson
77c1109616 [perf] Reset global caches after every trace
I'd disabled this to look at cairo-qt performance, then forgot about it.
Be clean, cleanup globals -- this should fix the huge performance loss
when running in series multiple backends that need separate font caches.
2009-08-29 08:08:25 +01:00
Chris Wilson
9c8e60f771 [perf] Remove cpuset warning for cairo-perf-trace
These traces run for much longer than the original synthetic benchmarks
and seek to replicate 'real-world' applications, so the warning that the
xserver and cairo-perf are not bound to any cpu is false.
2009-08-29 08:08:25 +01:00
Chris Wilson
d1b8e260d4 [qt] Fix compilation
Enabling 'FAST CLIP' appears to trigger an infinite loop so disable.

Enabling 'FAST FILL' has limited effect on performance, so disable whilst
the basic QT surface is improved.
2009-08-10 21:31:10 +01:00
Chris Wilson
8c6ecfe648 [perf] Remove the warning about failing to open a directory
The warning is repeated in the error message if we fail to find any
traces, and now that we search a path it is likely that some elements do
not exist. Thus we annoy the user with irrelevant, non-fatal warnings.

Still looking for suggestions for the most appropriate home for the system
wide cairo-traces dir...
2009-07-29 16:19:21 +01:00
Chris Wilson
c3f2db4f73 [drm] Add an accelerated image surface.
Use the DRM interface to h/w accelerate composition on image surfaces.
The purpose of the backend is simply to explore what such a hardware
interface might look like and what benefits we might expect.  The
use case that might justify writing such custom backends are embedded
devices running a drm compositor like wayland - which would, for example,
allow one to write applications that seamlessly integrated accelerated,
dynamic, high quality 2D graphics using Cairo with advanced interaction
(e.g. smooth animations in the UI) driven by a clutter framework...

In this first step we introduce the fundamental wrapping of GEM for intel
and radeon chipsets, and, for comparison, gallium. No acceleration, all
we do is use buffer objects (that is use the kernel memory manager) to
allocate images and simply use the fallback mechanism. This provides a
suitable base to start writing chip specific drivers.
2009-07-23 16:18:42 +01:00
Chris Wilson
bfbe875ded [gl] Enable GL backend for cairo-perf-trace 2009-07-22 07:52:30 +01:00
Chris Wilson
f30cee70f5 [perf] Search multiple directories for traces
In view of sharing traces between multiple builder, add some system wide
directories to the search path. This should be refined to a single
canonical location before release.
2009-07-20 22:20:01 +01:00
Chris Wilson
8f4611a94b [perf] Fix use-after-free when retrieving error line number
We find out the status on destroying the script and then attempt to query
the defunct script for more info about the error. Wrong.
2009-07-01 19:45:06 +01:00
Chris Wilson
1564d67d63 [perf] Exclude the xlib-reference target from cairo-perf 2009-06-30 22:23:21 +01:00
Chris Wilson
b7f68d3518 [perf] Enable trace directory recursion.
I have an idea to categorise traces within their own subdirectories and so
for convenience added path walking to cairo-perf-trace. Principally this
should allow for forests of symlinks of all types.
2009-06-30 20:46:12 +01:00
Chris Wilson
3759c7b34b [perf] Enable the null-backend for trace replays. 2009-06-27 19:38:30 +01:00
Chris Wilson
ef0d307d54 [perf] Need to version surface types
As cairo-perf-diff will execute the current cairo-perf against historical
revisions, any introduced api must be protect in order to compile on old
versions.
2009-06-21 10:13:31 +01:00
Chris Wilson
18edea36ba [perf] Report line of error during trace
Query the number of new lines processed so far and report that on hitting
an error.
2009-06-19 14:14:32 +01:00
Vladimir Vukicevic
22587f57bd Import Qt backend by Mozilla
Written by Vladimir Vukicevic to enable integration with Qt embedded
devices, this backend allows cairo code to target QPainter, and use
it as a source for other cairo backends.

This imports the sources from mozilla-central:
http://mxr.mozilla.org/mozilla-central/find?text=&kind=text&string=cairo-qpainter
renames them from cairo-qpainter to cairo-qt, and integrates the patch
by Oleg Romashin:
https://bugs.freedesktop.org/attachment.cgi?id=18953

And then attempts to restore 'make check' to full functionality.

However:
 - C++ does not play well with the PLT symbol hiding, and leaks into the
   global namespace. 'make check' fails at check-plt.sh

 - Qt embeds a GUI into QApplication which it requires to construct any
   QPainter drawable, i.e. used by the boilerplate to create a cairo-qt
   surface, and this leaks fonts (cairo-ft-fonts no less) causing assertion
   failures that all cairo objects are accounted for upon destruction.

[Updated by Chris Wilson]
Acked-by: Jeff Muizelaar <jeff@infidigm.net>
Acked-by: Carl Worth <cworth@cworth.org>
2009-06-16 11:03:46 +01:00
Chris Wilson
7d3881114a [perf] Report errors during replays 2009-06-16 11:03:45 +01:00
Chris Wilson
061e0477e9 [perf] Report iteration count
Show number of discard results by showing the number of statistically
valid samples out of total population count.
2009-06-16 11:03:41 +01:00
Chris Wilson
e5727e20f5 Expose _cairo_null_surface_create() via a test surface
Using a null surface is a convenient method to measure the overhead of the
performance testing framework, so export it although as a test-surface so
that it will only be available in development builds and not pollute
distributed libraries.
2009-06-15 12:03:37 +01:00
Chris Wilson
a41e1275d2 [boilerplate] Make array of targets const.
Protect the boilerplate targets from unexpected modifications.
2009-06-12 22:28:38 +01:00
Chris Wilson
55cbf52547 [perf] Fix -i getopt parsing.
Gah, I presumed that the ':' separated options that required arguments
from stand-alone options. I was wrong. The ':' indicates that the
preceding option takes an argument. So add it back to -i.
2009-06-11 15:40:27 +01:00
Chris Wilson
42c0aee1d9 [perf] Add a -x to exclude traces from a benchmark.
Read names of traces to exclude from a file specified using -x on the
commandline, i.e.
$ ./cairo-perf-trace -x cairo-traces/tiny.exclude

This is a convenient method for me to exclude certain traces for
particular machines. For example tiny cannot run
firefox-36-20090609.trace as that has a greater working set than the
available RAM on tiny.
2009-06-11 13:00:31 +01:00
Chris Wilson
34ccaeae2d [perf] Continuously update the summary for traces 2009-06-08 00:12:28 +01:00
Chris Wilson
867c88ae90 [script] Add a finish method to the interpreter
When using fonts circular references are established between the holdover
font caches and the interpreter which need manual intervention via
cairo_script_interpreter_finish() to break.
2009-06-06 12:59:39 +01:00
Chris Wilson
4e11d56f8e [perf] Update trace summary after each iteration
Running the macro-benchmarks takes so long, feedback is important.
2009-06-04 11:16:48 +01:00
Chris Wilson
5c2e73e74c [perf] Enable traces to be interrupted
Waiting for a long running benchmark can be very annoying, especially if
you just want a rough-and-ready result. So hook into SIGINT and stop the
current benchmark (after the end of the iteration) on the first ^C. A
second ^C within the same iteration will kill the program as before.
2009-06-04 10:03:45 +01:00
Chris Wilson
2eaced2447 [perf] Reconstruct interpreter for each run
Destroy the interpreter after each run of a trace so that we collect any
left-over garbage.
2009-06-03 21:49:17 +01:00