Commit Graph

16 Commits

Author SHA1 Message Date
Andrew Tridgell 279c1b9d9c AP_HAL_Linux: rename macros to avoid conflicts
these macros were also defined in NuttX in clock.h
2017-05-06 15:21:14 +10:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Andrew Tridgell f090e9b27c HAL_Linux: fixed makefile build with PRIu64 2016-07-07 15:10:59 +10:00
Lucas De Marchi b70b9ed8d1 AP_HAL_Linux: fix warning on 64b printf
../../libraries/AP_HAL_Linux/Perf.cpp: In member function ‘void Linux::Perf::_debug_counters()’:
../../libraries/AP_HAL_Linux/Perf.cpp:85:36: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
                     c.name, c.count);
                                    ^
2016-06-25 12:05:55 -03:00
Lucas De Marchi 4a18108600 AP_HAL_Linux: rename min, max and avg fields
These were probably named otherwise in order not to conflict with
min/max macros from math.h. We don't have this problem anymore.
2016-06-23 19:08:14 -03:00
Lucas De Marchi b8e3e549c7 AP_HAL_Linux: Perf: add debug method
Test code for integration with another thread to pull data from internal
perf counters.  Since we are using the timer thread here, there's no
retry mechanism and we only print that data can be corrupted.
2016-06-23 19:08:14 -03:00
Lucas De Marchi 1727418dc9 AP_HAL_Linux: Perf: make lttng use internal fields
Instead of creating a new object Perf_Lttng copying the necessaries
fields, just make a tighter integration with the internal perf counters
and re-use the same fields.
2016-06-23 19:06:30 -03:00
Lucas De Marchi 619ce23799 AP_HAL_Linux: Perf: rework integration with other tools
The idea is to leave the internal perf enabled all the time, like it is
in PX4, and then allow the integration with lttng on top. Next step
would be to runtime enable/disable only the perf counters we are
interested in.

This also changes the structure so it's easy to allow another thread to
pull data from the Perf object. A rw lock protects from addition of new
counters and an atomic unsigned int allows other threads to do a
lockless copy of the data.

In order for this to work the allocation was changed to use a single
memory pool instead of returning a calloc'ed data for each perf counter.
Since most of our counters are of ' elapsed' type, don't bother using a
smaller struct for the 'count' type
2016-06-23 19:06:30 -03:00
Lucas De Marchi ab66e3a69a AP_HAL_Linux: Perf: simplify function to get current time 2016-06-21 13:09:00 -03:00
Lucas De Marchi 3457dbcdf8 AP_HAL_Linux: rename lttng define
Like others, use HAVE_ prefix and name it HAVE_LTTNG_UST to be the same
name as exported by pkg-config While at it remove wrong comment with
_HELLO_TP_H.
2016-05-23 12:06:42 -03:00
Lucas De Marchi 71e10c9132 AP_HAL_Linux: fix include order
Sort include alphabetically and make them in order:

Main header
system headers
library headers
local headers

While reordering, change a include of endian.h to our sparse-endian.h
which is more reliant to toolchain changes.
2016-05-18 23:05:56 -03:00
Lucas De Marchi 45c6b750f2 AP_HAL_Linux: remove ifdef checks for HAL_BOARD_LINUX
Everything inside libraries/AP_HAL_Linux is for Linux boards, there's
not need to add the ifdefs.
2016-05-18 23:05:56 -03:00
Julien BERAUD f449107563 AP_HAL_Linux: Add Perf Lttng
Support for perf api using lttng.
Some additional build tricks needed for bebop because lttng uses dl_open
which is not compatible with a static link on a different libc as used
on the bebop
2016-01-14 19:13:35 -02:00
Andrew Tridgell 1a033f3b73 HAL_Linux: don't flood the link with errors on uninitialised perf counter
that could bring down the vehicle
2015-11-14 14:44:29 +11:00
Julien BERAUD 2f610a400a AP_HAL_Linux: fix perf
Fix warning (warning: declaration of 'perf_count' shadows a member of 'this')
and check that perf is not NULL before indirection
2015-11-14 14:44:29 +11:00
José Roberto de Souza 5ff67a41a1 AP_HAL_Linux: Implement perf API
Initial implementation of perf API on Linux, for now just saving
perf data, in a further patch this data will be exported.
2015-11-13 12:16:19 +11:00