admin管理员组

文章数量:1133746

I have a microbenchmark which I'm using to generate memory traffic. I've profiled the application and it seems to constantly hit in L1 cache. I have a Core i5-7260U.

I want to understand the actual memory access pattern by tracing the memory accesses of my app. I think Valgrind can do this but a Google search hasn't shown any results. Is there a way to use Valgrind to trace all memory accesses?

It's a simple C++ program that I'm compiling using gcc with -g and -O3.

I have a microbenchmark which I'm using to generate memory traffic. I've profiled the application and it seems to constantly hit in L1 cache. I have a Core i5-7260U.

I want to understand the actual memory access pattern by tracing the memory accesses of my app. I think Valgrind can do this but a Google search hasn't shown any results. Is there a way to use Valgrind to trace all memory accesses?

It's a simple C++ program that I'm compiling using gcc with -g and -O3.

Share Improve this question edited Jan 8 at 4:52 Peter Cordes 363k49 gold badges702 silver badges966 bronze badges asked Jan 7 at 23:14 jkangjkang 5497 silver badges22 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

Answering for anyone else wondering this:

valgrind has a tool called lackey (https://valgrind.org/docs/manual/lk-manual.html) which has an option --trace-mem=yes that will perform a memory trace:

valgrind --tool=lackey --trace-mem=yes --log-file=<log file> <app>

本文标签: Getting a trace of memory address accesses using ValgrindStack Overflow