From: Paul F. <pj...@wa...> - 2025-01-29 07:50:04
|
On 18-01-25 12:09, Enzo Bonansea wrote: > Hello, > > For my computer science thesis, I need to instrument programs in order > to know which floating point values are being stored to buffers whose > size is greater than a certain threshold. For doing that, I modified the > tool memcheck in this public repository <https://github.com/ > enzobonansea/floating-point-vectors-inspector>; you can find my > modifications by searching for "memlog" in the code. > > The customization works as I expect, giving me the floating point values > that I need. Now, I want to optimize my code since it's CPU intensive > and makes the instrumented applications too slow. For instance, I ran > the memcheck customization against the SPEC2017 tool called lbm which > took originally a few seconds to run, but under the tool it takes more > than 2 minutes with the CPU at 100% all the time. > > If you see the code, the cause of the performance degradation is > evident: for every store I'm calling the dirty helper log_store, which > means that I'm calling that C function millions of times. > > I used Valgrind's memcheck several times as a user, but 2 months ago was > my first time seeing the tool's source code. So, since I'm new on this > and you guys have a lot of experience working on the project, maybe you > find my problem trivial and you can have a good idea of how I can > improve the performance of my customization of memcheck. Hi Do you really need to base your features on memcheck? I imagine that you would get better performance if you wrote a new tool (perhaps starting with lackey). After that, use a cache and write to file as little as possible (but I from what I see you do that already). A+ Paul |