How to get the value of the offset_ns?

Hi sir
we can see the value of the node /sys/devices/system/clocksource/clocksources0/offset_ns. And it indicate the difference between RTCPU time and system kernel time. So Is there any kernel API to get the RTCPU time?

Please check below note.

/*
 * Falcon/RCE use TSC for SOF and EOF timestamp and statsEngine timestamp.
 *
 * For Linux, TSC has constant offset with Linux MONOTONIC RAW after system boot
 * and suspend/resume. With sysfs node offset_ns provide this offset, nvcapture update
 * this static value in channel open and client can use NvCaptureConvertTimestamp
 * API to convert the SOF and EOF timestamp from TSC to MONOTONIC RAW.
 * when Linux client want to compare with it, they also need to use
 * MONOTONIC RAW instead of MONOTONIC and NvOsGetTimeMS/US because these two
 * will be affected by NTP.
 *
 * For QNX, the sysfs does not exist, so the offset is 0 and NvCaptureConvertTimestamp
 * API do simple assignment.
 */