Hello, Systemwide traces would require the same clock, so Linux processes use CLOCK_MONOTONIC (they normally do by default), Kernel traces should do so too (ktime_get_mono_fast_ns). Xenomai Processes/Thread have no reliable to produce matching traces. The idea would be to configure the tracing frameworks to use the new CLOCK_HOST_MONOTONIC for those. As concrete example, Lttng would use a clock plugin (only) for Xenomai.
I looked at the kernel sources if I can add this myself quickly, but seems to be involve some stuff like kevents which I know nothing about (killing the “quickly” part at the very least). The request would be that - Similar to CLOCK_HOST_REALTIME, a CLOCK_HOST_MONOTONIC would result in timestamps that a very close to the plain Linux CLOCK_MONOTONIC. - This should happen without syscalls and be very efficient - In respect to being able to attach preloaded tracer dso’s (like tracing malloc/free), the call should work correctly before cobalt is initialized (could be worked around, but still..) Other alternatives (most not realistic): Calling the linux vdso functions might result in deadlocks [1]. A “safe” variant like ktime_get_mono_fast_ns is not accessible per syscall or userspace vDSO. The normal xenomai CLOCK_MONOTONIC is not skew corrected to REALTIME CLOCK_MONOTONIC_RAW perhaps might be easily convertible between domains, but likely problematic on several CPUs (unstable TSC, not in sync between CPUs) As a sidenote, recent Kernels (5.3?) have a cleaned up and unified vDSO framework, Potentially could grab stuff from there. [1] - https://www.xenomai.org/pipermail/xenomai/2018-December/040134.html ________________________________ This message and any attachments are solely for the use of the intended recipients. They may contain privileged and/or confidential information or other information protected from disclosure. If you are not an intended recipient, you are hereby notified that you received this email in error and that any review, dissemination, distribution or copying of this email and any attachment is strictly prohibited. If you have received this email in error, please contact the sender and delete the message and any attachment from your system. ANDRITZ HYDRO GmbH Rechtsform/ Legal form: Gesellschaft mit beschränkter Haftung / Corporation Firmensitz/ Registered seat: Wien Firmenbuchgericht/ Court of registry: Handelsgericht Wien Firmenbuchnummer/ Company registration: FN 61833 g DVR: 0605077 UID-Nr.: ATU14756806 Thank You ________________________________