i am writing a set of benchmark tests for binary translation of llvm
bytecodes as well as aot translation of llvm bytecode.
i am using the llvm-test sytle makefiles.
i write a special TEST.benchmark.Makefile that does the work.
i have good support (toolwise) for measuring runtime:
- time(1) is a nice utility for measuring time (under linux it should do
more but does not it :-()
but i have no simply utility for measuring runtime space (memory):
- ps would work, but it is a hack since i can't invoke it by giving ps
the tool to execute (i would have to write a wrapper which runs 2
subprocesses, one which runs the app, the other which runs ps with the
- valgrind et al - are too heavy weight imho
do you have a nice way to measure memory info like time(1) measures
write a simple application, which forks and execs the app to be
monitored in the child process.
the parent installs an alaram (with ualarm) and wait for the child pid.
periodically after the alarm goes on a simple os specific code is
executed to get the rss.
the arithmetic average of the rss value is then computed and at the end
of the parent process, the average is printed out to stderr.
this way you can execute it within the TEST scripts.
it works accross gcc as well as llc built binaries and with the lli. (i
know the lli could be used to -track-memory, but that was too specific
to the requirements of LLVM's runtime passes).
Ralph Corderoy wrote:
> Hi Jakob,
>> do you have a nice way to measure memory info like time(1) measures
>> execution time?
> Is acct(5) any good? It has some low-overhead memory details.