|
From: Wuweijia <wuw...@hu...> - 2018-01-23 11:27:49
|
Hi
Thanks for your advise. You mean I need to download valgrind 3.13. and merge your commit, compile it.
And Is there any api that I can dump the call stack of the threads.
I want to add it to the code to show me more information to debug the program.
BR
Owen
-----邮件原件-----
发件人: Ivo Raisr [mailto:iv...@iv...]
发送时间: 2018年1月23日 17:43
收件人: Wuweijia <wuw...@hu...>
抄送: val...@li...; Fanbohao <fan...@hu...>
主题: Re: [Valgrind-users] [Help] Valgrind sometime run the program very slowly sometimes , it last at least one hour. can you show me why or some way to analyze it?
2018-01-23 4:02 GMT+01:00 Wuweijia <wuw...@hu...>:
> Hi
>
> I ran the program with mem-check, 99% is okay, it will
> not last long. But sometimes it last very long, at least one hour in
> one function. And then I add the –trace-signals=yes to find what it happen.
> Valgrind show me some signal happened. Is there something related to
> the time that the mem-check last too long. Or can you show me some
> ways to analyze why the mem-check run too long sometimes.
Perhaps you will find useful a simple progress reporting facility recently integrated into Valgrind repo by Julian.
https://bugs.kde.org/show_bug.cgi?id=384633
Remark: you need to build Valgrind from the latest source as per http://valgrind.org/downloads/repository.html
Excerpt from the documentation:
---------------------------------------------
A new command line flag, --progress-interval=number, causes Valgrind to print a 1-line summary of progress every |number| seconds.
For example, when starting Firefox with --progress-interval=10, I get lines like this:
--32411-- PROGRESS: U 110s, W 113s, 97.3% CPU, EvC 414.79M, TIn 616.7k, TOut 0.5k, #thr 67
--32411-- PROGRESS: U 120s, W 124s, 96.8% CPU, EvC 505.27M, TIn 636.6k, TOut 3.0k, #thr 64
--32411-- PROGRESS: U 130s, W 134s, 97.0% CPU, EvC 574.90M, TIn 657.5k, TOut 3.0k, #thr 63
--32411-- PROGRESS: U 140s, W 144s, 97.2% CPU, EvC 636.34M, TIn 659.9k, TOut 3.0k, #thr 62
--32411-- PROGRESS: U 150s, W 155s, 96.8% CPU, EvC 710.21M, TIn 664.0k, TOut 17.7k, #thr 61
--32411-- PROGRESS: U 160s, W 201s, 79.6% CPU, EvC 822.38M, TIn 669.9k, TOut 75.8k, #thr 60
Each line shows:
U: total user time
W: total wallclock time
CPU: overall average cpu use
EvC: number of event checks. An event check is a backwards branch
in the simulated program, so this is a measure of forward progress
of the program
TIn: number of code blocks instrumented by the JIT
TOut: number of instrumented code blocks that have been thrown away
#thr: number of threads in the program
From the progress of these, it is possible to observe:
* when the program is compute bound (TIn rises slowly, EvC rises rapidly)
* when the program is in a spinloop (TIn/TOut fixed, EvC rises rapidly)
* when the program is JIT-bound (TIn rises rapidly)
* when the program is rapidly discarding code (TOut rises rapidly)
* when the program is about to achieve some expected state (EvC arrives
at some value you expect)
* when the program is idling (U rises more slowly than W)
I.
|