Cross-building LibGTop

By | January 21, 2017

LibGTop is a library used to get system specific data such as CPU, memory usage and info about running processes.
Since it’s part of the GNOME desktop environment, it’s used by some system monitor applets, but it’s main interface is completely independent, so it can be used as a standalone library even for embedded system that already use GLib.

Normally, you should debug your system before deployment and be sure that there are no processes with memory leaks or that are consuming more CPU than they should, but sometimes there could be strange conditions in a process that at certain point start to eat too much CPU or just Valgrind doesn’t support your processor.

In these cases, the system needs to be closely monitored and a library like LibGTop with an API that you can easily use could be quite handy.

I normally use Buildroot, but it doesn’t include LibGTop, it seems that Yocto doesn’t have a recipe neither. I’ll try to explain briefly how to cross-build it for an ARM processor that I’m using with the Linaro hard-float toolchain.


First, let’s export common environment variables that make our life easier:

Configure remove unneeded things for an embedded system:

Edit lib/Makefile and set the following variables:

Compile and install:

You can have a look at the GLibTop API here.
That’s it.

Leave a Reply

Your email address will not be published. Required fields are marked *