17396 Commits

Author SHA1 Message Date
Paul Floyd
1db98dbdb1 Callgrind: make scripts independent of perl installation path 2023-04-04 08:32:36 +02:00
Paul Floyd
4e3439f28d Another minor README change
There's only one exp- and seven tools now (not counting
none and lackey).
2023-04-04 08:23:15 +02:00
Nicholas Nethercote
004ba8c0da cg_annotate: Remove support for user-annotated files.
They're of little use, and removing them opens the possibility of adding
`cg_merge`'s profile-merging functionality into `cg_annotate` itself.
2023-04-04 12:12:48 +10:00
Nicholas Nethercote
3d0d7a1924 Some tiny README fixes. 2023-04-04 08:06:41 +10:00
Paul Floyd
0641a27ffb Darwin regtest: update strchr filter 2023-04-02 15:28:21 +02:00
Paul Floyd
b32875d20c Darwin: more suppressions for Darwin 17, and another strchr wrapper 2023-04-02 15:22:54 +02:00
Paul Floyd
28a164761f Darwin: missed removing a couple of delete wrappers 2023-04-02 14:05:40 +02:00
Paul Floyd
e27f24c165 Darwin and FreeBSD: new / delete wrappers
A few typos in the FreeBSD soname wrappers
Many missing Darwin wrappers
And no need to repeat that GNU mangling is used
2023-04-02 13:43:14 +02:00
Paul Floyd
421693f432 Darwin: add support for setting errno from alloc wrappers 2023-04-02 11:06:18 +02:00
Paul Floyd
708d0eb6b4 Regtest: fixes for callgrind tests referring to cachegrind reference files
cachegrind/tests/cgout-test was renamed to ann1.cgout but the
two tests in callgrind that use it weren't updated.
2023-04-02 10:12:17 +02:00
Mark Wielaard
03e36bc36e Commit access and try branches 2023-04-01 23:58:20 +02:00
Paul Floyd
3f4052623c Darwin: try to improve posix_memalign / zone_memalign wrapper
It still doesn't set errno though.
2023-04-01 22:28:36 +02:00
Paul Floyd
e105ce0d8f Darwin regtest: another test using aligned_alloc
I added this test because I wanted to check the behaviour of
aligned_alloc on current macOS, but Valgrind doesn't support it
yet.
2023-04-01 21:11:58 +02:00
Paul Floyd
abf513febd Darwin regtest: fix building on older OS versions
aligned_alloc was added to macOS 10.15 and 10.13 is the latest
that we support.
2023-04-01 20:55:22 +02:00
Paul Floyd
81e51f9469 MUSL regtest: fix a comple of build problems building regression tests on Alpine 2023-03-31 13:39:34 +02:00
Paul Floyd
37edf8fbda Regtest: fix a couple of unused variable warnings
Copy & paste leftovers
2023-03-31 13:17:10 +02:00
Paul Floyd
78d0dc51c0 Remove source file added to EXTRA_DIST in error 2023-03-31 12:41:40 +02:00
Paul Floyd
3c0405a63d Add missing entries to cachegrind EXTRA_DIST 2023-03-31 12:09:45 +02:00
Mark Wielaard
f32cc294e3 Propagate memory allocation failure to out_of_memory_NORETURN
Provide the user with a hint of what caused an out of memory error.
And explain that some memory policies, like selinux deny_execmem
might cause Permission denied errors.

Add an err argument to out_of_memory_NORETURN. And change
am_shadow_alloc to return a SysRes (all three callers were already
checking for errors and calling out_of_memory_NORETURN).
2023-03-31 01:31:25 +02:00
Nicholas Nethercote
2d97182f0d cg_annotate: use <unspecified> for an unspecified filename.
Users shouldn't ever see this, but it's useful to distinguish this
malformed data file case from the missing symbol case (which is still
shown as `???`).
2023-03-29 09:15:56 +11:00
Nicholas Nethercote
6436be0a3f cg_annotate.in: fix a small bug in the printing of past-the-end lines. 2023-03-28 17:22:42 +11:00
Nicholas Nethercote
ca44cbbd7b Fix some problems in cachegrind/tests/Makefile.am. 2023-03-28 16:30:01 +11:00
Nicholas Nethercote
e95328b12c Simpler and more consistent cachegrind/tests/*.vgtest files.
- Always use `python3`, never `python`.
- Avoid unnecessary `../cachegrind/` in paths.
2023-03-28 15:44:34 +11:00
Nicholas Nethercote
551874920f Rewrite cg_merge in Python.
It's currently written in C, but `cg_annotate` and `cg_diff` are written in
Python. It's better to have them all in the same language.

The good news is that the Python code is 4.5x shorter than the C code.
The bad news is that the Python code is roughly 3x slower than the C
code. But `cg_merge` isn't used that often, so I think it's a reasonable
trade-off.
2023-03-28 14:54:27 +11:00
Nicholas Nethercote
8a75eecbad Rewrite cg_diff in Python.
For all the same reasons I rewrote `cg_annotate` in Python.

The commit also moves the Python "build" steps into
`auxprogs/pybuild.sh`, for easy sharing.

Finally, it very slightly tweaks the whitespace in the output of
`cg_annotate`.
2023-03-28 14:54:25 +11:00
Nicholas Nethercote
29d1f00e20 Rename ann-diff test as ann-diff1.
To make room for another test.
2023-03-27 11:03:45 +11:00
Nicholas Nethercote
3f1bbe12fe Make section formatting more consistent.
- Every section now has a heading with the long `----` lines above and
  below.
- Event names are always shown below that heading, rather than within
  it.
- Each Unreadable file now gets its own section, much like files that
  lack any data.
2023-03-27 09:01:38 +11:00
Nicholas Nethercote
d7081e936e Rename a bunch of cg_annotate test files.
For more consistency.
2023-03-27 08:52:28 +11:00
Paul Floyd
c7e01d28b4 Solaris: improve syscall trace for sysfs
More than just fix the format warning
2023-03-26 18:21:42 +02:00
Paul Floyd
5fd3b8947e Regtest: put back a glibc version ofr memalign_args test
I forgot that glibc aligned_alloc really is memalign, which
changes the callstack.
2023-03-26 17:05:25 +02:00
Paul Floyd
95ac41bc58 Regtest: add a filter for aligned alloc uninit args tests
These tests generate a varying number of errors per argument
depending on the platform and compiler.

The filter just prints the first unique error stanza which
allows 8 expecteds to be removed.
2023-03-26 16:37:56 +02:00
Paul Floyd
6bbe320a1a Solaris: format warnings in syswrap functions 2023-03-26 10:48:08 +02:00
Paul Floyd
3eaac58827 Regtest: clean aligned alloc tests on FreeBSD x86
Add a filter for size_t (unsigned long on 64bit platforms and unsigned
int on 32bit ones).

Add another expected for x86.
2023-03-25 19:52:41 +01:00
Nicholas Nethercote
179fc84ba7 Add more annotated/unannotated lines at the end.
This way, all CCs are categorised, which is useful for understanding
why thing were/weren't annotated.
2023-03-23 13:20:44 +11:00
Nicholas Nethercote
05d01cd681 Change Threshold: to Thresholds:.
Because all the thresholds other than the first one were always 100, due
to historical reasons.
2023-03-23 13:00:17 +11:00
Nicholas Nethercote
3f8494c8a4 Just use one decimal place for all percentages.
Simpler, shorter, and good enough in practice.
2023-03-23 13:00:17 +11:00
Nicholas Nethercote
b8a90ee968 Improve formatting of percentage columns.
Currently their width is mostly hard-wired in a quick and dirty fashion.
This commit does them properly, so:
- all columns are always the right width, even ones with really large
  percentages
- things like `( 1.00%)` are now `(1.00%)`
- any percentages that would involve a division by zero now show as
  `(n/a)` rather than `( 0.00%)`
2023-03-23 13:00:17 +11:00
Nicholas Nethercote
e9e7b663fb Make cg_annotate work with Python 3.9, by avoiding TypeAlias. 2023-03-23 09:50:21 +11:00
Paul Floyd
bb35cd572f Make cg_annotate independent of python3 install location 2023-03-22 20:43:30 +01:00
Mark Wielaard
3bb907290a cachegrind/tests/Makefile.am EXTRA_DIST add ann3.{{post,stderr}.exp,vgtest} 2023-03-22 11:41:53 +01:00
Nicholas Nethercote
4650b7949a Rewrite cg_annotate in Python.
Perl was a reasonable choice for `cg_annotate` in 2002, but not in 2023.
Also, the existing structure of the code is not good. These two things
make it hard to modify `cg_annotate` in any significant way.

Benefits of the change:
- Now written in a language that is (a) nice, and (b) not moribund.
- Easier to maintain, due to (a) abovementioned better language, (b)
  better code structure, and (c) better language tooling, such as
  formatters, type checkers, and linters.
- The new version is a little shorter.
- It runs about 2x faster.
- Argument handling is more standard. E.g. things like `--context 2`,
  `--auto`, `--no-auto` are supported. (The old forms that require `=`
  are still supported, though the `=yes`/`=no` forms are deprecated.)

The behaviour and output of the new version is identical for typical
uses, but there are some very minor changes for edge cases, which nobody
is likely to notice. For example:
- The file format is slightly changed: I removed support for '.'
  counts, which had the same meaning as '0'. This was a feature that
  Cachegrind never used, and the old script handled it inconsistently.
- The new version will abort on a malformed data line. The old version
  would just print a warning and continue.

The commit also adds a new test `ann3` that tests many parts of
`cg_annotate` that weren't tested previously, and tweaks the existing
`ann2` test.
2023-03-22 10:12:27 +11:00
Paul Floyd
394fa9223a Solaris: fix build, another aligned alloc typo 2023-03-21 22:11:11 +01:00
Paul Floyd
022a9caf40 Bug 467482 - Build failure on aarch64 Alpine
Patch submitted by
	fanquake@gmail.com
2023-03-17 19:48:08 +01:00
Paul Floyd
50f6533612 coverity: a couple of potential buffer overruns 2023-03-12 11:12:29 +01:00
Paul Floyd
d3a49926ad coverity: printf args format mismatch 2023-03-12 09:39:35 +01:00
Paul Floyd
18c278f386 coverity: copy paste error 2023-03-12 09:22:10 +01:00
Paul Floyd
a1bb70bbf1 FreeBSD: fix a syswrap compiler warning 2023-03-12 08:21:55 +01:00
Paul Floyd
8532c8b5e4 regtest: add an s390 expected for sized_aligned_new_delete_args 2023-03-12 08:20:57 +01:00
Paul Floyd
96a66dfda6 doc: Add asan equivalent to --realloc-zero-bytes-frees to manual-core 2023-03-11 16:47:56 +01:00
Paul Floyd
036bf06734 Refactor: reorder a few structs to make them more compact
Used pahole to find candidates. Don't have any performance
measurements, but it won't do any harm.
2023-03-11 16:31:43 +01:00