]> sourceware.org Git - valgrind.git/log
valgrind.git
20 months agoregtest: add C++11 flag to build of user_histo1.cpp
Paul Floyd [Sat, 22 Apr 2023 07:37:25 +0000 (09:37 +0200)]
regtest: add C++11 flag to build of user_histo1.cpp

For old compilers that don't default to C++11 or later

20 months agoAdd helgrind/tests/garbage.filtered.out to .gitignore
Mark Wielaard [Sat, 22 Apr 2023 01:41:04 +0000 (03:41 +0200)]
Add helgrind/tests/garbage.filtered.out to .gitignore

20 months agoSet version to 3.21.0-RC2
Mark Wielaard [Sat, 22 Apr 2023 01:00:27 +0000 (03:00 +0200)]
Set version to 3.21.0-RC2

20 months agoregtest: dhat/tests/user_histo1 filter out summary
Paul Floyd [Fri, 21 Apr 2023 21:35:37 +0000 (23:35 +0200)]
regtest: dhat/tests/user_histo1 filter out summary

Too system dependent.

20 months agoregtest: add another expected for dhat/tests/user_histo1
Paul Floyd [Fri, 21 Apr 2023 21:17:32 +0000 (23:17 +0200)]
regtest: add another expected for dhat/tests/user_histo1

20 months agoregtest: filter error address from dhat/tests/user_histo1
Paul Floyd [Fri, 21 Apr 2023 21:10:51 +0000 (23:10 +0200)]
regtest: filter error address from dhat/tests/user_histo1

20 months agoAdd missing user_histo1.stdout.exp to EXTRA_DIST
Paul Floyd [Fri, 21 Apr 2023 20:57:09 +0000 (22:57 +0200)]
Add missing user_histo1.stdout.exp to EXTRA_DIST

20 months agoBug 464103 - Enhancement: add a client request to DHAT to mark memory to be histogrammed
Paul Floyd [Fri, 21 Apr 2023 19:21:23 +0000 (21:21 +0200)]
Bug 464103 - Enhancement: add a client request to DHAT to mark memory to be histogrammed

20 months agoAdd use strict and use warnings to perl callgrind scripts
Mark Wielaard [Fri, 21 Apr 2023 16:13:14 +0000 (18:13 +0200)]
Add use strict and use warnings to perl callgrind scripts

This way we can simply use #! /usr/bin/env perl and don't need env -S
and perl -w flags which might confuse some packaging utilities.

20 months agoAdd cachegrind/tests/ann-diff4b-aux/w.rs
Mark Wielaard [Fri, 21 Apr 2023 14:15:15 +0000 (16:15 +0200)]
Add cachegrind/tests/ann-diff4b-aux/w.rs

Missing testfile from commit 1fdf0e728a047f0aab4de805576b6a3a84f37b79
"Add diff and merge capability to `cg_annotate`."

20 months agoFix two xmllint errors.
Nicholas Nethercote [Fri, 21 Apr 2023 13:00:39 +0000 (23:00 +1000)]
Fix two xmllint errors.

20 months agoRewrite Cachegrind docs.
Nicholas Nethercote [Thu, 20 Apr 2023 21:20:11 +0000 (07:20 +1000)]
Rewrite Cachegrind docs.

For all the changes I've made recently. And also various other changes
that occurred over the past 20 years that didn't previously make it into
the docs.

Also, this change de-emphasises the cache and branch simulation aspect,
because they're no longer that useful. Instead it emphasises the
precision and reproducibility of instruction count profiling.

20 months agoUpdate NEWS about recent Cachegrind changes.
Nicholas Nethercote [Thu, 20 Apr 2023 21:06:06 +0000 (07:06 +1000)]
Update NEWS about recent Cachegrind changes.

20 months agoGet rid of cache config warnings with `--cache-sim=no`.
Nicholas Nethercote [Fri, 21 Apr 2023 06:12:33 +0000 (16:12 +1000)]
Get rid of cache config warnings with `--cache-sim=no`.

By not configuring the caches in that case. This requires moving a few
assertions around, because they currently assume that the caches are
configured.

20 months agoTweak printing of `I refs` and `D refs` lines.
Nicholas Nethercote [Thu, 20 Apr 2023 23:33:04 +0000 (09:33 +1000)]
Tweak printing of `I refs` and `D refs` lines.

Because `--cache-sim=no` is the default now, and `I   refs:` looks weird
by itself.

20 months agoReorder options in Cachegrind's `-h` output.
Nicholas Nethercote [Fri, 21 Apr 2023 05:59:39 +0000 (15:59 +1000)]
Reorder options in Cachegrind's `-h` output.

Put the commonly used ones first.

20 months agoAdd diff and merge capability to `cg_annotate`.
Nicholas Nethercote [Wed, 12 Apr 2023 00:02:13 +0000 (10:02 +1000)]
Add diff and merge capability to `cg_annotate`.

And deprecate the use of `cg_diff` and `cg_merge`.

Because `cg_annotate` can do a better job, even annotating source files
when doing diffs in some cases.

The user requests merging by passing multiple cgout files to
`cg_annotate`, and diffing by passing two cgout files to `cg_annotate`
along with `--diff`.

20 months agoBug 397083 - Likely false positive "uninitialised value(s)" for __wmemchr_avx2 and...
Paul Floyd [Thu, 20 Apr 2023 20:11:31 +0000 (22:11 +0200)]
Bug 397083 - Likely false positive "uninitialised value(s)" for __wmemchr_avx2 and __wmemcmp_avx2_movbe

20 months agoAdd 436413 Warn about realloc of size zero to NEWS
Mark Wielaard [Thu, 20 Apr 2023 19:17:46 +0000 (21:17 +0200)]
Add 436413 Warn about realloc of size zero to NEWS

20 months agovgdb --multi: fix various typos, indentation and such (followup)
Mark Wielaard [Thu, 20 Apr 2023 13:04:03 +0000 (15:04 +0200)]
vgdb --multi: fix various typos, indentation and such (followup)

commit 56ccb1e36c4722b56e3e602b986bc45025cb685d missed a few small
fixlets:

- one more comment at the top describing the three usages of vgdb.
- fixed up a few places where tabs were used for indentation (we are
  not very consistent in that either, after the release we'll look
  into adopting something like clang-format so you don't have to do
  all this by hand).
- Add a missing newline in coregrind/m_main.c to make
  none/tests/cmdline2 pass.

20 months agovgdb --multi: fix various typos, indentation and such
Alexandra Hájková [Thu, 20 Apr 2023 12:17:29 +0000 (14:17 +0200)]
vgdb --multi: fix various typos, indentation and such

Remove --launched-with-multi from --help-debug output since it is not
a real user option. Do add a comment in m_main.c explaining the
internal usage.

Add a top-level comment describing the three usages of vgdb.

Fix comment description of decode_hexstring, create_packet,
split_hexdecode.

Consistently use 3 space indention in send_packet and receive_packet
and next_delim_string and split_hexdecode, count_delims,
do_multi_mode.

Fix return type of count_delims to size_t.

Add a note in coregrind/m_gdbserver/server.c to sync qSupported
replies with coregrind/vgdb.c.

Use vgdb (all lowercase) and GDB (all caps) consistently in the
manual.

20 months agovgdb: Handle EAGAIN in read_buf
Mark Wielaard [Thu, 20 Apr 2023 10:59:02 +0000 (12:59 +0200)]
vgdb: Handle EAGAIN in read_buf

The file descriptor is on non-blocking mode and read_buf should only
be called when poll gave us an POLLIN event signaling the file
descriptor is ready for reading from. Still sometimes we do get an
occasional EAGAIN. Just do as told in that case and try to read again.

Also fix an ERROR errno in getpkt. This has never been observed, but
not getting the actual errno if the write fails in that case would be
really confusing.

20 months agogdbserver_tests/hginfo.vgtest: Use --ignore-thread-creation=yes
Mark Wielaard [Wed, 19 Apr 2023 13:53:53 +0000 (15:53 +0200)]
gdbserver_tests/hginfo.vgtest: Use --ignore-thread-creation=yes

The testcase might notice an extra lock created by pthread_create.

https://bugs.kde.org/show_bug.cgi?id=444487

20 months agoBug 439685 compiler warning in callgrind/main.c
Mark Wielaard [Wed, 19 Apr 2023 22:42:40 +0000 (00:42 +0200)]
Bug 439685 compiler warning in callgrind/main.c

main.c: In function 'vgCallgrind_post_syscalltime':
main.c:1779:25: warning: '*((void *)&ts_now+8)'
    may be used uninitialized in this function [-Wmaybe-uninitialized]
     struct vki_timespec ts_now;
main.c:1779:25: warning: 'ts_now'
    may be used uninitialized in this function [-Wmaybe-uninitialized]

In function collect_time the conditional expression in the switch
statement has type int (after integral promotions). GCC assumes that
it may have values other than the ones listed in the enumerated type
it was promoted from.  In that case the memory pointed to by its 1st
argument remains unintialised.  Later on vki_timespec_diff will read
the contents of ts_now undoditionally.  Hence the warning.

Using the default case for the tl_assert () removes the warning and
makes the code more robust should another enumerator ever be added to
Collect_Systime.

Contributed-by: Florian Krohm <florian@eich-krohm.de>
20 months agoEnable getcpu on arm 32
Igor Nunes [Fri, 20 Mar 2020 17:12:13 +0000 (17:12 +0000)]
Enable getcpu on arm 32

https://bugs.kde.org/show_bug.cgi?id=419054

20 months agoPowerPC:, Update test test_isa_3_1_R1_RT.c, test_isa_3_1_R1_XT.c
Carl Love [Wed, 19 Apr 2023 17:45:19 +0000 (13:45 -0400)]
PowerPC:, Update test test_isa_3_1_R1_RT.c, test_isa_3_1_R1_XT.c

The commit:

  commit 20cc0680c3491e062c76605b24e76dc02e16ef47
  Author: Carl Love <cel@us.ibm.com>
  Date:   Mon Apr 17 17:12:25 2023 -0400

      PowerPC:, Fix test test_isa_3_1_R1_RT.c, test_isa_3_1_R1_XT.c

Fixes an issue with the PAD_ORI used in the the tests by explicitly adding
SAVE_REGS and RESTORE_REGS macros.  The macros ensure that the block of
immediate OR instructions don't inadvertently change the contents of the
registers.

John Reiser suggested that the PAD_ORI asm statements in the PAD_ORI
macro be updated to inform the compiler which register the ori instruction
is clobbering.  The compiler will then generate the code to save and
restore the register automatically.  This is a cleaner solution then
explicitly adding the macros to store and restore the registers.  It is
functionally cleaner in that the value fetched by the instruction under
test is not modified by the PAD_ORI instructions.

This patch removes the SAVE_REG and RESTORE_REG macros and updates the
PAD_ORI macro.

20 months agocg_annotate: Remove the `-I`/`--include` option. users/njn/try-rm-I
Nicholas Nethercote [Sun, 16 Apr 2023 23:34:11 +0000 (09:34 +1000)]
cg_annotate: Remove the `-I`/`--include` option.

For much the same reasons that I removed user annotations recently: it's
rarely/never used, and complicates things.

20 months agoBug 468606 - build: remove "Valgrind relies on GCC" check/output
Paul Floyd [Tue, 18 Apr 2023 20:27:55 +0000 (22:27 +0200)]
Bug 468606 - build: remove "Valgrind relies on GCC" check/output

20 months agoPowerPC:, Fix test test_isa_3_1_R1_RT.c, test_isa_3_1_R1_XT.c
Carl Love [Mon, 17 Apr 2023 21:12:25 +0000 (17:12 -0400)]
PowerPC:, Fix test test_isa_3_1_R1_RT.c, test_isa_3_1_R1_XT.c

Test adds a block of xori instructions for use with the PC relative tests.
The registers used by the xori instructions need to be saved and restored,
otherwise the register changes can impact the execution of the for loops
in the test as registers are randomly changed.  The issue occcurs when
GCC is optimizing and inlining the test functions.

20 months agoregtest: try to make the nightly script independent of test times
Paul Floyd [Tue, 18 Apr 2023 19:18:12 +0000 (21:18 +0200)]
regtest: try to make the nightly script independent of test times

20 months agoForgot to add the modified file for 374596
Paul Floyd [Mon, 17 Apr 2023 20:57:39 +0000 (22:57 +0200)]
Forgot to add the modified file for 374596

20 months agoBug 468401 - [PATCH] Add a style file for clang-format
Paul Floyd [Mon, 17 Apr 2023 20:05:30 +0000 (22:05 +0200)]
Bug 468401 - [PATCH] Add a style file for clang-format

Patch submitted by:
Petr Pavlu <petr.pavlu@dagobah.cz>

20 months agoBug 374596 - inconsistent RDTSCP support on x86_64
Paul Floyd [Mon, 17 Apr 2023 19:53:23 +0000 (21:53 +0200)]
Bug 374596 - inconsistent RDTSCP support on x86_64

20 months agoillunmos: fix configure scf_handle_bind check
Paul Floyd [Sun, 16 Apr 2023 12:27:04 +0000 (14:27 +0200)]
illunmos: fix configure scf_handle_bind check

Migration to GCC 10 changes to 64bit load, see
https://github.com/omniosorg/omnios-extra/blob/master/build/valgrind/patches/libscf.patch

20 months agoUse pipe in vgdb if system doesn't have pipe2
Mark Wielaard [Sun, 16 Apr 2023 11:15:03 +0000 (13:15 +0200)]
Use pipe in vgdb if system doesn't have pipe2

Add a configure check for pipe2. If it isn't available use pipe
and fcntl F_SETFD FD_CLOEXEC in vgdb.c.

https://bugs.kde.org/show_bug.cgi?id=468556

20 months agoFixup vgdb --help message
Mark Wielaard [Sat, 15 Apr 2023 23:55:48 +0000 (01:55 +0200)]
Fixup vgdb --help message

The --valgrind and the --vargs were missingin the OPTIONS summary.
A \n was missing after the --vargs description.

20 months agoSet version to 3.21.0-RC1
Mark Wielaard [Sat, 15 Apr 2023 01:49:15 +0000 (03:49 +0200)]
Set version to 3.21.0-RC1

20 months agoAdd bug 467036 Add time cost statistics for Regtest to NEWS
Mark Wielaard [Fri, 14 Apr 2023 23:04:23 +0000 (01:04 +0200)]
Add bug 467036 Add time cost statistics for Regtest to NEWS

20 months agoRegtest: add time cost statistics
Mark Wielaard [Fri, 14 Apr 2023 22:59:26 +0000 (00:59 +0200)]
Regtest: add time cost statistics

Add running time of each (sub) directory in seconds

https://bugs.kde.org/show_bug.cgi?id=467036

Contributed-by: Jojo R <rjiejie@linux.alibaba.com>
20 months agotests fdleak.h close all open file descriptors > 2
Mark Wielaard [Fri, 14 Apr 2023 22:13:57 +0000 (00:13 +0200)]
tests fdleak.h close all open file descriptors > 2

Use sysconf (_SC_OPEN_MAX) to find the upper limit. Or use 1024
if that fails.

https://bugs.kde.org/show_bug.cgi?id=467714

20 months agogdbserver_tests: Improve compatibility of library directory name
Mark Wielaard [Fri, 14 Apr 2023 22:00:36 +0000 (00:00 +0200)]
gdbserver_tests: Improve compatibility of library directory name

Some linux os make softlink from customized directory like lib64xxx
into standard system lib64 directory.

https://bugs.kde.org/show_bug.cgi?id=467839

Contributed-by: JojoR <rjiejie@gmail.com>
20 months agoSupport Linux syscall 434 pidfd_open
Earl Chew [Fri, 14 Apr 2023 20:56:16 +0000 (22:56 +0200)]
Support Linux syscall 434 pidfd_open

20 months agoregtest: add new multi option to cmdline2 help output expecteds
Paul Floyd [Fri, 14 Apr 2023 06:15:40 +0000 (08:15 +0200)]
regtest: add new multi option to cmdline2 help output expecteds

20 months agovgdb: implement the extended-remote protocol
Alexandra Petlanova Hajkova [Thu, 3 Mar 2022 09:46:03 +0000 (04:46 -0500)]
vgdb: implement the extended-remote protocol

Executing vgdb --multi makes vgdb talk the gdb extended-remote
protocol. This means that the gdb run command is supported and
vgdb will start up the program under valgrind. Which means you
don't need to run gdb and valgrind from different terminals.
Also vgdb keeps being connected to gdb after valgrind exits. So
you can easily rerun the program with the same breakpoints in
place.

vgdb now implements a minimal gdbserver that just recognizes
a few extended-remote protocol packets. Once it starts up valgrind
it sets up noack and qsupported then it will forward packets
between gdb and valgrind gdbserver. After valgrind shutsdown it
resumes handling gdb packets itself.

https://bugs.kde.org/show_bug.cgi?id=434057

Co-authored-by: Mark Wielaard <mark@klomp.org>
20 months agoFreeBSD: auxv changes for FreeBSD 13.2
Paul Floyd [Thu, 13 Apr 2023 20:45:46 +0000 (22:45 +0200)]
FreeBSD: auxv changes for FreeBSD 13.2

20 months agoFreeBSD: Helgrind suppression for std::__1::__thread_local_data on FreeBSD 13.2
Paul Floyd [Thu, 13 Apr 2023 20:10:56 +0000 (22:10 +0200)]
FreeBSD: Helgrind suppression for std::__1::__thread_local_data on FreeBSD 13.2

20 months agoregtest: update filter_stanza so that sized_aligned_new_delete_args works on 32bit...
Paul Floyd [Thu, 13 Apr 2023 20:06:34 +0000 (22:06 +0200)]
regtest: update filter_stanza so that sized_aligned_new_delete_args works on 32bit platforms

20 months agoMake `--cache-sim=no` the default for Cachegrind.
Nicholas Nethercote [Tue, 11 Apr 2023 06:42:21 +0000 (16:42 +1000)]
Make `--cache-sim=no` the default for Cachegrind.

Also, don't print cache simulation details in the `desc:` line when the
cache simulation is disabled.

Docs changes are yet to come.

20 months agoOverhaul `cg_annotate` output.
Nicholas Nethercote [Tue, 28 Mar 2023 22:55:51 +0000 (09:55 +1100)]
Overhaul `cg_annotate` output.

Most notable, the "Function summary" section, which printed one CC for each
`file:function` combination, has been replaced by two sections, "File:function
summary" and "Function:file summary".

These new sections both feature "deep CCs", which have an "outer CC" for the
file (or function), and one or more "inner CCs" for the paired functions (or
files).

Here is a file:function example, which helps show which files have a lot of
events, even if those events are spread across a lot of functions.
```
> 12,427,830 (5.4%, 26.3%)  /home/njn/moz/gecko-dev/js/src/ds/LifoAlloc.h:
   6,107,862 (2.7%)           js::frontend::ParseNodeVerifier::visit(js::frontend::ParseNode*)
   3,685,203 (1.6%)           js::detail::BumpChunk::setBump(unsigned char*)
   1,640,591 (0.7%)           js::LifoAlloc::alloc(unsigned long)
     711,008 (0.3%)           js::detail::BumpChunk::assertInvariants()
```
And here is a function:file example, which shows how heavy inlining can result
in a machine code function being derived from source code from multiple files:
```
>  1,343,736 (0.6%, 35.6%)  js::gc::TenuredCell::isMarkedGray() const:
     651,108 (0.3%)           /home/njn/moz/gecko-dev/js/src/d64/dist/include/js/HeapAPI.h
     292,672 (0.1%)           /home/njn/moz/gecko-dev/js/src/gc/Cell.h
     254,854 (0.1%)           /home/njn/moz/gecko-dev/js/src/gc/Heap.h
```
Previously these patterns were very hard to find, and it was easy to overlook a
hot piece of code because its counts were spread across multiple non-adjacent
entries. I have already found these changes very useful for profiling Rust
code.

Also, cumulative percentages on the outer CCs (e.g. the 26.3% and 35.6% in the
example) tell you what fraction of all events are covered by the entries so
far, something I've wanted for a long time.

Some other, related changes:
- Column event headers are now padded with `_`, e.g. `Ir__________`. This makes
  the column/event mapping clearer.
- The "Cachegrind profile" section is now called "Metadata", which is
  shorter and clearer.
- A few minor test tweaks, beyond those required for the output changes.
- I converted some doc comments to normal comments. Not standard Python, but
  nicer to read, and there are no public APIs here.
- Roughly 2x speedups to `cg_annotate` and smaller improvements for `cg_diff`
  and `cg_merge`, due to the following.
  - Change the `Cc` class to a type alias for `list[int]`, to avoid the class
    overhead (sigh).
  - Process event count lines in a single split, instead of a regex
    match + split.
  - Add the `add_cc_to_ccs` function, which does multiple CC additions in a
    single function call.
  - Better handling of dicts while reading input, minimizing lookups.
  - Pre-computing the missing CC string for each CcPrinter, instead of
    regenerating it each time.

20 months agoregtest: warning cleanup
Paul Floyd [Mon, 10 Apr 2023 08:28:58 +0000 (10:28 +0200)]
regtest: warning cleanup

All for clang and mostly Apple clang
There are still numerous deprecated warnings on macOS 10.13
(sem* functions, syscall, sbrk, i386, PIEi, OSSpinLocki, swapcontext, getcontext)

20 months agoImprove `pylintrc`.
Nicholas Nethercote [Wed, 5 Apr 2023 23:25:15 +0000 (09:25 +1000)]
Improve `pylintrc`.

- Move it to `auxprogs/`, alongside `pybuild.sh`.
- Disable the annoying design lints, instead of just modifying the
  values (which often requires modifying them again later).

20 months agoCallgrind: make scripts independent of perl installation path
Paul Floyd [Tue, 4 Apr 2023 06:32:36 +0000 (08:32 +0200)]
Callgrind: make scripts independent of perl installation path

20 months agoAnother minor README change
Paul Floyd [Tue, 4 Apr 2023 06:23:15 +0000 (08:23 +0200)]
Another minor README change

There's only one exp- and seven tools now (not counting
none and lackey).

20 months agocg_annotate: Remove support for user-annotated files.
Nicholas Nethercote [Tue, 28 Mar 2023 20:19:07 +0000 (07:19 +1100)]
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.

20 months agoSome tiny README fixes.
Nicholas Nethercote [Mon, 3 Apr 2023 22:06:41 +0000 (08:06 +1000)]
Some tiny README fixes.

20 months agoDarwin regtest: update strchr filter
Paul Floyd [Sun, 2 Apr 2023 13:28:21 +0000 (15:28 +0200)]
Darwin regtest: update strchr filter

20 months agoDarwin: more suppressions for Darwin 17, and another strchr wrapper
Paul Floyd [Sun, 2 Apr 2023 13:22:54 +0000 (15:22 +0200)]
Darwin: more suppressions for Darwin 17, and another strchr wrapper

20 months agoDarwin: missed removing a couple of delete wrappers
Paul Floyd [Sun, 2 Apr 2023 12:03:14 +0000 (14:03 +0200)]
Darwin: missed removing a couple of delete wrappers

20 months agoDarwin and FreeBSD: new / delete wrappers
Paul Floyd [Sun, 2 Apr 2023 11:43:14 +0000 (13:43 +0200)]
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

20 months agoDarwin: add support for setting errno from alloc wrappers
Paul Floyd [Sun, 2 Apr 2023 09:06:18 +0000 (11:06 +0200)]
Darwin: add support for setting errno from alloc wrappers

20 months agoRegtest: fixes for callgrind tests referring to cachegrind reference files
Paul Floyd [Sun, 2 Apr 2023 08:12:17 +0000 (10:12 +0200)]
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.

20 months agoCommit access and try branches
Mark Wielaard [Sat, 1 Apr 2023 21:58:14 +0000 (23:58 +0200)]
Commit access and try branches

20 months agoDarwin: try to improve posix_memalign / zone_memalign wrapper
Paul Floyd [Sat, 1 Apr 2023 20:28:36 +0000 (22:28 +0200)]
Darwin: try to improve posix_memalign / zone_memalign wrapper

It still doesn't set errno though.

20 months agoDarwin regtest: another test using aligned_alloc
Paul Floyd [Sat, 1 Apr 2023 19:11:58 +0000 (21:11 +0200)]
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.

20 months agoDarwin regtest: fix building on older OS versions
Paul Floyd [Sat, 1 Apr 2023 18:55:22 +0000 (20:55 +0200)]
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.

20 months agoMUSL regtest: fix a comple of build problems building regression tests on Alpine
Paul Floyd [Fri, 31 Mar 2023 11:39:34 +0000 (13:39 +0200)]
MUSL regtest: fix a comple of build problems building regression tests on Alpine

21 months agoRegtest: fix a couple of unused variable warnings
Paul Floyd [Fri, 31 Mar 2023 11:17:10 +0000 (13:17 +0200)]
Regtest: fix a couple of unused variable warnings

Copy & paste leftovers

21 months agoRemove source file added to EXTRA_DIST in error
Paul Floyd [Fri, 31 Mar 2023 10:41:40 +0000 (12:41 +0200)]
Remove source file added to EXTRA_DIST in error

21 months agoAdd missing entries to cachegrind EXTRA_DIST
Paul Floyd [Fri, 31 Mar 2023 10:09:45 +0000 (12:09 +0200)]
Add missing entries to cachegrind EXTRA_DIST

21 months agoPropagate memory allocation failure to out_of_memory_NORETURN
Mark Wielaard [Sun, 22 Jan 2023 22:18:18 +0000 (23:18 +0100)]
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).

21 months agocg_annotate: use `<unspecified>` for an unspecified filename.
Nicholas Nethercote [Tue, 28 Mar 2023 22:15:56 +0000 (09:15 +1100)]
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 `???`).

21 months agocg_annotate.in: fix a small bug in the printing of past-the-end lines.
Nicholas Nethercote [Tue, 28 Mar 2023 06:22:42 +0000 (17:22 +1100)]
cg_annotate.in: fix a small bug in the printing of past-the-end lines.

21 months agoFix some problems in `cachegrind/tests/Makefile.am`.
Nicholas Nethercote [Tue, 28 Mar 2023 05:13:27 +0000 (16:13 +1100)]
Fix some problems in `cachegrind/tests/Makefile.am`.

21 months agoSimpler and more consistent `cachegrind/tests/*.vgtest` files.
Nicholas Nethercote [Tue, 28 Mar 2023 04:44:34 +0000 (15:44 +1100)]
Simpler and more consistent `cachegrind/tests/*.vgtest` files.

- Always use `python3`, never `python`.
- Avoid unnecessary `../cachegrind/` in paths.

21 months agoRewrite `cg_merge` in Python.
Nicholas Nethercote [Mon, 27 Mar 2023 06:27:56 +0000 (17:27 +1100)]
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.

21 months agoRewrite `cg_diff` in Python.
Nicholas Nethercote [Fri, 24 Mar 2023 12:50:49 +0000 (23:50 +1100)]
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`.

21 months agoRename `ann-diff` test as `ann-diff1`.
Nicholas Nethercote [Sun, 26 Mar 2023 23:47:27 +0000 (10:47 +1100)]
Rename `ann-diff` test as `ann-diff1`.

To make room for another test.

21 months agoMake section formatting more consistent.
Nicholas Nethercote [Thu, 23 Mar 2023 08:36:47 +0000 (19:36 +1100)]
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.

21 months agoRename a bunch of `cg_annotate` test files.
Nicholas Nethercote [Thu, 23 Mar 2023 03:04:53 +0000 (14:04 +1100)]
Rename a bunch of `cg_annotate` test files.

For more consistency.

21 months agoSolaris: improve syscall trace for sysfs
Paul Floyd [Sun, 26 Mar 2023 16:21:42 +0000 (18:21 +0200)]
Solaris: improve syscall trace for sysfs

More than just fix the format warning

21 months agoRegtest: put back a glibc version ofr memalign_args test
Paul Floyd [Sun, 26 Mar 2023 15:05:25 +0000 (17:05 +0200)]
Regtest: put back a glibc version ofr memalign_args test

I forgot that glibc aligned_alloc really is memalign, which
changes the callstack.

21 months agoRegtest: add a filter for aligned alloc uninit args tests
Paul Floyd [Sun, 26 Mar 2023 14:37:56 +0000 (16:37 +0200)]
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.

21 months agoSolaris: format warnings in syswrap functions
Paul Floyd [Sun, 26 Mar 2023 08:48:08 +0000 (10:48 +0200)]
Solaris: format warnings in syswrap functions

21 months agoRegtest: clean aligned alloc tests on FreeBSD x86
Paul Floyd [Sat, 25 Mar 2023 18:52:41 +0000 (19:52 +0100)]
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.

21 months agoAdd more annotated/unannotated lines at the end.
Nicholas Nethercote [Tue, 21 Mar 2023 02:58:40 +0000 (13:58 +1100)]
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.

21 months agoChange `Threshold:` to `Thresholds:`.
Nicholas Nethercote [Tue, 21 Mar 2023 00:58:36 +0000 (11:58 +1100)]
Change `Threshold:` to `Thresholds:`.

Because all the thresholds other than the first one were always 100, due
to historical reasons.

21 months agoJust use one decimal place for all percentages.
Nicholas Nethercote [Tue, 21 Mar 2023 00:04:25 +0000 (11:04 +1100)]
Just use one decimal place for all percentages.

Simpler, shorter, and good enough in practice.

21 months agoImprove formatting of percentage columns.
Nicholas Nethercote [Mon, 20 Mar 2023 02:58:04 +0000 (13:58 +1100)]
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%)`

21 months agoMake `cg_annotate` work with Python 3.9, by avoiding `TypeAlias`.
Nicholas Nethercote [Wed, 22 Mar 2023 22:50:21 +0000 (09:50 +1100)]
Make `cg_annotate` work with Python 3.9, by avoiding `TypeAlias`.

21 months agoMake cg_annotate independent of python3 install location
Paul Floyd [Wed, 22 Mar 2023 19:43:30 +0000 (20:43 +0100)]
Make cg_annotate independent of python3 install location

21 months agocachegrind/tests/Makefile.am EXTRA_DIST add ann3.{{post,stderr}.exp,vgtest}
Mark Wielaard [Wed, 22 Mar 2023 10:41:53 +0000 (11:41 +0100)]
cachegrind/tests/Makefile.am EXTRA_DIST add ann3.{{post,stderr}.exp,vgtest}

21 months agoRewrite `cg_annotate` in Python.
Nicholas Nethercote [Thu, 9 Mar 2023 04:41:31 +0000 (15:41 +1100)]
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.

21 months agoSolaris: fix build, another aligned alloc typo
Paul Floyd [Tue, 21 Mar 2023 21:11:11 +0000 (22:11 +0100)]
Solaris: fix build, another aligned alloc typo

21 months agoBug 467482 - Build failure on aarch64 Alpine
Paul Floyd [Fri, 17 Mar 2023 18:48:08 +0000 (19:48 +0100)]
Bug 467482 - Build failure on aarch64 Alpine

Patch submitted by
fanquake@gmail.com

21 months agocoverity: a couple of potential buffer overruns
Paul Floyd [Sun, 12 Mar 2023 10:12:29 +0000 (11:12 +0100)]
coverity: a couple of potential buffer overruns

21 months agocoverity: printf args format mismatch
Paul Floyd [Sun, 12 Mar 2023 08:39:35 +0000 (09:39 +0100)]
coverity: printf args format mismatch

21 months agocoverity: copy paste error
Paul Floyd [Sun, 12 Mar 2023 08:22:10 +0000 (09:22 +0100)]
coverity: copy paste error

21 months agoFreeBSD: fix a syswrap compiler warning
Paul Floyd [Sun, 12 Mar 2023 07:21:55 +0000 (08:21 +0100)]
FreeBSD: fix a syswrap compiler warning

21 months agoregtest: add an s390 expected for sized_aligned_new_delete_args
Paul Floyd [Sun, 12 Mar 2023 07:20:57 +0000 (08:20 +0100)]
regtest: add an s390 expected for sized_aligned_new_delete_args

21 months agodoc: Add asan equivalent to --realloc-zero-bytes-frees to manual-core
Paul Floyd [Sat, 11 Mar 2023 15:47:56 +0000 (16:47 +0100)]
doc: Add asan equivalent to --realloc-zero-bytes-frees to manual-core

This page took 0.062402 seconds and 5 git commands to generate.