157 Commits

Author SHA1 Message Date
Mark Wielaard
6effd73e90 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
2023-04-20 12:46:55 +02:00
Mark Wielaard
fb6fbe4e84 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>
2023-04-15 00:00:36 +02:00
Paul Floyd
a8e350c6d1 GDB regtest: add filter for gdb python load, RHEL 7.4 ARM 2023-02-02 21:51:21 +01:00
Paul Floyd
45c61d598f Illumos: regtest filters and gitignore
Filter for the gdb python autoload warnings
Filter for another variation of shell abort messages
2023-01-28 18:27:16 +01:00
Mark Wielaard
c5d52a4056 gdbserver tests filter out uninstalled python scripts warnings
Filter out loading error messages when python scripts haven't
been installed yet (running against vg-in-place)
2023-01-11 15:45:32 +01:00
Philippe Waroquiers
e41dff2999 Fix gdbserver tests failing when python code cannot be autoloaded.
If the valgrind python code loading is not authorised by GDB config,
ensure the related error messages and info messages are filtered.
2023-01-10 00:28:38 +01:00
Philippe Waroquiers
39a063513c Implement front end GDB commands for Valgrind gdbserver monitor commands.
This commit implements in python a set of GDB commands corresponding to the
Valgrind gdbserver monitor commands.

Basically, the idea is that one GDB command is defined for each valgrind
gdbserver subcommand and will generate and send a monitor command to valgrind.

The python code is auto-loaded by GDB as soon as GDB observes that the valgrind
preload core shared lib is loaded (e.g. vgpreload_core-amd64-linux.so).
This automatic loading is done thanks to the .debug_gdb_scripts section
added in vg_preloaded.c file.

Sadly, the auto-load only happens once valgrind has started to execute the code
of ld that loads this vg_preload file.

I have tried 2 approaches to have the python code auto-loaded when attaching at
startup to valgrind:
  * have valgrind gdbserver reporting first to GDB that the executable file is
    the tool executable (with a .debug_gdb_scripts section) and then reporting
    the real (guest) executable file.
    The drawback of this approach is that it triggers a warning/question in GDB
    according to the GDB setting 'set exec-file-mismatch'.
  * have valgrind gdbserver pretending to be multiprocess enabled, and report
    a fake process using the tool executable with a .debug_gdb_scripts section.
    The drawback of this is that this always creates a second inferior in GDB,
    which will be confusing.

Possibly, we might complete the below message :
  ==2984378== (action at startup) vgdb me ...
  ==2984378==
  ==2984378== TO DEBUG THIS PROCESS USING GDB: start GDB like this
  ==2984378==   /path/to/gdb /home/philippe/valgrind/littleprogs/some_mem
  ==2984378== and then give GDB the following command
  ==2984378==   target remote | /home/philippe/valgrind/git/improve/Inst/libexec/valgrind/../../bin/vgdb --pid=2984378
  ==2984378== --pid is optional if only one valgrind process is running

with:
  ==2984378== GDB valgrind python specific commands will be auto-loaded when execution begins.
  ==2984378== Alternatively, you might load it before with the GDB command:
  ==2984378==   source /abs/path/to/valgrind/install/libexec/valgrind/valgrind-monitor.py

The following GDB setting traces the monitor commands sent by a GDB valgrind
command to the valgrind gdbserver:
  set debug valgrind-execute-monitor on

How to use the new GDB valgrind commands?
-----------------------------------------

The usage of the GDB front end commands is compatible with the
monitor command as accepted today by Valgrind.

For example, the memcheck monitor command "xb' has the following usage:
 xb <addr> [<len>]

With some piece of code:
   'char some_mem [5];'
xb can be used the following way:
  (gdb) print &some_mem
  (gdb) $2 = (char (*)[5]) 0x1ffefffe8b
  (gdb) monitor xb 0x1ffefffe8b 5
  		    ff	  ff	  ff	  ff	  ff
  0x4A43040:	  0x00	0x00	0x00	0x00	0x00
  (gdb)

The same action can be done with the new GDB 'memcheck xb' command:
  (gdb) memcheck xb 0x1ffefffe8b 5
  		    ff	  ff	  ff	  ff	  ff
  0x1FFEFFFE8B:	  0x00	0x00	0x00	0x00	0x00
  (gdb)

At this point, you might ask yourself: "what is the interest ?".

Using GDB valgrind commands provides several advantages compared to
the valgrind gdbserver monitor commands.

Evaluation of arguments by GDB:
-------------------------------
For relevant arguments, the GDB command will evaluate its arguments using
the usual GDB evaluation logic, for example, instead of printing/copying
the address and size of 'some_mem', the following will work:
  (gdb) memcheck xb &some_mem sizeof(some_mem)
  		    ff	  ff	  ff	  ff	  ff
  0x1FFEFFFE8B:	  0x00	0x00	0x00	0x00	0x00
  (gdb)

or:
  (gdb) p some_mem
  $4 = "\000\000\000\000"
  (gdb) memcheck xb &$4
  		    ff	  ff	  ff	  ff	  ff
  0x1FFEFFFE8B:	  0x00	0x00	0x00	0x00	0x00
  (gdb)

This is both easier to use interactively and easier to use in GDB scripts,
as you can directly use variable names in the GDB valgrind commands.

Command completion by GDB:
--------------------------
The usual command completion in GDB will work for the GDB valgrind commands.
For example, typing TAB after the letter 'l' in:
  (gdb) valgrind v.info l
will show the 2 "valgrind v.info" subcommands:
  last_error  location
  (gdb) valgrind v.info l

Note that as usual, GDB will recognise a command as soon as it is unambiguous.

Usual help and apropos support by GDB:
--------------------------------------
The Valgrind gdbserver provides an online help using:
  (gdb) monitor help
However, this gives the help for all monitor commands, and is not searchable.
GDB provides a better help and documentation search.
For example, the following commands can be used to get various help
or search the GDB Valgrind command online documentation:
   help valgrind
   help memcheck
   help helgrind
   help callgrind
   help massif
to get help about the general valgrind commands or the tool specific commands.

Examples of searching the online documentation:
  apropos valgrind.*location
  apropos -v validity
  apropos -v leak

User can define aliases for the valgrind commands:
--------------------------------------------------
The following aliases are predefined:
  v and vg for valgrind
  mc for memcheck
  hg for helgrind
  cg for callgrind
  ms for massif

So, the following will be equivalent:
   (gdb) valgrind v.info location &some_mem
   (gdb) v v.i lo &some_mem
   (gdb) alias Vl = valgrind v.info location
   (gdb) Vl &some_mem

Thanks to Hassan El Karouni for the help in factorising the python
code common to all valgrind python commands using a decorator.
2023-01-08 16:00:57 +01:00
Philippe Waroquiers
f6fcc74a68 Allows to only output "new" loss records when doing a leak search.
In the memcheck monitor 'leak_search', add a "new" keyword corresponding
to the delta leak search mode LCD_New.

Add a new client request VALGRIND_DO_NEW_LEAK_CHECK.

When doing a delta leak search, new loss records are marked with "new"
(whatever the delta leak search mode).

Note that trailing white spaces were removed in mc_main.c.
A much small diff can be looked at by using the -w diff option.
2022-12-30 20:56:47 +01:00
Paul Floyd
6c9aae8f44 FreeBSD: more filtering for gdbserver_tests/nlvgdbsigqueue
Needed for FreeBSD 14 without debug info files.
2022-10-28 22:19:47 +02:00
Philippe Waroquiers
e489f31974 Add abexit in --vgdb-stopat. fix 459031 --error-exitcode doc. Add lwpid in thread_wrapper tracing.
Note that this modifies files on darwin/solaris/bsd but I only did a linux
build so possibly this commit might cause a compilation error, that should
then be trivial to fix.

Also added memmem test in the list of ignored files.
2022-09-17 22:54:05 +02:00
Paul Floyd
aaeb6f00c6 Add an expected for FreeBSD gdbserver_tests/nlcontrolc 2022-06-15 07:06:25 +02:00
Paul Floyd
49d6d73c25 Add missing syscall wrapper on Solaris
I tried to test drd/tests/pth_mutex_signal on Solaris
(you never know) but encountered a missing syscall
wrapper. So this adds a very basic wrapper for lwp_mutex_unlock.

Also update a Solaris expected that I missed amongst the FreeBSD changes.
2021-11-22 04:12:16 +01:00
Mark Wielaard
64ab891629 gdbserver_tests: Filter out glibc hwcaps libc.so
On some systems the gdbserver_tests would fail because the filter
for the optimized hwcaps subdir didn't match because the file is
called slightly differently, with the version number before .so
instead of after. For example: /lib64/glibc-hwcaps/power9/libc-2.28.so

Add one extra filter for this pattern.
2021-11-02 14:27:45 +01:00
Mark Wielaard
3eba47604d filter_gdb: Handle r = SYSCALL_CANCEL as alternative for return SYSCALL_CANCEL
This happens with glibc 2.33 when debuginfo is installed.
2021-10-12 22:44:08 +02:00
Paul Floyd
a456fcef6d FreeBSD support, patch 9 supplemental
These files are now derived objects and should have been removed in the
previous change.
2021-10-07 23:02:29 +02:00
Paul Floyd
53dd9bd255 FreeBSD support, patch 9
cachegrind callgrind dhat exp-bbv gdbserver_tests massif none mpi shared

Mostly these are just updates (and new testcases) under new/tests
The other directories have just #ifdef changes
2021-10-07 22:41:22 +02:00
Paul Floyd
e2583c02a5 FreeBSD support, patch 2
Files in the root directory
Several Makefile.am files that have dependencies on FreeBSD autoconf
variables. Included a few new filter files to act as placeholders
to create new freebsd subdirectories.

Updated NEWS with the FreeBSD bugzilla items plus a couple of other
items fixed indirectly.
2021-10-07 08:18:47 +02:00
Mark Wielaard
3adeaba232 Ajust filter_gdb for arm64 with eglibc 2.19 and gdb 7.7.1
Older ubuntu arm64 setups used eglibc 2.19 and gdb 7.7.1.  In that
case select.c could be under linux/generic and the select argument
list could be split up differently over several lines. Adjust
filter_gdb to catch those differences.

Also checked against an Debian arm64 with glibc 2.31 and gdb 10.1.
2021-10-02 12:03:46 +02:00
Mark Wielaard
345edda439 Extend filter_vgdb for GNU gdb (Debian 10.1-2) 10.1.90.20210103-git
On Debian 11.0 arm64 gdb will emit a similar (stray) ENOTTY message
as on SLES11, but for _exit.c instead of rtld.c.
2021-10-01 22:46:30 +02:00
Mark Wielaard
6da22a4d24 gdbserver_tests: update filters for newer glibc/gdb
With newer glibc/gdb we might see a __select call without anything
following on the line. Also when gdb cannot find a file it might
now print "Inappropriate ioctl for device" instead of the message
"No such file or directory"
2021-07-16 21:37:39 +02:00
Philippe Waroquiers
c79180a3af Fix nlcontrolc.vgtest hanging on newer glibc and/or arm64
This test verifies that GDB can interrupt a process with all threads
blocked in a long select syscall.
The test used to terminate by having GDB modifying the select argument.
However, modifying the select argument works only for specific arch
and/or specific versions of glibc.
The test then blocks on other architectures/glibc versions.

The previous version of the test was:
  * first launching sleepers so as to have all threads blocked in long select
  * interrupting these threads
  * changing the select time arg so that the threads burn cpu
  * and then change variables to have the program exit.

The new version does:
  * first launches sleepers so that all threads are burning cpu.
  * interrupting these threads
  * change the local variables of sleepers so that the threads will
    block in a long select syscall
  * interrupt these threads
  * kill the program.

With this new version, we still check the behaviour of gdb+vgdbserver
for both burning and sleep threads, but without having the termination
depending on modifying select syscall argument.

Tested on debian amd64 and on ubuntu arm64 (to check the test does not hang
on an arm64 platform).
2021-03-07 22:35:58 +01:00
Mark Wielaard
9774de004a gdbserver_tests: filter out Download failed: messages.
gdb can also use debuginfod and is excessively chatty when downloads
fail (even when DEBUGINFOD_URLS isn't set). Filter those messages out
of the gdb output.
2021-02-27 17:44:36 +01:00
Mark Wielaard
9337b44f93 gdbserver_tests/hgtls.vgtest: Make sure gdb is installed before running
The other gdbserver_tests that need to run gdb make sure it is actually
available before trying to run it, otherwise the test is skipped. Do the
same to hgtls.vgtest by adding test -e gdb to the prereq.
2021-02-23 11:56:56 +01:00
Mark Wielaard
c9781cc97e PR140939 --track-fds reports leakage of stdout/in/err and doesn't respect -q
Make --track-fds=yes not report on file descriptors 0, 1, and 2 (stdin,
stdout, and stderr) by default. Add a new option --track-fds=all that does
report on the std file descriptors still being open. Update testsuite and
documentation.

Original patch by Peter Kelly <pmk@cs.adelaide.edu.au>
Updated by Daniel Fahlgren <daniel@fahlgren.se>

https://bugs.kde.org/show_bug.cgi?id=140939
2021-02-10 19:37:08 +01:00
Julian Seward
9dcd3ab1f6 Fix some spelling errors found by Lintian. Patch from Alessandro Ghedini <ghedo@debian.org>. 2020-01-23 10:53:36 +01:00
Philippe Waroquiers
3a803036f7 Allow the user to change a set of command line options during execution.
This patch changes the option parsing framework to allow a set of
core or tool (currently only memcheck) options to be changed dynamically.

Here is a summary of the new functionality (extracted from NEWS):
* It is now possible to dynamically change the value of many command
  line options while your program (or its children) are running under
  Valgrind.
  To have the list of dynamically changeable options, run
     valgrind --help-dyn-options
  You can change the options from the shell by using vgdb to launch
  the monitor command "v.clo <clo option>...".
  The same monitor command can be used from a gdb connected
  to the valgrind gdbserver.
  Your program can also change the dynamically changeable options using
  the client request VALGRIND_CLO_CHANGE(option).

Here is a brief description of the code changes.
* the command line options parsing macros are now checking a 'parsing' mode
  to decide if the given option must be handled or not.
  (more about the parsing mode below).

* the 'main' command option parsing code has been split in a function
  'process_option' that can be called now by:
     - early_process_cmd_line_options
        (looping over args, calling process_option in mode "Early")
     - main_process_cmd_line_options
        (looping over args, calling process_option in mode "Processing")
     - the new function VG_(process_dynamic_option) called from
       gdbserver or from VALGRIND_CLO_CHANGE (calling
        process_option in mode "Dynamic" or "Help")

* So, now, during startup, process_option is called twice for each arg:
   - once during Early phase
   - once during normal Processing
  Then process_option can then be called again during execution.

So, the parsing mode is defined so that the option parsing code
behaves differently (e.g. allows or not to handle the option)
depending on the mode.

// Command line option parsing happens in the following modes:
//   cloE : Early processing, used by coregrind m_main.c to parse the
//      command line  options that must be handled early on.
//   cloP : Processing,  used by coregrind and tools during startup, when
//      doing command line options Processing.
//   clodD : Dynamic, used to dynamically change options after startup.
//      A subset of the command line options can be changed dynamically
//      after startup.
//   cloH : Help, special mode to produce the list of dynamically changeable
//      options for --help-dyn-options.
typedef
   enum {
      cloE = 1,
      cloP = 2,
      cloD = 4,
      cloH = 8
   } Clo_Mode;

The option parsing macros in pub_tool_options.h have now all a new variant
*_CLOM with the mode(s) in which the given option is accepted.
The old variant is kept and calls the new variant with mode cloP.
The function VG_(check_clom) in the macro compares the current mode
with the modes allowed for the option, and returns True if qq_arg
should be further processed.

For example:

// String argument, eg. --foo=yes or --foo=no
   (VG_(check_clom)                                                     \
    (qq_mode, qq_arg, qq_option,                                        \
     VG_STREQN(VG_(strlen)(qq_option)+1, qq_arg, qq_option"=")) &&      \
    ({const HChar* val = &(qq_arg)[ VG_(strlen)(qq_option)+1 ];         \
      if      VG_STREQ(val, "yes") (qq_var) = True;                     \
      else if VG_STREQ(val, "no")  (qq_var) = False;                    \
      else VG_(fmsg_bad_option)(qq_arg, "Invalid boolean value '%s'"    \
                                " (should be 'yes' or 'no')\n", val);   \
      True; }))

   VG_BOOL_CLOM(cloP, qq_arg, qq_option, qq_var)

To make an option dynamically excutable, it is typically enough to replace
    VG_BOOL_CLO(...)
by
    VG_BOOL_CLOM(cloPD, ...)

For example:
-   else if VG_BOOL_CLO(arg, "--show-possibly-lost", tmp_show) {
+   else if VG_BOOL_CLOM(cloPD, arg, "--show-possibly-lost", tmp_show) {

cloPD means the option value is set/changed during the main command
Processing (P) and Dynamically during execution (D).

Note that the 'body/further processing' of a command is only executed when
the option is recognised and the current parsing mode is ok for this option.
2019-08-31 14:41:10 +02:00
Philippe Waroquiers
4d089e27d9 Make the list of horrible filter_gdb sed expressions somewhat less horrible
The sed expressions and the comments of these expression were at 2 different
places, making this already horrible list of expressions even more
horrible to understand/maintain.

So, restructure to allow the comments for an expression be close
to the expression.
2019-04-27 18:18:03 +02:00
Alexandra Hájková
b1cc37ddb6 filter_gdb: add regexp to filter out names which starts with a "."
such names are used for "function descriptors" on ppc64

https://bugs.kde.org/show_bug.cgi?id=406561
2019-04-19 12:16:42 +02:00
Mark Wielaard
0c8be9bbed gdbserver_tests fails because of gdb output change.
The 'done.' in "Reading symbols from <exe>...done." is optional.

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

Reported-by: Roger Light <roger@atchoo.org>
2019-04-10 19:30:30 +02:00
Alexandra Hájková
12addd0644 gdbserver_tests: adjust filtering for the new gdb output
mcsigpass and mcsignopass tests fails due to the slightly different
gdb output. Filter the tests output to make it the same for different
gdb version. Change mcsigpass and mcsignopass .exp to fit filtered
.out.

More generic regexp by Stefan Maksimovic <stefan.maksimovic@rt-rk.com>.

https://bugs.kde.org/show_bug.cgi?id=406355
2019-04-10 18:55:55 +02:00
Mark Wielaard
d15f70a925 Rename gettid() to gettid_sys() in gdbserver_tests.
glibc might defined gettid() itself through unistd.h:
https://sourceware.org/bugzilla/show_bug.cgi?id=6399

Rename to gettid_sys() so we don't clash with the glibc definition.
2019-03-13 13:34:01 +01:00
Philippe Waroquiers
cfae4f70a6 Modify .exp files following the new error message.
Change:
For counts of detected and suppressed errors, rerun with: -v
to
For lists of detected and suppressed errors, rerun with: -s
2018-12-28 19:33:00 +01:00
Philippe Waroquiers
20fe40ecc0 Update filter_gdb to make nlvgdbsigqueue work with gdb 8.2
gdb 8.2 now produces a message 'remote target killed',
so have filter_gdb delete it.

Tested on debian/amd64 with gdb 7.12/8.0/8.1/8.2
2018-09-15 11:26:52 +02:00
Philippe Waroquiers
a1ce55b1b9 Update filter_gdb to make nlcontrolc work with gdb 8.2
gdb 8.2 has changed the layout of the thread list headers.

Tested on debian/amd64 with gdb 7.12/8.0/8.1/8.2
2018-09-15 11:06:07 +02:00
Philippe Waroquiers
e7f3450869 Update test to make it work with gdb 8.2
Tested on debian/amd64 with gdb 7.12/8.0/8.1/8.2
2018-09-15 10:58:07 +02:00
Philippe Waroquiers
0822ebca8f Fix Bug 397424 - glibc 2.27 and gdb_server tests
commit a214595daed7830a091dcd0f52c5b8073bfd04dd already handled some
of the new differences created by glib 2.27.

This commit should filter the new way gdb shows a select syscall
with glibc 2.27
2018-09-02 14:22:43 +02:00
Philippe Waroquiers
a214595dae Change filter_memcheck_monitor as glibc 2.27 seems to keep some more memory
There is no real need to verify how much memory is still in use at
exit, so filter this in filter_memcheck_monitor.

Analysis by Dimitrije Nikolic
2018-09-01 18:51:21 +02:00
Ivo Raisr
63032324b0 Change SVN to GIT in various places and simple scripts. 2017-08-14 15:27:27 +02:00
Philippe Waroquiers
dc0fb705e9 Various minor fixes and correction in user manual and monitor command help
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16466
2017-08-01 20:21:38 +00:00
Ivo Raisr
184fc7a804 Check whether it is ok to use compiler flag '-pie'.
Some compilers actually do not support -pie and report its usage
as an error. We need to check if it is safe to use it first.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16463
2017-07-28 20:49:20 +00:00
Philippe Waroquiers
81542a63a4 Fix some tests failure with GDB 8.0
At the beginning of a Valgrind gdbserver test,
2 messages are produced when launching the command
   target remote | vgdb

A message output by vgdb:
   relaying data between gdb and process <pid>
(this message is read by GDB from the vgdb pipe, and re-output
on stderr)
and a message produced by GDB:
   Remote debugging using | ./vgdb

GDB 8.0 changes the order in which the above messages are output.
This causes 2 tests to fail, as the 'relaying' line appears
then in a part of the output deleted by a filter script.

To avoid this, change the filter scripts to always remove
this 'relaying line', which is not particularly interesting to check.
All the .exp files containining such a 'relaying' line are updated
accordingly.

This has been tested with various gdb versions (7.5, 7.7, 7.12, 8.0)
on amd64 and/or ppc64.

Thanks to Mark Wielaard, which helped to investigate this problem
by bisecting the GDB patches in GDB 8.0 causing this change of
behaviour.

   


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16453
2017-06-25 12:40:53 +00:00
Ivo Raisr
246bb0e25f Remove TileGX/Linux port.
Fixes BZ#379504.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16340
2017-05-08 17:21:59 +00:00
Ivo Raisr
d8f648486e Fix some spelling mistakes.
Fixes BZ#374719
Patch by: klemens <ka7@la-evento.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16336
2017-05-05 22:13:20 +00:00
Philippe Waroquiers
ec4400bccb Fix regression following r16303
Use 'set heuristic-fence-post 999999' only on mips platforms



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16305
2017-04-16 08:36:43 +00:00
Petar Jovanovic
3bd499c717 increase heuristic-fence-post limit for gdbserver_tests/mcmain_pic
GDB reports to be "unable to find the start of the function" and suggests
increasing the range of the search using the 'set heuristic-fence-post'
command. So we did.
It fixes gdbserver_tests/mcmain_pic on some platforms.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16303
2017-04-13 16:11:54 +00:00
Ivo Raisr
d572868caf Follow up to SVN r16253 (fix expected output of gdbserver_tests/solaris/nlcontrolc)
SVN r16253 (follow up to r16251) was not complete.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16255
2017-02-24 08:32:59 +00:00
Ivo Raisr
e4195be983 Follow up to SVN r16251
Fix expected output for gdbserver_tests/solaris/nlcontrolc.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16253
2017-02-20 15:02:31 +00:00
Philippe Waroquiers
d7ccda99e6 modifty sleepers to have easier evaluation of interaction between cpu freq scaling
and scheduler lock (pipe based or futex based)

See http://www.valgrind.org/docs/manual/manual-core.html#manual-core.pthreads_perf_sched
for background info about cpu freq scaling and valgrind thread scheduler.

To reproduce the interaction, do:
for sched in --fair-sched=yes --fair-sched=no
do
  for affinity in 0 1
  do
    echo $sched $affinity
    time ./vg-in-place $sched -q ./gdbserver_tests/sleepers 1000000 0 1000 B-B-B-B- $affinity
  done
done

which gives the below output (intel core i5-6402P, debian 8, kernel  3.16.0).
In summary: the fair scheduler is fair, the pipe based scheduler
can be really unfair (e.g. with --fair-sched=no and no affinity,
2 threads are finishing their work, while the 2 other threads are
starting their work only after the first 2 have fully finished).
The difference in timing is significant : 1m14s versus around 47 seconds.

  Note: If the governor is set to performance, strangely, the time needed for
  --fair-sched=no increases slighltly (to around 48 seconds).
  The time for --fair-sched=yes with or without affinity is then also
  to around 48 seconds.

Below is timing with on-demand governor:

--fair-sched=yes 0
loops/sleep_ms/burn/threads_spec/affinity:  1000000 0 1000 B-B-B-B- 0
Brussels ready to sleep and/or burn
London ready to sleep and/or burn
Petaouchnok ready to sleep and/or burn
main ready to sleep and/or burn
Brussels finished to sleep and/or burn
London finished to sleep and/or burn
Petaouchnok finished to sleep and/or burn
main finished to sleep and/or burn

real	1m14.582s
user	1m14.348s
sys	0m0.204s
--fair-sched=yes 1
loops/sleep_ms/burn/threads_spec/affinity:  1000000 0 1000 B-B-B-B- 1
Brussels ready to sleep and/or burn
London ready to sleep and/or burn
Petaouchnok ready to sleep and/or burn
main ready to sleep and/or burn
main finished to sleep and/or burn
Brussels finished to sleep and/or burn
Petaouchnok finished to sleep and/or burn
London finished to sleep and/or burn

real	0m46.785s
user	0m46.756s
sys	0m0.032s
--fair-sched=no 0
loops/sleep_ms/burn/threads_spec/affinity:  1000000 0 1000 B-B-B-B- 0
Brussels ready to sleep and/or burn
Brussels finished to sleep and/or burn
London ready to sleep and/or burn
London finished to sleep and/or burn
Petaouchnok ready to sleep and/or burn
main ready to sleep and/or burn
Petaouchnok finished to sleep and/or burn
main finished to sleep and/or burn

real	0m47.742s
user	0m48.224s
sys	0m0.084s
--fair-sched=no 1
loops/sleep_ms/burn/threads_spec/affinity:  1000000 0 1000 B-B-B-B- 1
Brussels ready to sleep and/or burn
London ready to sleep and/or burn
Petaouchnok ready to sleep and/or burn
main ready to sleep and/or burn
Brussels finished to sleep and/or burn
London finished to sleep and/or burn
main finished to sleep and/or burn
Petaouchnok finished to sleep and/or burn

real	0m46.601s
user	0m46.568s
sys	0m0.036s



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16251
2017-02-19 11:23:46 +00:00
Philippe Waroquiers
c972a2b8b0 Allow memcheck to output the leak results as a callgrind xtree file.
* New command line options --xtree-leak=no|yes and --xtree-leak-file=<file>
  to produce the end of execution leak report in a xtree callgrind format
  file.

* New option 'xtleak' in the memcheck leak_check monitor command, to
  produce the leak report in an xtree file.

* File name template arguments (such as --log-file, --xtree-memory-file, ...)
  have a new %n format letter that is replaced by a sequence number.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16205
2017-01-21 11:00:39 +00:00
Mark Wielaard
d8a311f659 Adjust line number in mcblocklistsearch.stderrB.exp.
valgrind svn r16173 "Add CLEAR_CALLER_SAVED_REGS in leak-tree test"
added one extra line to memcheck/tests/leak-tree.c which is used in
gdbserver_tests/mcblocklistsearch.vgtest. Adjust the line numbers in
the exp file to match.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16177
2016-12-06 09:50:47 +00:00