Hi,
for stack memory optimizations in GNRC I need some kind of tool to
analyze the call-path of its threads (the stackusage of each function
itself can easily determined using GCC [1]). After some experiments
with some static solutions (I basically went through the list here
[2]) I wasn't able to come to a satisfying result, so I want to go for
a run-time solution. However, we have (undocumented) support for gprof
on native [3]. Has anyone experience with gprof on non-native boards?
What tools do I need to install besides the respective gprof-version?
How do I connect gprof to the board?
Has anyone experience with gprof on non-native boards?
What tools do I need to install besides the respective gprof-version?
How do I connect gprof to the board?
I've tried to set it up but didn't succeed after a couple of hours.
Gprof needs it's augmentation to be initialized, and at some point
(usually at program exit) it's data needs to be written down (or sent
via serial/...).
My problem was a severe lack of documentation on how to set up the
framework for using gprof in baremetal contexts.
Since then a lot happened, and a while ago I found this [1], which looks
like it could be adapted to RIOT.
if your just interested in the call path and speed is no concern, I
imagine that you could implement this relatively easy on your own. GCC
can generate hooks for each function call [1] that you could use to
print directly via serial and later resolve names using the linker map file.
However, you won't be able to get meaningful benchmarks as this would
slow down the code *a lot*. Still, if you're interested in statistics
about which functions your code visted the most, kCacheGrind is a nice
tool for visualization with a really simple syntax.
Not long ago I needed a profiler for an x86 OS (no Linux!) and also had
a look at gmon/gperf. At that time, it seemed easier to integrate XRay
[3] into my project, but I guess this will not fit for an embedded target.
for stack memory optimizations in GNRC I need some kind of tool to
analyze the call-path of its threads (the stackusage of each function
itself can easily determined using GCC [1]). After some experiments
with some static solutions (I basically went through the list here
[2]) I wasn't able to come to a satisfying result, so I want to go for
a run-time solution. However, we have (undocumented) support for gprof
on native [3]. Has anyone experience with gprof on non-native boards?
What tools do I need to install besides the respective gprof-version?
How do I connect gprof to the board?
I used gcc's --finstruments-functions for my work on energy profiling some
years ago. Together with Stefan Pfeiffer we also toyed around with it to
determine the stack usage of certain functions. Some fragments of this can be
found in my repository:
https://github.com/OlegHahm/miniature-dangerzone/tree/master/overflow_test
If you don't care for the performance impact, you could use this for dumping
the call-path, too, I guess.
Hi,
thank you all a lot! Since performance isn't really an issue (as I
said: I just want to get the call-graph of each thread), I guess
`--finstruments-functions` is the way to go.