| Author |
Message |
Guest
|
Posted:
Wed Feb 16, 2005 5:27 am Post subject:
Memory address tracing |
|
|
Hi,
I want to find out what all memory addresses a program accesses and for
this I am looking for a tool which can do this. Can someone please help
me out?
Abhishek |
|
| Back to top |
|
 |
Guest
|
Posted:
Wed Feb 16, 2005 8:48 pm Post subject:
Re: Memory address tracing |
|
|
abhishek@cs.utah.edu wrote:
| Quote: | Hi,
I want to find out what all memory addresses a program accesses and
for
this I am looking for a tool which can do this. Can someone please
help
me out?
Abhishek
|
Look into valgrind, an x86 emulator that runs under Linux. If it
doesn't do exactly what you need it to do, it's open source so you can
add what you need.
-t |
|
| Back to top |
|
 |
Guest
|
Posted:
Wed Feb 16, 2005 10:52 pm Post subject:
Re: Memory address tracing |
|
|
bybell@rocketmail.com wrote:
| Quote: | Look into valgrind, an x86 emulator that runs under Linux. If it
doesn't do exactly what you need it to do, it's open source so you can
add what you need.
|
There's also a PPC port now. Valgrind does memory debugging and certain
value propergation analysis to determine when branches are based on
uninitialsed variables, it's not going to give you trace of the data
values as they go in and out.
If you were running on ARM you could use the Embedded Trace Macrocell
system and tools to trace all memory access addresses non-invasively.
On any other kind of system you are going to have to go with some kind
of emulation system which will introduce a slow down, running under
valgrind for example gives about a factor of 20 slowdown usually.
What are you actually trying to achieve, what are you going to do with
the vast amount of data that would be produced by tracing all memory
access addresses?
-p
--
Paul Gotch
CoreSight Tools
Development Systems ARM Limited.
--------------------------------------------------------------------- |
|
| Back to top |
|
 |
absk
Guest
|
Posted:
Wed Feb 16, 2005 11:08 pm Post subject:
Re: Memory address tracing |
|
|
I tried installing it but during make, it gives these errors.
In file included from /usr/include/linux/msg.h:5,
from vg_unsafe.h:56,
from vg_syscalls.c:35:
/usr/include/linux/list.h:699:2: warning: #warning "don't include
kernel headers in userspace"
In file included from /usr/include/linux/mii.h:12,
from vg_unsafe.h:76,
from vg_syscalls.c:35:
/usr/include/linux/if.h:95: error: redefinition of `struct ifmap'
/usr/include/linux/if.h:131: error: redefinition of `struct ifreq'
/usr/include/linux/if.h:181: error: redefinition of `struct ifconf'
make[4]: *** [vg_syscalls.o] Error 1
make[4]: Leaving directory
`/home/abhishek/work/valgrind-2.2.0/coregrind'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory
`/home/abhishek/work/valgrind-2.2.0/coregrind'
make[2]: *** [all] Error 2
make[2]: Leaving directory
`/home/abhishek/work/valgrind-2.2.0/coregrind'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/abhishek/work/valgrind-2.2.0'
make: *** [all] Error 2
Apparently some redefinition of some structures. I can't figure out
what to do. Can you suggest me something. Any help would be greatly
appreciated.
Abhishek.
bybell@rocketmail.com wrote:
| Quote: | abhishek@cs.utah.edu wrote:
Hi,
I want to find out what all memory addresses a program accesses and
for
this I am looking for a tool which can do this. Can someone please
help
me out?
Abhishek
Look into valgrind, an x86 emulator that runs under Linux. If it
doesn't do exactly what you need it to do, it's open source so you
can
add what you need.
-t |
|
|
| Back to top |
|
 |
absk
Guest
|
Posted:
Wed Feb 16, 2005 11:36 pm Post subject:
Re: Memory address tracing |
|
|
Is that a free software?
I am trying to port an algorithm in hardware for which I need the
pattern of its memory accesses which can be used to exploit the
benefits of data locality in hardware.
Abhishek |
|
| Back to top |
|
 |
Guest
|
Posted:
Thu Feb 17, 2005 7:56 am Post subject:
Re: Memory address tracing |
|
|
absk wrote:
| Quote: | I tried installing it but during make, it gives these errors.
In file included from /usr/include/linux/msg.h:5,
from vg_unsafe.h:56,
from vg_syscalls.c:35:
/usr/include/linux/list.h:699:2: warning: #warning "don't include
kernel headers in userspace"
etc |
I'm running RH9 with a 2.4.20-31.9 kernel and it compiled fine with no
problems. I generated some output, and the Massif tool I mentioned in
a previous post won't give you what you want.
I took a quick glance at the source for valgrind and as it's using a
JIT engine, I'm wondering how hard it would be to add the kind of
tracing you want which would camp on loads and stores.
You might also want to look into the ptrace() syscall to see what gdb
does. *shrugs* gcc could probably also be modified to generate
logging by inserting monitors in the RTL when loads/stores are
encountered, but calling that "not exactly trivial" is quite an
understatement.
Modifying an existing interpreting processor emulator is probably the
easiest route to take as the memory access functions are often
abstracted, but it will be the slowest running. If you don't need a
system complete with syscalls/OS but just need to run some code,
disabling address translation (make EA=RA) and disabling exceptions
checking in the processor emulation will give you decent speedup. Your
mileage may vary.
-t |
|
| Back to top |
|
 |
Guest
|
Posted:
Thu Feb 17, 2005 7:57 am Post subject:
Re: Memory address tracing |
|
|
|* Massif: a new space profiling tool. Try it! It's cool, and it'll
| tell you in detail where and when your C/C++ code is allocating
heap.
| Draws pretty .ps pictures of memory use against time. A potentially
| powerful tool for making sense of your program's space use.
....it seems like it might but I don't have any idea of how detailed its
reporting is.
-t |
|
| Back to top |
|
 |
JD
Guest
|
Posted:
Fri Feb 18, 2005 7:56 am Post subject:
Re: Memory address tracing |
|
|
PIN (http://rogue.colorado.edu/Pin/index.html) is a great tool for
dynamic instrumentation on Intel platforms (Linux only, so far). I have
used it to extract address traces from executables on the Itanium
platform.
-Jaydeep
abhishek@cs.utah.edu wrote:
| Quote: | Hi,
I want to find out what all memory addresses a program accesses and
for
this I am looking for a tool which can do this. Can someone please
help
me out?
Abhishek |
|
|
| Back to top |
|
 |
absk
Guest
|
Posted:
Fri Feb 18, 2005 2:04 pm Post subject:
Re: Memory address tracing |
|
|
Looks like PIN works for me too. In fact it has inbuilt functionalities
for generating the memory trace so I did not have to insert any extra
code anywhere. I have been trying to insert some extra code in the
source code of valgrind but I did not feel the address traces given by
that were reliable. Hopefully PIN will do my job.
Thanks a lot for this.
Abhishek
JD wrote:
| Quote: | PIN (http://rogue.colorado.edu/Pin/index.html) is a great tool for
dynamic instrumentation on Intel platforms (Linux only, so far). I
have
used it to extract address traces from executables on the Itanium
platform.
-Jaydeep
abhishek@cs.utah.edu wrote:
Hi,
I want to find out what all memory addresses a program accesses and
for
this I am looking for a tool which can do this. Can someone please
help
me out?
Abhishek |
|
|
| Back to top |
|
 |
|
|
|
|