test: Fix typo in sample_horizontal to use horizontal, not vertical.

Triggers the following warning during build:

sample.c:61:1: warning: ‘horizontal’ defined but not used
 [-Wunused-function]

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
image: Quell warning about signed/unsigned int comparison.

Restore (int) cast that was dropped in e7e1ac23.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
recording: Fix inconsistent usage of types for indices

We were wantonly mixing unsigned/signed integers for our index and
counters, leading to compiler warnings. Be bold, and use unsigned
consistently.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
perf: Rudimentary histogram printing for cairo-perf-print

If you call ./cairo-perf-print --histogram results.txt, it will then
print a histogram of the results, one per test. Ideally, you should see
a skewed distribution (with a negative skew representing that most results
run in optimal time), but random sampling errors (scheduling,
throttling, general inefficiency etc) will push it more towards a normal
distribution.

For example,
|                                                             x                |
|                                                             x xx             |
|                                                             x xx             |
|                                                             x xx             |
|                                                             xxxx             |
|                                                             xxxx x           |
|                                                          x  xxxxxx           |
|                                                          x  xxxxxx           |
|                                                          xxxxxxxxx           |
|                                                          xxxxxxxxx           |
|                                                          xxxxxxxxx           |
|                                                         xxxxxxxxxxxx         |
|                                                         xxxxxxxxxxxx         |
|                                                         xxxxxxxxxxxx         |
|                                                        xxxxxxxxxxxxxx        |
|x                                                       xxxxxxxxxxxxxx        |
|x x                                                     xxxxxxxxxxxxxxx       |
|x x                                                     xxxxxxxxxxxxxxx       |
|x x                                                    xxxxxxxxxxxxxxxxx      |
|xxx                                                 x xxxxxxxxxxxxxxxxxxx     |
|xxx                                                xxxxxxxxxxxxxxxxxxxxxxxxx  |
|xxxxxx xxxx x x x   x xxx xx xxxxx xxx x xxx x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
.------------------------------------------------------------------------------.
 xlib           firefox-fishtank  8298.44 1.53% (829/946)

Starts off reasonably, but quickly deteriorates as the integrated CPU/GPU
overheats and is forced to throttle.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
perf: Rescale the histogram for the terminal

If running ./cairo-perf-print in a terminal, query the terminal size and
rescale the histogram to use the maximum available space.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
perf: Avoid vertically stretching the histogram

If we have more rows than the max_count in any column, we end up
stretching the histogram vertically, which makes it harder to read.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
perf: Remove a debug artifact

Remove the intentional #error for non-UNIX path used to remind me to fix
up configure.ac.

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