Hi, I am trying to measure performance by adding some code.
My target firmware version is 3.4.
And, I put perf code as follows.
- When AP_Scheduler is initialized
- _perf_XX = hal.util->perf_alloc(AP_HAL::Util::PC_ELAPSED, perfid);
- As a example of perfid, it was “1” “2” and so on
- In AP_Scheduler::run function, I put it before each task start (before “_tasks[i].function()” this code)
- After each task ends (_tasks[i].function();), I put it.
However, I cannot see any results.
I followed the guildline here
And I installed related libraries.
However, when I reboot the board, I could see only
pi@navio: ~$sudo lttng list --userspace
-> UST events:
w/o sudo it is same.
Since I am not sure about “ardupilot” in the below.
lttng enable-event --userspace ardupilot:count
lttng enable-event --userspace ardupilot:end
lttng enable-event --userspace ardupilot:begin
I changed it into “0” or “1” since I put that name when I call perf_alloc
In addition, I cannot see any results even with SCHED_DEBUG parameter setting which must show some results I believe.
Is there any person who have experience with lltng on NAVIO2?
PS. Note that I also tried all lltng commands with sudo since ardupilot runs on root privilege. But, I couldn’t see any difference.
By default ArduPilot is not linked to
lttng. You can install liblltng dev packages on the Raspberry itself and build ArduPilot there. Make sure that
waf configure --board=navio2 states that lttng is detected and linked to. That is the easy but slow way.
Another approach is not for faint-hearted. We’ll cross-compile ArduPilot on a Linux host against the sysroot with the g++ wrapper that’s properly symlinked like this:
exec arm-linux-gnueabihf-g++.real --sysroot=$SYSROOT "$@"
SYSROOT is the environment variable to a mounted rootfs from Raspberry Pi with all the needed libraries.
So it all boils down to this:
- Grab our image and save it to
$IMAGE_FILE and extract
sudo kpartx -av $IMAGE_FILE to make a loopback device
sudo mount /dev/mapper/loopXp2 rootfs to mount it
systemd-nspawn -b --bind /usr/bin/qemu-arm-static -D rootfs to boot the image. Make sure binfmt module is loaded
- Now you have an emulated with qemu Raspberry Pi where you can poke around.
sudo apt-get install liblttng dev packages inside the container
- Quit the container
After this steps you’ll have a rootfs with all libraries you need
8) Point SYSROOT to rootfs directory
waf configure --board=navio2 on your host should now detect liblltng and link against it.
You should see a message every once in a while in your GCS after you set it.
This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.