|
From: Skarakis, K. <kon...@un...> - 2014-09-23 14:11:58
|
Hello, I want to run a big project over a long time under Valgrind's Memcheck. I am using --log-file in conjunction with %p to generate log files per process ID. This means that over time I will start losing log files due to PID reuse. Is there a way to make my logs unique so that they will not be overwritten? Maybe some way to get a timestamp in the filename? I know that the only other available specifier is %q, but I haven't found a way to make this work. I am running on Suse Linux 64bit. Thanks, Costas |
|
From: Eliot M. <mo...@cs...> - 2014-09-23 16:51:28
|
On 9/23/2014 10:11 AM, Skarakis, Konstantinos wrote:
> Hello,
>
> I want to run a big project over a long time under Valgrind’s Memcheck. I am using --log-file in
> conjunction with %p to generate log files per process ID. This means that over time I will start
> losing log files due to PID reuse. Is there a way to make my logs unique so that they will not be
> overwritten? Maybe some way to get a timestamp in the filename? I know that the only other available
> specifier is %q, but I haven’t found a way to make this work.
>
> I am running on Suse Linux 64bit.
>
> Thanks,
>
> Costas
Dear Costas -- I am not aware of anything to do that, but a while back
I wrote a patch that allows an additional format specifier, %s{....}
which runs a script and argument that are specified in the {....},
and the result of that script is used as the file name for the log
file. It would be easy enough, given that functionality, to write
a script that returns a time stamp. I will see if I can narrow this
down to a small patch that I can submit, and when I do, I can email
you the patch at the same time. I did this a while ago, but if this
part of the code has not been changed a lot, then the patch should
not be too bad to extract.
I've been meaning to submit it for some time, actually, and this is
a good prompt to make me do it!
Regards -- Eliot Moss
|
|
From: Eliot M. <mo...@cs...> - 2014-09-23 18:11:10
Attachments:
m_options.c.patch
|
Ok, here's the patch to add the %s{script} form
to log-file expansion. The script is run via
/bin/bash -c script, and its output replaces the
while %s form. The max length my code allows
for the result is 500 characters, which seemed
enough for anything realistic. Note that the
pid of the invoking valgrind will be the script's
PPID, etc.
If the "powers that be" think this might be
generally useful, then let me know how you would
prefer to receive the patch, and any tidying you
feel would be in order ...
Regards -- Eliot Moss
|