Commit Graph

189 Commits

Author SHA1 Message Date
Philippe Gerum bdc3aab501 lib/mutex: introduce compact creation calls
Normal (i.e. non-recursive) mutexes timed on the monotonic clock are
the most common form of locks used by applications. Allow people to
write more compact code by providing creation calls and static
initializers aimed at building these directly:

- evl_new_mutex(), EVL_MUTEX_INITIALIZER() for PI locks timed on the
  monotonic clock.

- evl_new_mutex_any() and EVL_MUTEX_ANY_INITIALIZER() for building any
  supported type of lock (normal/recursive), specifying the protocol
  (PI/PP) and the base clock.
2019-08-19 10:22:49 +02:00
Philippe Gerum a6044094db lib/mutex: add support for recursive type 2019-08-18 16:30:47 +02:00
Philippe Gerum f052b6d31c eshi: EVL shim library
The EVL shim library mimics the behavior of the original EVL API based
on plain POSIX calls from the native *libc, which does not require the
EVL core to be enabled in the host kernel. It is useful when the
real-time guarantees delivered by the EVL core are not required for
quick prototyping or debugging application code.
2019-08-09 19:07:39 +02:00
Philippe Gerum ec669471c0 tests/poll-nested: expect -ELOOP on circular loop 2019-08-09 16:01:11 +02:00
Philippe Gerum 26f0ed1a4d benchmarks, utils: add verbosity to installation rule 2019-08-09 12:05:13 +02:00
Philippe Gerum 49fc9571a2 tests/monitor-flags: extend timeout on second wait call 2019-08-09 12:05:13 +02:00
Philippe Gerum f50f26c99e tests/poll-close: drop useless object path 2019-08-08 13:10:35 +02:00
Philippe Gerum 65a374d0cf tests/clock-timer-periodic: switch to 64bit timer readouts 2019-08-08 13:10:35 +02:00
Philippe Gerum 5e95213578 include/mutex: clarify variable naming 2019-08-08 13:10:35 +02:00
Philippe Gerum 950e5c1cd7 include/proxy: clarify variable naming 2019-08-07 11:19:13 +02:00
Philippe Gerum 22f73c4467 lib/heap: include atomic helpers explicitly 2019-08-07 10:11:48 +02:00
Philippe Gerum 457a878a20 include: drop useless forward declarations 2019-08-07 10:11:03 +02:00
Philippe Gerum c7c785c060 lib/event: check mutex sanity in wait ops 2019-08-07 10:10:34 +02:00
Philippe Gerum 147ff5aeae utils/ps: display count of remote wakeups
RWA (Remote-WAkeups) reports the number of times a thread was readied
and rescheduled from a remote CPU. Available with the -s display
format.
2019-08-02 15:47:24 +02:00
Philippe Gerum 6ac46dfa8d utils/evl: add -A switch to get the ABI revision 2019-07-29 15:19:44 +02:00
Philippe Gerum f7f59262fb benchmarks/latmus: add more details to histogram dump 2019-07-28 18:46:46 +02:00
Jorge Ramirez-Ortiz afb57502d3 benchmarks: gpio-echo: external latency tester tool
This Linux-side tool is designed to echo the GPIO signals issued from
a remote board, which in turn measures the response time. The code has
been validated using a Linux-based rpi3b running gpio-echo, and a
Zephyr-based FRDMk64f board measuring the response time.

The current version of the Zephyr code is available in the zephyr/
subdirectory in patch format. This code is maintained at:
https://github.com/ldts/zephyr.git, branch evl-latency

For instance, GPIO23 can be used to receive test signals on rpi3b and
GPIO24 to respond to them.

gpio-echo is realtime capable (via EVL) or non-realtime capable
(standard Linux behaviour) - it depends on how you run it.

$ gpio-echo -n gpiochip0 -o 23 -t 24 -O -T -f

Once that process is started (and the necessary cabling is done) start
this Zephyr program, get the console and follow the instructions.

Connections:
-------------
 Zephyr - FRDMk64F:                Linux - rpi3b
  PIN 20 (PTE-24) ----------------  PIN 16 (GPIO 23)
  PIN 18 (PTE-25) ----------------  PIN 18 (GPIO 24)

Signed-off-by: Jorge Ramirez-Ortiz <jro@xenomai.org>
2019-07-23 18:49:47 +02:00
Philippe Gerum 5353db0df9 lib/sem: fix how evl_peek_sem() returns the count value
-EINVAL and a negative (depleted) semaphore count value might be
conflicting. Retrieve the count value by address instead.
2019-07-21 18:56:10 +02:00
Philippe Gerum b95e8fcbf0 libevl: rename commands/ to utils/ 2019-07-21 17:30:59 +02:00
Philippe Gerum d1ed4447e7 libevl: rename utils/ to benchmarks/ 2019-07-21 17:28:27 +02:00
Philippe Gerum 321da2e177 tests: helpers: limit stack size to EVL default
All tests run mlocked, so make sure to commit and lock a reasonably
small amount of RAM for thread stacks (i.e. smaller than the glibc
default value).
2019-07-14 16:53:02 +02:00
Philippe Gerum 438dcd1363 tests: use errno-based assertion as appropriate 2019-07-12 17:27:30 +02:00
Philippe Gerum f9021f8727 commands/trace: refine tracer settings 2019-07-04 20:21:39 +02:00
Philippe Gerum 4a61fdfacd lib, utils: help in detecting bad core setup 2019-07-02 16:25:46 +02:00
Philippe Gerum 996a1e5bd1 utils/latmus: restrict C-state when applicable
If /dev/cpu_dma_latency is present, we can restrict the usable C-state
the CPU may be asked to enter by writing zero to this file, and
keeping the file descriptor open for the duration of the test. This
helps in preventing PM-originated latency spikes.
2019-07-02 16:07:28 +02:00
Philippe Gerum e4e4097a4c utils/latmus: inform about sampling on a non-isolated CPU 2019-07-02 15:46:36 +02:00
Philippe Gerum 51b8c157a4 lib/sched: export evl_get_cpustate()
This routine is mainly intended as a tool for applications to
implement LARTs, notably returning the isolation state of a CPU. This
helps in detecting when a user is about to run out-of-band work on a
non-isolated CPU.

Although a dual kernel system performs significantly better than a
native preemption system in this configuration, getting the smallest
jitter and latency figures will require running the out-of-band load
on an isolated core, so that the in-band work does not increase the
rate of cache misses for the out-of-band duties.
2019-07-02 15:38:20 +02:00
Philippe Gerum 983129b6ec utils/latmus: run sampler on a CPU from the OOB set
If -c was not given, we must run the sampler on a CPU which is part of
the out-of-band set the core is controlling since such set might have
been restricted on the kernel command line (i.e. evl.oobcpus=).
2019-07-02 12:05:59 +02:00
Philippe Gerum 385ba4bb30 utils/hectic: pick default CPU list from OOB set
If -c was not given, we must default to the set of OOB CPUs the core
is controlling since such set might have been restricted on the kernel
command line (i.e. evl.oobcpus=).
2019-07-02 11:20:32 +02:00
Philippe Gerum 993f572cc7 build: symlink generic libevl SONAME to DTSONAME at install 2019-07-02 10:31:03 +02:00
Philippe Gerum 6eb9d456aa commands/ps: UINT_WIDTH not avail with GCC 6.5.x 2019-07-02 08:37:27 +02:00
Philippe Gerum edb631c0c7 lib/timer: enable get/set ops over non-EVL context 2019-07-01 11:04:28 +02:00
Philippe Gerum 1b1e203852 lib/heap: enable heap creation/deletion over non-EVL context 2019-07-01 10:22:50 +02:00
Philippe Gerum 12f277eeed lib/sched: group all sched-related calls 2019-07-01 08:37:35 +02:00
Philippe Gerum 98507f2679 lib/proxy: relay stdout, stderr through built-in proxies
proxy_outfd, proxy_errfd are the file descriptors of these built-in
proxies, for issuing formatted printouts without incurring switches to
the inband stage.

evl_printf() is a shorthand call formatting its argument list before
sending the resulting string through proxy_outfd.
2019-06-30 16:50:50 +02:00
Philippe Gerum b1a5755354 lib/proxy: add message formatting routines to proxy stream 2019-06-30 13:07:25 +02:00
Philippe Gerum 6bfb86253d lib/sched: add sched-specific implementation file 2019-06-30 13:07:14 +02:00
Philippe Gerum c78307fd04 lib/clock: drop meaningless parameter from evl_sleep()
evl_sleep() only accepts absolute timespecs, so there is no point in
providing a pointer for collecting the remaining time upon interrupt.
2019-06-29 19:34:52 +02:00
Philippe Gerum 85018fc262 lib/proxy: enable fixed granularity for writes
This change allows the application to specify a fixed granularity for
writes to the target file, such as connecting the proxy with an
eventfd for instance, guaranteeing fixed-size 64bit writes to the
latter.

evl_poll() is also enabled for the proxy, with POLLOUT|POLLWRNORM
raised when the output has drained, i.e. all data have been sent to
the target file.
2019-06-29 16:41:07 +02:00
Philippe Gerum 0c4534538c tests: PI: disable T_WOLI for the test case 2019-06-29 15:05:17 +02:00
Philippe Gerum c344373357 commands/evl: detect when the EVL core is absent 2019-06-28 11:07:59 +02:00
Philippe Gerum 4532a9a851 init: refer to control device by symbol 2019-06-28 11:01:33 +02:00
Philippe Gerum 28e6b7d64c include/evl: thread: include signal bits 2019-06-27 17:47:30 +02:00
Philippe Gerum dd71aeaca6 utils/latmus: include results from the last bulk
When the test is interrupted, we usually have some results pending in
kernel space which have been collected but not yet received via the
cross-buffer. Make sure to collect and include them in the latency
report.
2019-06-27 17:08:36 +02:00
Philippe Gerum 0ca0d13604 tests/heap: fix help strings 2019-06-27 17:08:36 +02:00
Philippe Gerum 628c6f456d evl: do not use the Mu character
It is not always properly rendered depending on the locale.
2019-06-27 17:08:36 +02:00
Philippe Gerum c96ec86e65 include/evl: read evl/flags.h from central header 2019-06-27 17:08:36 +02:00
Philippe Gerum 72bc055396 utils/latmus: fix help strings 2019-06-26 18:04:39 +02:00
Philippe Gerum 882dfc5b4f lib/thread: convert to T_WOSS, T_WOLI flags 2019-06-25 19:03:00 +02:00
Philippe Gerum 23dc6a6038 lib/sem: remove inapplicable debugging bypass 2019-06-24 19:25:42 +02:00