From: Enzo B. <enz...@gm...> - 2025-01-18 11:10:10
|
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. Any ideas will be welcomed, thanks! |