]> sourceware.org Git - valgrind.git/log
valgrind.git
19 months agoAdd --with-gdbscripts-dir=PATH configure option
Mark Wielaard [Sun, 14 May 2023 21:34:05 +0000 (23:34 +0200)]
Add --with-gdbscripts-dir=PATH configure option

Currently the gdb valgrind scripts are installed under VG_LIBDIR
which is normally pkglibexecdir which is likely not in the default
gdb safe-path (a list of directories from which it is safe to
auto-load files). So users will have to add the directory to their
.gdbinit file.

This patch adds a --with-gdbscripts-dir=PATH configure option that
sets VG_GDBSCRIPTS_DIR to the given PATH (${libexecdir}/valgrind if
not given). A user can also configure --without-gdbscripts-dir to
disable adding a .debug_gdb_scripts section to the vgpreload library
and installing the valgrind-monitor python scripts completely.

Use VG_GDBSCRIPTS_DIR as gdbscriptsdir to install the valgrind-monitor
python files and pass it with CPPFLAGS when building vg_preloaded.c
and vgdb.c to use instead of VG_LIBDIR.

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

19 months agoAdd epoll_pwait2
Olli Vanhoja [Mon, 10 Oct 2022 09:44:22 +0000 (11:44 +0200)]
Add epoll_pwait2

The only difference between epoll_pwait and epoll_pwait2 is the
timeout argument. For epoll_pwait2 this is a timespec (which is
always 64bit).

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

19 months agoTypo in massif tests Makefile.am
Paul Floyd [Wed, 17 May 2023 06:09:39 +0000 (08:09 +0200)]
Typo in massif tests Makefile.am

20 months agoLinux regtest: fixes for building on musl x86
Paul Floyd [Tue, 16 May 2023 06:20:59 +0000 (08:20 +0200)]
Linux regtest: fixes for building on musl x86

20 months agoDRD: Make libgomp suppression work for any destdir
Paul Floyd [Sat, 13 May 2023 18:44:46 +0000 (20:44 +0200)]
DRD: Make libgomp suppression work for any destdir

20 months agos390x: XC instruction: clear in 8-byte increments if possible
Andreas Arnez [Thu, 26 Jan 2023 16:41:18 +0000 (17:41 +0100)]
s390x: XC instruction: clear in 8-byte increments if possible

The XC instruction is frequently executed in many programs, mainly for
clearing memory.  It can target from 1 to 256 bytes.  If the size is
constant and XC is actually used for clearing memory, Valgrind implements
it as a byte-wise loop and rolls out the loop for <= 8 bytes.

Instead of clearing byte-wise, it is more efficient to clear in 64-bit
increments, so do this for sizes >= 8 bytes.  Roll out the loop for up to
32 bytes.  Overall, this reduces the number of insns by a few percent and
provides a slight performance improvement for some programs.

20 months agos390x: Optimize CLC for 1, 2, 4, and 8 bytes
Andreas Arnez [Fri, 5 May 2023 15:48:31 +0000 (17:48 +0200)]
s390x: Optimize CLC for 1, 2, 4, and 8 bytes

The CLC instruction compares two memory areas with sizes from 1 up to 256
bytes.  Currently Valgrind always implements it with a bytewise loop.

Add special handling for the sizes 1, 2, 4, and 8.  Realize CLC with an
8-, 16-, 32-, and 64-bit integer comparison, respectively, in those cases.
Apart from a slight optimization this also improves the diagnostics for
uninitialized values since it avoids the manufactured conditional jump
that breaks out of the loop over the individual bytes.

20 months agos390x: Update information in README.s390
Andreas Arnez [Tue, 24 Jan 2023 15:11:12 +0000 (16:11 +0100)]
s390x: Update information in README.s390

Refresh some of the information in README.s390:

* update links to Principles of Operation and Reference Summary

* no longer recommend compiling with '-fno-builtin', since there are no
  known false positives due to builtin string operations anymore

* don't mention callgrind as being unsupported, since there are no known
  issues with it

20 months agoBug 465782 - s390x: Avoid __builtin_setjmp
Andreas Arnez [Wed, 15 Feb 2023 17:02:37 +0000 (18:02 +0100)]
Bug 465782 - s390x: Avoid __builtin_setjmp

Currently Clang doesn't support __builtin_setjmp() on s390x.  Since
Valgrind already has an alternate implementation of setjmp/longjmp for
many other platforms, just add one for s390x as well, to get rid of this
dependency.

20 months agoBug 465782 - s390x: Adjust inline assemblies for Clang
Andreas Arnez [Tue, 14 Feb 2023 14:35:48 +0000 (15:35 +0100)]
Bug 465782 - s390x: Adjust inline assemblies for Clang

Some s390x inline assemblies are written in such a way that they are
understood by GCC but not by Clang:

* use of "f" constraint for unsigned long variable

* use of "b" modifier when passing a constant

* use of the register notation "r11" in ".cfi_def_cfa"

Adjust the affected inline assemblies to avoid these constructs.

20 months agoBug 465782 - s390x: Drop -mzarch -march=z900 from assembler options
Andreas Arnez [Thu, 1 Sep 2022 13:03:01 +0000 (15:03 +0200)]
Bug 465782 - s390x: Drop -mzarch -march=z900 from assembler options

The -mzarch flag is unsupported by Clang, and it is redundant on 64-bit
build systems.  Remove it.

Also remove '-march=z900', since it is unsupported by Clang as well.  It
would only be needed on build systems with a default architecture lower
than z900.  Such systems are out of service for some time now.

20 months agomusl: another fix for building testcases
Paul Floyd [Tue, 9 May 2023 20:13:28 +0000 (22:13 +0200)]
musl: another fix for building testcases

20 months agoUpdate libiberty demangler
Mark Wielaard [Tue, 9 May 2023 11:15:26 +0000 (13:15 +0200)]
Update libiberty demangler

Update the libiberty demangler using the auxprogs/update-demangler
script to gcc git commit 1719fa40c4ee4def60a2ce2f27e17f8168cf28ba.

This update includes:

- Update copyright years.
- ansidecl.h (ATTRIBUTE_WARN_UNUSED_RESULT): Add __.
- demangler: Templated lambda demangling
- cp-demangle.h (D_BUILTIN_TYPE_COUNT): Increment.
- cp-demangle.c (cplus_demangle_builtin_types): Add std::bfloat16_t
  entry.
- cp-demangle.c (cplus_demangle_type): Demangle DF16b.
- libiberty: Demangling 'M' prefixes
- libiberty: Demangle variadic template lambdas
- demangle.h (enum demangle_component_type): Add
  DEMANGLE_COMPONENT_EXTENDED_BUILTIN_TYPE.
- demangle.h (struct demangle_component): Add u.s_extended_builtin
  member.
- cp-demangle.c (d_dump): Handle
  DEMANGLE_COMPONENT_EXTENDED_BUILTIN_TYPE.  Don't handle
  DEMANGLE_COMPONENT_FIXED_TYPE.
- cp-demangle.c (d_make_extended_builtin_type): New function.
- cp-demangle.c (cplus_demangle_builtin_types): Add _Float entry.
- cp-demangle.c(cplus_demangle_type): For DF demangle it as _Float<N>
  or _Float<N>x rather than fixed point which conflicts with it.
- cp-demangle.c (d_count_templates_scopes): Handle
  DEMANGLE_COMPONENT_EXTENDED_BUILTIN_TYPE.  Just break; for
  DEMANGLE_COMPONENT_FIXED_TYPE.
- cp-demangle.c (d_find_pack): Handle
  DEMANGLE_COMPONENT_EXTENDED_BUILTIN_TYPE.
  Don't handle DEMANGLE_COMPONENT_FIXED_TYPE.
- cp-demangle.c (d_print_comp_inner): Likewise.
- cp-demangle.h (D_BUILTIN_TYPE_COUNT): Bump.
- rust-demangle.c (demangle_const): Add a missing goto pass_return
  at the end of the function.
- rust-demangle.c (demangle_path_maybe_open_generics): Add
  recursion limit.
- rust-demangle.c (demangle_const): Add recursion limit.
- libiberty: remove FINAL and OVERRIDE from ansidecl.h
- demangler: C++ modules support
- demangler: Reorganize for module demangling
- demangler: Structured Bindings
- Remove non-ANSI C macros in ansidecl.h.
- Remove non-ANSI C path in ansidecl.h.

20 months agoFreeBSD: update auxv test for x86
Paul Floyd [Tue, 9 May 2023 06:42:07 +0000 (08:42 +0200)]
FreeBSD: update auxv test for x86

20 months agoFreeBSD: add Helgrind suppression for getaddrinfo
Paul Floyd [Mon, 8 May 2023 20:27:40 +0000 (22:27 +0200)]
FreeBSD: add Helgrind suppression for getaddrinfo

Testcase was failing on x86

20 months agoregtest: remove FreeBSD version of expected for memcheck memalign_test
Paul Floyd [Sun, 7 May 2023 19:42:21 +0000 (21:42 +0200)]
regtest: remove FreeBSD version of expected for memcheck memalign_test

During recent aligned allocations cleanup, the output became more
consistend and this is no longer needed.

20 months agoregtest: Deactivate tall call optimization in Massif bug469146
Paul Floyd [Sun, 7 May 2023 10:02:54 +0000 (12:02 +0200)]
regtest: Deactivate tall call optimization in Massif bug469146

This optimization truncates the callstack causing fails on some platforms

20 months agoHelgrind Linux: make nss gethostbyname4 suppression cover all variants
Paul Floyd [Sun, 7 May 2023 10:01:06 +0000 (12:01 +0200)]
Helgrind Linux: make nss gethostbyname4 suppression cover all variants

20 months agoLinux Helgrind: broaden _nss_dns_gethostbyname4_r to also cover _nss_files_gethostbyn...
Paul Floyd [Sun, 7 May 2023 08:11:08 +0000 (10:11 +0200)]
Linux Helgrind: broaden _nss_dns_gethostbyname4_r to also cover _nss_files_gethostbyname4_r

20 months agoLinux Helgrind: add another suppression for intermittent failure in dl lookup
Paul Floyd [Sun, 7 May 2023 08:00:48 +0000 (10:00 +0200)]
Linux Helgrind: add another suppression for intermittent failure in dl lookup

20 months agoLinux Helgrind: add suppression for intermittent failure in getaddrinfo regtest
Paul Floyd [Sun, 7 May 2023 07:54:50 +0000 (09:54 +0200)]
Linux Helgrind: add suppression for intermittent failure in getaddrinfo regtest

Causes intermittent failure on gcc110 ppc

20 months agoFreeBSD regtest: add small hack to mcclean_after_fork gdb script
Paul Floyd [Sat, 6 May 2023 11:30:44 +0000 (13:30 +0200)]
FreeBSD regtest: add small hack to mcclean_after_fork gdb script

As far as I can tell this was a regression in FreeBSD gdb around
Aug 2022 when the default install upgraded from 11.2 to 12.1

20 months agoBug 469049 - link failure on ppc64 (big endian) valgrind 3.20
Paul Floyd [Sat, 6 May 2023 05:54:45 +0000 (07:54 +0200)]
Bug 469049 - link failure on ppc64 (big endian) valgrind 3.20

20 months agoBug 469146 - massif --ignore-fn does not ignore inlined functions
Paul Floyd [Sat, 6 May 2023 05:45:47 +0000 (07:45 +0200)]
Bug 469146 - massif --ignore-fn does not ignore inlined functions

20 months agoFreeBSD: deactivate helgrind/tests/tls_threads
Paul Floyd [Sat, 6 May 2023 05:28:51 +0000 (07:28 +0200)]
FreeBSD: deactivate helgrind/tests/tls_threads

No libc tunable, and I haven't seen any way to hack the libc
internals via debuginfo as was previously done on Linux.

20 months agoAdd Helgrind and DRD tests and suppressions for getaddrinfo on Linux
Paul Floyd [Fri, 5 May 2023 20:05:36 +0000 (22:05 +0200)]
Add Helgrind and DRD tests and suppressions for getaddrinfo on Linux

Bump version to 3.22.0.GIT

The testcase was posted on the freebsd-hackers mailing list.
I had time to get suppressions for FreeBSD into 3.21 but
ran out of time for the test and Linux suppressions.

I did take a look at how thread sanitizer handles this.
Basically it intercepts the call, turns off checking,
calls the resl function then turns checking back on.

I don't see many other similar examples. Might be worth
looking at dlopen and atexit.

20 months ago-> 3.21.0 final VALGRIND_3_21_0
Mark Wielaard [Fri, 28 Apr 2023 15:30:04 +0000 (17:30 +0200)]
-> 3.21.0 final

20 months agoAdd bug 469049 (--enable-lto=yes) to known issues
Mark Wielaard [Fri, 28 Apr 2023 15:27:35 +0000 (17:27 +0200)]
Add bug 469049 (--enable-lto=yes) to known issues

20 months agoSupport SCV_FLAG also on VGP_ppc64be_linux
Mark Wielaard [Fri, 28 Apr 2023 11:34:48 +0000 (13:34 +0200)]
Support SCV_FLAG also on VGP_ppc64be_linux

Running on a kernel that supports the SCV instruction (sets
PPC_FEATURE2_SCV in auxv AT_HWCAPS2) valgrind will assert: valgrind:
m_syswrap/syswrap-main.c:549 (getSyscallArgsFromGuestState): Assertion
'gst->guest_syscall_flag == SC_FLAG' failed.

Removing that assert makes most things work. But also filter out
PPC_FEATURE2_SCV from AT_HWCAPS2 for the client, so it shouldn't try
using the SCV instruction.

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

20 months agoOnly do git configuration if in a git repo.
Nicholas Nethercote [Fri, 28 Apr 2023 00:28:30 +0000 (10:28 +1000)]
Only do git configuration if in a git repo.

20 months agodhat: remove initial count value from access count histogram user requests
Paul Floyd [Thu, 27 Apr 2023 07:19:46 +0000 (09:19 +0200)]
dhat: remove initial count value from access count histogram user requests

Based on feedback from Nick Nethercote.

20 months agoFreeBSD: add libc suppressions for Helgrind and DRD
Paul Floyd [Wed, 26 Apr 2023 20:17:16 +0000 (22:17 +0200)]
FreeBSD: add libc suppressions for Helgrind and DRD

20 months agovgdb: Use --wait argument in multi mode
Alexandra Hájková [Tue, 25 Apr 2023 15:28:52 +0000 (17:28 +0200)]
vgdb: Use --wait argument in multi mode

when waiting for valgrind to start.

20 months agoFix typos in NEWS and valgrind-monitor-def.py
Mark Wielaard [Wed, 26 Apr 2023 19:31:13 +0000 (21:31 +0200)]
Fix typos in NEWS and valgrind-monitor-def.py

NEWS: who_point_at -> who_points_at
valgrind-monitor-def.py: MEN -> LEN

20 months agoClarify try push instructions.
Nicholas Nethercote [Wed, 26 Apr 2023 07:00:32 +0000 (17:00 +1000)]
Clarify try push instructions.

20 months agoAdd a .git-blame-ignore-revs file.
Nicholas Nethercote [Wed, 26 Apr 2023 06:11:26 +0000 (16:11 +1000)]
Add a .git-blame-ignore-revs file.

This prevents large-scale changes (e.g. auto-formatting) from negatively
affecting `git blame`.

20 months agoAdd new DHAT userreqs to NEWS
Paul Floyd [Tue, 25 Apr 2023 05:36:10 +0000 (07:36 +0200)]
Add new DHAT userreqs to NEWS

20 months agoFix spelling in NEWS
Paul Floyd [Mon, 24 Apr 2023 18:56:16 +0000 (20:56 +0200)]
Fix spelling in NEWS

20 months agoAdd memfd_create.stderr.exp-fcntl64 to EXTRA_DIST
Paul Floyd [Mon, 24 Apr 2023 18:53:13 +0000 (20:53 +0200)]
Add memfd_create.stderr.exp-fcntl64 to EXTRA_DIST

20 months agoAdd a memfd_create.stderr.exp-fcntl64 variant
Mark Wielaard [Mon, 24 Apr 2023 12:35:21 +0000 (14:35 +0200)]
Add a memfd_create.stderr.exp-fcntl64 variant

On 32bit systems a glibc fcntl call results in a fcntl64 syscall.

20 months agosolaris: aligned allocation issues
Paul Floyd [Sun, 23 Apr 2023 11:51:37 +0000 (13:51 +0200)]
solaris: aligned allocation issues

Solaris 11.3 doesn't have aligned_alloc - add a configure time test
memalign does not accept either a size or an alignment of zero

20 months agovgdb: Always check the result from asprintf and write calls
Mark Wielaard [Sat, 22 Apr 2023 16:02:25 +0000 (18:02 +0200)]
vgdb: Always check the result from asprintf and write calls

20 months agoTypo in NEWS
Paul Floyd [Sat, 22 Apr 2023 14:31:45 +0000 (16:31 +0200)]
Typo in NEWS

(Try again, without a ton of changes from testing clang-format)

Thanks Tobias, on valgrind-developers

20 months agoRevert "Typo in NEWS"
Paul Floyd [Sat, 22 Apr 2023 14:29:27 +0000 (16:29 +0200)]
Revert "Typo in NEWS"

This reverts commit bf347551c99313a4af9c38bdeda9b946c9795945.

20 months agoTypo in NEWS
Paul Floyd [Sat, 22 Apr 2023 14:08:28 +0000 (16:08 +0200)]
Typo in NEWS

Thanks Tobias, on valgrind-developers

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

21 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.

21 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

21 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

21 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>
21 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

21 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>
21 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

21 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

21 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>
21 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

21 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

21 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

21 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.

21 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.

21 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)

21 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).

21 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

21 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).

21 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.

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

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