summaryrefslogtreecommitdiff
path: root/perf
Commit message (Collapse)AuthorAgeFilesLines
* Avoid misuse of ctype(3) functionsTaylor R Campbell2023-03-292-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ctype(3) character classification and mapping functions have a peculiarly limited definition (C11, Sec. 7.4 `Character handling <ctype.h>', p. 200): `The header <ctype.h> declares several functions useful for classifying and mapping characters. In all cases the argument is an int, the value of which shall be representable as an unsigned char or shall equal the value of the macro EOF. If the argument has any other value, the behavior is undefined.' In other words, in the most common case of 8-bit char and EOF = -1, the domain of the 257 allowed arguments is: -1, 0, 1, 2, ..., 254, 255 The ctype(3) functions are designed for use with stdio functions like getchar and fgetc which return int values in the same domain. In an ABI where char is signed (e.g., x86 SysV ABI used by most Unixish operating systems), passing an argument of type char as is can go wrong in two ways: 1. The value of a non-EOF input octet interpreted as `char' may coincide, as an integer, with the value of EOF, leading to wrong answers for some non-EOF inputs. E.g., if EOF = 1, and an input octet has all bits set, i.e., 255 as an unsigned char, then as a char the value is -1, which will be confused with EOF. In the ISO-8859-1 locale, the code point 255 is (in Unicode terminology) LATIN SMALL LETTER Y WITH DIAERESIS, for which isprint, isalpha, &c., are true. But isprint, isalpha, &c., are false for EOF. So if char *s points to a string with that character, isprint(*s) will return false when it should return true. 2. Passing a negative char whose value does not coincide with EOF is undefined behaviour. This isn't purely theoretical: often the functions are implemented by an array lookup, #define isprint(c) (ctypetab[c] & ISPRINT). If c is out of range (e.g., 192, ISO-8859-1 for LATIN CAPITAL LETTER A WITH GRAVE, which convers to (signed) char as -64), then you can get garbage answers by reading uninitialized memory or application crashes with SIGSEGV if the page preceding the table is unmapped. If what you have is an arbitrary char (e.g., from a char * string pointing at user input), then the only correct way to use the ctype(3) functions is by converting to unsigned char first -- e.g., isprint((unsigned char)*s). (If the functions were defined as macros that convert to unsigned char first, they would then spuriously interpret EOF as a non-EOF, so they can't do that themselves.) It is possible, in some cases, to prove that the input always actually lies in {0, 1, 2, ..., 127}, so the conversion to unsigned char is not necessary. I didn't check whether this was the case -- it's safer to just adopt the habit of always casting char to unsigned char first before using the ctype(3) macros, which satisfies a compiler warning on some systems designed to detect this class of application errors at compile-time.
* Merge branch 'patch-1' into 'master'Uli Schlachter2023-03-261-88/+0
|\ | | | | | | | | Delete cairo/perf/make-html.py See merge request cairo/cairo!448
| * Delete cairo/perf/make-html.py Christian Clauss2023-02-051-88/+0
| | | | | | | | | | | | | | This file has not been updated in 13 years and does not correspond to the current implementation of cairo perf. The code is in Python 2 and will generate syntax errors on current versions of Python. See !7 and !357
* | Fix -WuninitializedKhaled Hosny2023-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | ../perf/cairo-perf-chart.c:232:4: warning: variable 'sum' is uninitialized when used here [-Wuninitialized] sum += v/100; ^~~ ../perf/cairo-perf-chart.c:142:43: note: initialize the variable 'sum' to silence this warning double slow_sum = 0, fast_sum = 0, sum; ^ = 0.0
* | perf: Disable deprecation warnings for the perf widgetEmmanuele Bassi2023-02-022-0/+4
| | | | | | | | | | | | | | We're using an EOL version of GTK; we know we are using deprecated API. Until somebody shows up with a replacement, or until we drop the perf widget, we should avoid unnecessary compiler warnings.
* | Defining Windows version macros in meson.buildFujii Hironori2023-01-132-2/+0
| | | | | | | | | | | | | | | | | | WINVER and _WIN32_WINNT macros were defined in each source files and headers that were including <windows.h>. However, because DirectWrite requires new Windows API, some files included <windows.h> without the version macros. This inconsistency sometimes caused troubles. Define the version macros in meson.build.
* | Remove autotools buildAdrian Johnson2023-01-086-349/+0
| |
* | perf: fix compilation on Win32Luca Bacci2022-10-281-1/+12
|/
* Replace use of ctype functions with internal version where only ASCII chars ↵Adrian Johnson2022-04-091-1/+2
| | | | | | | | | are used In !309 Taylor R Campbell found a number of instances of ctype incorrectly passed a signed char. In many cases, where only ASCII characters are used, the code should have been using the cairo version of the ctype function to avoid locale issues.
* Drop OS/2 supportEmmanuele Bassi2022-02-251-7/+2
| | | | | | | OS/2 support was last built in Cairo 1.12, which was released 10 years ago. Additionally, OS/2 is not supported by Meson.
* Fix some warningsAdrian Johnson2021-08-221-2/+0
|
* Fix some win32 compile warningsAdrian Johnson2021-07-251-0/+5
|
* Fix the meson buildUli Schlachter2021-06-172-25/+29
| | | | | | | | | | | | | | | I merged two MRs and broke the build: - One MR added perf/ to the meson build - The second MR changed lots of meson code to just dependency objects instead of just "messing" with include directories and library objects The result was that perf/meson.build now referred to include objects and library objects that no longer exist. Fix this by also using dependency objects in perf/. Signed-off-by: Uli Schlachter <psychon@znc.in>
* meson: Add perf/ directoryUli Schlachter2021-05-152-0/+150
| | | | | | | This adds the code under perf/ to meson. The only testing I did was "it builds for me". I do not have gtk+2 installed and so I did not even try whether that thing builds. Besides that, I mostly tried to stay close to the autofoo build.
* Drop the conditional inclusion of config.hEmmanuele Bassi2021-05-011-2/+0
| | | | | | | | | | | | We *always* generate this file, and we depend on its existence. The idea behind HAVE_CONFIG_H was being able to include random files from different projects, back in a time where "libraries" were literally just random files instead of actual shared objects. Since we're not in the '80s any more, and our build system(s) define HAVE_CONFIG_H *and* generate the config.h header file, we don't need a conditional guard around its inclusion.
* Remove stray _GNU_SOURCE definitionsEmmanuele Bassi2021-05-014-7/+5
| | | | | | We define _GNU_SOURCE globally in both the Autotools build, through the use of the AC_USE_SYSTEM_EXTENSIONS macro; and in the Meson build, with add_project_arguments().
* Retire dummy cairo-version.h header to fix meson subproject buildTim-Philipp Müller2020-09-293-6/+0
| | | | | | | | | | | | | | It was originally added to make bisecting easier, but has outlived its usefuleness now. Going forward we'll have just a single cairo-version.h header file, the one with the real version numbers. This is needed to fix the case where cairo is being built as a Meson subproject, but also simplifies things in general. Fixes #421
* Misc. typosluz.paz2019-01-311-1/+1
| | | | | | | Found via `codespell -i 3 -w -I ../cairo-word-whitelist.txt -L tim,ned,uint` Follow up of 12cb59be7da Reviewed-by: Bryce Harrington <bryce@bryceharrington.org>
* Add support for RGBA128F and RGB96F formats.Maarten Lankhorst2019-01-072-0/+4
| | | | | | | | | | | | | | IGT wants to add support for planes with a bit depth >10, which requires a higher precision format than we have currently. I'm using RGBA as format, because of its existence in OpenGL. With the new formats we can directly convert our bytes to half float, or multiply a colro vector with a matrix to go to the Y'CbCr colorspace. This requires pixman 0.36.0, so bump the version requirement. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Bryce Harrington <bryce@bryceharrington.org>
* Use HTTPS URLs for freedesktop.org domainsPaul Menzel2018-10-161-1/+1
| | | | | | | | Run the command below suggested by geirha in ##sed@irc.freenode.net. git grep -l 'http://.*freedesktop.org' | xargs sed -i 's|http\(://\([[:alnum:].-]*\.\)\{0,1\}freedesktop\.org\)|https\1|g' Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
* Cairo trivial typosUnknown2018-04-022-2/+2
| | | | | | | | | | | | | Found using `codespell -q 3 -I cairo-whitelist.txt` whereby whitelist contained: ``` amin iff lod writen ``` Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* perf: fix include order for AIX, bug#89354Michael Haubenwallner2015-03-051-1/+1
|
* perf/micro: fix include order for AIX, bug#89354Michael Haubenwallner2015-03-054-4/+4
|
* define _GETDELIM for getline() on AIXMichael Haubenwallner2015-03-051-0/+2
| | | | | | | | | On AIX 6.1, getdelim() and getline() are not provided by default, causing a gcc compilation error. With _GETDELIM defined, AIX's stdio.h header provides definitions for these routines. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=89356 Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* Refactor ARRAY_LENGTH macro definitions in test codeBryce Harrington2014-11-201-4/+0
|
* test: Selective execution of Cairo tests based on FORMAT optionRavi Nanjundappa2014-08-141-1/+2
| | | | | | | | | | | | | | | | Added a new command line option FORMAT which can take rgb and/or rgba values which enables the execution of tests only for the given FORMAT For ex: (1). CAIRO_TESTS="zero-alpha" make test TARGETS=ps2,image FORMAT=rgba,rgb This command runs the zero-alpha test for both ps2 and image backends with argb32 and rgb24 content formats. (2). CAIRO_TESTS="zero-alpha" make test TARGETS=ps2,image FORMAT=rgba This command runs the zero-alpha test for both ps2 and image backends with argb32 content format and so on. Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
* perf: Refactor some macros to cairo-perf.hRavi Nanjundappa2014-04-221-1/+0
| | | | | | | | | This commit covers one of the left out modifications from "commit cd11a4ff0421fd293279b202be800550890574bb" by Bryce. It removes the duplicate macro definition in cairo-perf-diff-files.c which by default includes the cairo-perf.h having MAX macro defnition. Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
* perf: Refactor some common macros to cairo-perf.hBryce Harrington2014-04-187-20/+17
| | | | | | | | These macros are standard in src's cairoint.h and test's cairo-test.h internal header files, so for consistency do the same thing with perf's cairo-perf.h. Reviewed-by: Uli Schlachter <psychon@znc.in>
* perf: Guarantee path width is non-negativeBryce Harrington2014-02-251-2/+2
| | | | | | | | | | | | This quells the following warning: perf/micro/hatching.c:39:5: warning: cannot optimize loop, the loop counter may overflow Width and height aren't going to be negative so enforce it so that the compiler can do whatever optimization it wants to do. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
* perf: Move macro-benchmark documentation to cairo-tracesBryce W. Harrington2013-08-111-69/+20
| | | | | | | | | | | The macro benchmarks were moved to a separate repository some time ago, but the perf README still refers to these tests as if they were still present, which may lead to some confusion. Instead, consolodate the macro benchmark documentation with the macro benchmarks, and focus this README on just the (still in tree) micro-benchmarks. Signed-off-by: Bryce Harrington <b.harrington@samsung.com> Signed-off-by: Uli Schlachter <psychon@znc.in>
* cairo-perf-print: Do not free the uninitialised histogramChris Wilson2013-06-211-1/+2
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* perf: Remove a debug artifactChris Wilson2013-06-111-1/+0
| | | | | | | 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>
* perf: Avoid vertically stretching the histogramChris Wilson2013-06-111-3/+6
| | | | | | | 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: Rescale the histogram for the terminalChris Wilson2013-06-111-2/+35
| | | | | | | 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: Rudimentary histogram printing for cairo-perf-printChris Wilson2013-06-115-17/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Iteratively prune outliersChris Wilson2013-04-021-18/+23
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Adding a simple usage statement to cairo-perf-chartMatthew Fischer2013-03-181-0/+29
| | | | Signed-off-by: Uli Schlachter <psychon@znc.in>
* perf: Synchronize before stopping the timersChris Wilson2013-01-311-0/+3
| | | | | | | | | | | | | | | | Fixes a regression from commit 2855ff4666922f2c38505414270d47f659b0d499 Author: Andrea Canciani <ranma42@gmail.com> Date: Wed Aug 31 16:42:03 2011 +0200 perf: Reuse cairo-time which dropped the essential call to synchronize when refactoring the code. Reported-by: Siarhei Siamashka <siarhei.siamashka@gmail.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* perf; Do not allow the backends to optimize away the clear before syncChris Wilson2013-01-281-3/+7
| | | | | | | | | | The importance of writing to the scratch surface before retrieving an image is that it makes that the write lands in the server queue, as well as the GetImage, in order to serialise the timer against all the operations. Reported-by: Siarhei Siamashka <siarhei.siamashka@gmail.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* script: Attempt to decompress images in placeChris Wilson2013-01-081-1/+15
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* perf/chart: Contract the default output filenamesChris Wilson2012-12-291-3/+1
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* perf/chart: Show the geometric average as an extra columnChris Wilson2012-12-291-1/+111
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* perf/chart: Render a solid bar if the column is too narrow for the gradientChris Wilson2012-07-121-22/+31
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* doc: fix a few typos found by codespellNis Martensen2012-03-101-2/+2
| | | | Signed-off-by: Uli Schlachter <psychon@znc.in>
* perf: Don't use a boolean value as integerAndrea Canciani2012-02-201-3/+7
| | | | | | | | | | | Although in this case the boolean values are guaranteed to be 1/0, using them as true/false (in an if condition) seems much saner than using them to limit the number of iterations on a for loop. Fixes: cairo-perf-micro.c:221:5: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
* perf/chart: Make the columns transculent so that the label behind is visibleChris Wilson2012-01-111-4/+44
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* perf/chart: Show values next to the column if too small to fit insideChris Wilson2012-01-111-6/+14
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* perf/chart: Tweak labels on right not to fall off the edgeChris Wilson2012-01-112-8/+9
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* perf: Compile fix, add the index to cairo_perf_report_load()Chris Wilson2011-11-182-2/+2
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Use xstrdup instead of xmalloc when possibleAndrea Canciani2011-11-121-4/+2
| | | | Don't open code xstrdup, just use it.