Commit Graph

380 Commits

Author SHA1 Message Date
qichen b5f183194b replace /dev/evl with /dev/rros 2024-01-13 06:33:07 +00:00
Qiu Qichen a2f8e8004c Use static linking in tests and tidbits to avoid glibc incompatible 2023-12-10 06:28:06 +00:00
Qiu Qichen ad1875e1eb replace printf with DEBUG_PRINT.
If you want to use DEBUG_PRINT,pass a D=1 when compiling libevl
2023-12-10 06:26:55 +00:00
Hu Jiangtao 4a99ec0ab6 c: libevl: Complete control init in generic_init function
Signed-off-by: Hu Jiangtao <jiangtao999.hu@gmail.com>
2023-11-02 14:18:45 +00:00
Hu Jiangtao bd7a3abd38 tests: add some debug print in proxy
Signed-off-by: Hu Jiangtao <jiangtao999.hu@gmail.com>
2023-06-20 07:42:38 +00:00
Hu Jiangtao 0695594190 tests: add some debut print in xbuf
Signed-off-by: Hu Jiangtao <jiangtao999.hu@gmail.com>
2023-06-06 07:42:03 +00:00
Qiu Qichen 98d1e8d5a3 comment some facility for net 2023-05-06 16:44:26 +08:00
Qiu Qichen eec88cdce6 remove some debug print and temporarily replace `evl_printf` in oob-net-icmp.c 2023-05-05 21:32:39 +08:00
Qiu Qichen 5c9b2fa8d0 libevl: a debug version for rros(remove output version) 2023-05-01 12:32:36 +08:00
Philippe Gerum 50d5fb12eb utils: add start, stop commands
These scripts issue the proper commands via the /sys interface to
start and stop the EVL core.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2021-09-19 12:45:38 +02:00
Philippe Gerum eb605ec762 lib/init: factor out generic vDSO lookup task
There is no point in specializing the resolution of clock_gettime() in
the vDSO on a per-arch basis. This is mostly generic code with only a
couple of arch-specific identifiers we need, which we can leave into
the arch/ area.

Move the bulk of the symbol resolution code to the generic init
routine, adding asm/evl/vdso.h for storing the few arch-specific bits
such code still depends on.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2021-09-19 12:04:16 +02:00
Philippe Gerum 23c4c56e62 tests: poll-multiple: fix trashing of iteration variable
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2021-09-18 23:24:13 +02:00
Philippe Gerum ea8c7d2a72 tests: poll many sources from many threads
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2021-09-18 23:24:13 +02:00
Philippe Gerum d68cc3b676 tests: poll multiple sources concurrently
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2021-09-11 12:09:33 +02:00
Philippe Gerum aca56e0e89 make: force _FORTIFY_SOURCE off in debug mode
_FORTIFY_SOURCE requires the optimizer to be enabled. Make sure to
force the former off when we disable the latter.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2021-09-11 11:42:11 +02:00
Philippe Gerum a234917781 lib/socket: make zerotime definition a global constant
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2021-09-11 11:42:11 +02:00
Philippe Gerum 5a76d99ac3 lib/sem: have evl_open_sem() return -ENXIO when due
-ENXIO is the conventional error code signaling that the caller has
 issued a syscall without being attached to the core. Make sure
 evl_open_sem() detects this and bails out early.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2021-09-11 09:33:42 +02:00
Philippe Gerum 1489e7dddd make: accept preset toolchain variables
Use the preset values of CC, CXX, LD, AR if already defined in the
environment.

This is typically required for building libevl with the Yocto SDK,
with the settings sourced from the environment-setup script.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2021-09-05 16:11:53 +02:00
Philippe Gerum 41dc88ab52 lib: add socket interface
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2021-08-21 18:13:57 +02:00
Philippe Gerum 70a49e4a18 utils: ps: display WCHAN with option -w
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2021-08-21 18:13:57 +02:00
Philippe Gerum c5dd9ab292 utils: evl-trace: fix implicit enable-all command
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2021-08-03 19:14:26 +02:00
Philippe Gerum a1ac1ac659 utils: evl/test: silence pedantic warning from 'find'
Address this warning from the 'find' command used in the evl-test
script:

"find: warning: you have specified the global option -maxdepth after
the argument -type, but global options are not positional, i.e.,
-maxdepth affects tests specified before it as well as those specified
after it.  Please specify global options before other arguments."
2021-06-30 15:04:17 +02:00
Philippe Gerum c929030704 tests/fault: check uaccess fault handling
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2021-06-13 11:34:31 +02:00
Philippe Gerum d12db5d268 tidbits/oob-spi: add a few more documentation hints
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2021-05-13 19:00:13 +02:00
Philippe Gerum edb5af7fb7 include/tube: fix queue remove/add race
A receiver could get a spurious empty tube status, due to
receive_tube() racing with send_tube(). See the added comments into
the code for details about the resolution.

At this chance, guard against load/store tearing on shared pointers.

Pending issue: we still have a potential connectivity issue between
the prep and finish ops when pushing to a tube.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2021-03-01 19:07:10 +01:00
Philippe Gerum d9443e0ecd evl/utils: trace: add latmus tracepoints to irq group
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2021-02-07 18:35:16 +01:00
Philippe Gerum a4eb6b4552 evl/utils: trace: add pick_next tracepoint to timer group
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2021-02-07 12:37:52 +01:00
Philippe Gerum 50706c585f evl/utils: check: detect CONFIG_FTRACE
Enabling the ftrace infrastructure causes runtime overhead which is
noticeable in latmus figures, even with dynamic tracepoints
disabled. Warn about CONFIG_FTRACE being enabled.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2021-02-07 12:34:31 +01:00
Philippe Gerum 9bf275a2be utils/evl: checklist: fix core debug checks
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2021-02-07 12:09:38 +01:00
Philippe Gerum 969ec9c170 utils: evl-trace: add support for trace groups
It comes in handy to be able to enable a set of related tracepoints
for specific tracing purposes.

The -e option can now take an optional parameter specifying a
pre-defined group of related tracepoints to enable, so far:

irq = pipeline_entry, pipeline_exit, handler_entry, handler_exit
timer = tracepoints related to timer event handling with latmus (used in
chasing latency in the timer handling path)
evl = all core tracepoints
all = all tracepoints ftrace knows about

-eall is identical to -f.

-E<tracepoint_file> enables the tracepoints mentioned in the
 user-provided <file>.

-t can be passed to dry-run the enable command, getting the list of
 ftrace settings which would have been set without this option when
 enabling the trace.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2021-02-07 11:59:58 +01:00
Philippe Gerum d254a1182b utils: evl: alpha-sort test list for all ops
Having a predictable sequence for testing and listing is handy. In
addition, ensure that shim tests are listed last.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-12-13 16:17:09 +01:00
Philippe Gerum 354e0eb91e lib/thread: move evl_detach_self() out of line
Refrain from inlining core services, so that interposing on them via
dynamic linking tricks is made easier.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-12-13 12:33:17 +01:00
Philippe Gerum 04db253a39 lib/thread: hide low-level details from applications
evl_get_current() contains implementation details which are definitely
not part of the API and the way this works should not be exposed.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-12-13 12:29:25 +01:00
Philippe Gerum 6c7838c862 lib/heap: move stats accessors out of line
Refrain from inlining core services, so that interposing on them via
dynamic linking tricks is made easier.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-12-13 12:14:01 +01:00
Philippe Gerum 03baa08b76 lib/clock: move evl_read_clock() out of line
What evl_read_clock() does is non-trivial, enough to call for an out
of line implementation.

In general, refrain from inlining core services, so that interposing
on them via dynamic linking tricks is made easier.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-12-13 12:08:03 +01:00
Philippe Gerum 455b4f176c include/compiler: drop likely/unlikely annotations
We have no more in-tree users of these. Besides, let's assume that the
CPU's branch predictor always has better clues than we might have when
assessing the likeliness of a condition.

Bonus: this clears a recurring source of namespace clashes with C++
frameworks like Boost.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-12-12 19:11:42 +01:00
Philippe Gerum 4be045bb76 include/tube: remove likely branch annotations
In user-space at least, we'd be better off trusting the CPU's branch
predictor, instead of relying on our limited perception when it comes
to determining the likeliness of a condition, or every compiler to do
the right thing with respect to efficient branching.

We only have a couple of likely predictions in-tree on straightforward
conditions from the tube implementation code, which we can remove
safely.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-12-12 19:10:43 +01:00
Philippe Gerum 8386dba237 tests: observable-hm: T_WOLI might be preset
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-12-12 19:06:35 +01:00
Philippe Gerum f6587742b7 tests: thread-mode-bits: T_WOLI might be preset - take #2
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-12-12 19:03:49 +01:00
Philippe Gerum 57b78404a1 tests: thread-mode-bits: fix regression (lingering debug code)
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-11-11 19:25:54 +01:00
Philippe Gerum 4cfd6a0a91 tests: thread-mode-bits: T_WOLI might be preset
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-11-10 16:04:14 +01:00
lio f20f616ff7 lib:fix possible returning EINVAL when evl_attach* called by SCHED_RR threads
When evl_attach_thread() was called,  a local stack variable *attrs* will copy-
from-user to linux-evl. The problem is that *attrs* initializes only two of its
members:attrs.sched_policy and attrs.sched_priority, but none of the other
members are initialized.

These uninitialized may be "zero" or any other random values, for example:
attrs->sched_rr_quantum may be some none-zero value when the threads under
discussion is a SCHED_RR task.
In this case, *attrs* copyed to linux-evl in *thread_common_ioctl()*, and
attrs->sched_rr_quantum is none-zero value; then fllowed call *set_time_slice*
will lead to a -EINVAL return for meet *quantum <= evl_get_clock_gravity()*.

This patch will initialize all members of *attrs* to zero.

Signed-off-by: lio <liu.hailong6@zte.com.cn>
2020-09-20 16:27:25 +02:00
Philippe Gerum f2a20b519d utils: evl-trace: force enable/disable tracing on -e/-d
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-09-13 17:50:59 +02:00
lio 560f70dc20 libevl: fix the compile failed caused by the Wshadow flag
Libevl use *-Wshadow=local* flags in config.mk. However this flag is
only valid when version >=7, otherwise gcc will complain :
"unrecognized command line option ‘-Wshadow=local’; did you mean
‘-Wshadow-ivar’?"
and compile will be failed.

This patch fix this probelm.

Signed-off-by: lio <liu.hailong6@zte.com.cn>
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-07-16 18:28:42 +02:00
Philippe Gerum 2fe7e81775 utils: checklist: mark CONFIG_DEBUG_ENTRY as latency hog
Kernel entry instrumentation/debug code has to run in the hot path by
definition, add it to the list of settings which may increase
latency. This feature is only available for x86 as of kernel 5.8, but
it is likely going to spread all over the place in the future, so
register it as generic.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-07-16 10:23:25 +02:00
Philippe Gerum 641381396b tests: fpu-stress: check usleep status
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-07-04 18:27:00 +02:00
Philippe Gerum 4148aaba5c benchmark/latmus: latmon: re-instate warm-up time
Add back a 1s warm-up time, making sure not to include the delta
values collected during this period in the histogram distribution this
time.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-06-14 22:35:08 +02:00
Philippe Gerum cc27f3c08c benchmark/latmus: reinstate warm-up time
We cannot rule out one-time PTE misses at startup. Add back a 1s
warm-up time for the unusual case.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-06-14 22:35:08 +02:00
Philippe Gerum 936572d78d benchmarks/latmus: make sure to parse last bulk of samples
We may not get back to the test sitter upon signal (SIGINT/SIGALRM),
so move the code parsing the last data bulk behind the sigwait() call
instead.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-06-14 19:31:43 +02:00
Philippe Gerum 1fcb27776a benchmarks/latmus: do not display priority if n/a
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-06-01 12:02:17 +02:00