|
From: Nicholas N. <n.n...@gm...> - 2009-07-28 02:21:54
Attachments:
diff
|
Hi, Bug 197933 (https://bugs.kde.org/show_bug.cgi?id=197933) suggests putting the command line in the preamble of all Valgrind runs (excluding those invoked with -q). This makes --trace-children=yes much easier to use, because you can work out which process relates to which command invocation. It's also useful if you save Valgrind output to a file, as it's clear exactly what you ran. I have a patch that does this (it's attached). It wraps the command before 80 chars where possible, as the following example shows (best viewed with a fixed-width font): ==9717== Memcheck, a memory error detector. ==9717== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. ==9717== Using Valgrind-3.5.0.SVN and LibVEX; rerun with -h for copyright info ==9717== Command: date 11 23 4a \ ==9717== aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaa \ ==9717== aaa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 \ ==9717== 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 \ ==9717== fffffffffffffffffffffffffffff 1 2 3 \ ==9717== bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb I used "Command:" instead of "Running:" (as suggested in the bug report) because it seemed better. I thought about putting "Command:" in front of every line, to make it easier to parse the text, but then I figure if you want to do that you should really be using the XML output. I'll also have to change a lot of the regtest expected outputs (the attached patch doesn't have that yet) but that's not a big deal. Anyone have any other thoughts about this? Nick |
|
From: Florian K. <br...@ac...> - 2009-07-28 03:43:34
|
On Monday 27 July 2009 10:21:45 pm Nicholas Nethercote wrote: > > ==9717== Memcheck, a memory error detector. > ==9717== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. > ==9717== Using Valgrind-3.5.0.SVN and LibVEX; rerun with -h for copyright info > ==9717== Command: date 11 23 4a \ > ==9717== aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > aaaaaaaaaa \ > ==9717== aaa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 \ > ==9717== 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 \ > ==9717== fffffffffffffffffffffffffffff 1 2 3 \ > ==9717== bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb > > I used "Command:" instead of "Running:" (as suggested in the bug > report) because it seemed better. > > I thought about putting "Command:" in front of every line, to make it > easier to parse the text, but then I figure if you want to do that you > should really be using the XML output. > Right. It would be even better to not have the process ID on every line. That way you can use the mouse to select the command line and then paste it into the shell again. I use that frequently and find it handy. The PID would get in the way there. I definitely like the shortened preamble. Florian |
|
From: Nicholas N. <n.n...@gm...> - 2009-07-29 23:39:42
|
On Tue, Jul 28, 2009 at 1:30 PM, Florian Krohm<br...@ac...> wrote: >> >> I thought about putting "Command:" in front of every line, to make it >> easier to parse the text, but then I figure if you want to do that you >> should really be using the XML output. > > Right. It would be even better to not have the process ID on every line. > That way you can use the mouse to select the command line and then paste > it into the shell again. I use that frequently and find it handy. The PID > would get in the way there. I understand your point, but kept it as is because I think it's more important that every Valgrind output line is prefixed with something consistent. I guess there's an argument to be made then to not wrap the command... either way is imperfect... :/ > I definitely like the shortened preamble. Good! Nick |