31 #define _CHK_TIME_INFO 123 memset( p, 0,
sizeof( *p ) );
217 frac_digits, p->
d_ref,
218 frac_digits, p->
d_sys );
226 n +=
snprintf_safe( &s[n], max_len - n,
"%.2f us, exec: %.2f us, limit: %.2f us",
231 n +=
snprintf_safe( &s[n], max_len - n,
"%" PRIi64
" cyc, exec: %" PRIi64
" cyc, limit: %" PRIi64
" cyc",
MBG_PC_CYCLES exec_cyc
Computed execution time of the call, in [cycles].
#define MAX_CYCLES_FILTER_ENTRIES
MBG_SYS_TIME_CYCLES sys_time_cycles
system time stamp plus associated cycles
static MBG_PC_CYCLES do_filter(CYCLES_FILTER_DATA *p, MBG_PC_CYCLES cyc)
Compute the mean value of a number of cycles.
System time plus associated cycles counter values.
PCPS_SECONDS sec
seconds since 1970, usually UTC scale
#define _int_from_size_t(_n)
double d_ref
Raw reference timestamp in floating point format, [s].
MBG_PC_CYCLES cyc_before
cycles count before sys time is read
double exec_sec_limit
Execution time limit, in [s]. Only available if cycles frequency is known.
int index
Index of the "current" cycles value.
double d_ref_comp
Compensated reference timestamp in floating point format, [s].
MBG_SYS_TIME_CYCLES sys_time_cycles
system timestamp plus associated cycles
MBG_TIME_INFO_HRT hrti
System time, device time, and cycles read from the driver.
double ltcy_sec
Computed latency of the call, in [s]. Only available if cycles frequency is known.
A structure to store the results of the mbg_chk_time_info routine.
_MBG_API_ATTR int _MBG_API mbg_get_time_info_hrt(MBG_DEV_HANDLE dh, MBG_TIME_INFO_HRT *p)
Read both system time and associated device time from the kernel driver.
High resolution device time stamp, system time, and associated cycles counts.
MBG_PC_CYCLES sum
The current sum of the cycles values.
MBG_PC_CYCLES exec_cyc_limit
Execution time limit, in [cycles], computed based on usual execution time.
MBG_PC_CYCLES cyc[32]
The last recent values to be filtered.
PCPS_FRAC_32 frac
binary fractions of second, see PCPS_FRAC_32
double exec_sec
Computed execution time of the call, in [s]. Only available if cycles frequency is known...
PCPS_TIME_STAMP tstamp
High resolution time stamp (UTC)
MBG_SYS_TIME sys_time
system time stamp
PCPS_TIME_STAMP_CYCLES ref_tstamp_cycles
HR timestamp from the card, plus cycles.
MBG_PC_CYCLES ltcy_cyc
Computed latency of the call, in [cycles].
#define MBG_FRAC32_UNITS_PER_SEC
Constant used to convert e.g. PCPS_TIME_STAMP::frac values.
#define MBG_SUCCESS
Error codes used with Meinberg devices and drivers.
PCPS_HR_TIME_CYCLES ref_hr_time_cycles
HR time read from the card, plus cycles.
MBG_PC_CYCLES cyc_after
cycles count after sys time has been read
MBG_PC_CYCLES_FREQUENCY cyc_freq
int entries
The number of cycles values already saved.
uint64_t MBG_PC_CYCLES_FREQUENCY
static __mbg_inline MBG_PC_CYCLES mbg_delta_pc_cycles(const MBG_PC_CYCLES *p1, const MBG_PC_CYCLES *p2)
int mbg_chk_time_info(MBG_DEV_HANDLE dh, MBG_CHK_TIME_INFO *p, CYCLES_FILTER_DATA *p_filter, int fast_ts_only)
Read and evaluate a system timestamp / reference timestamp pair.
A high resolution time stamp.
#define _pcps_type_name(_d)
int snprintf_safe(char *s, size_t max_len, const char *fmt,...)
A portable, safe implementation of snprintf()
#define mbg_rc_is_error(_rc)
int64_t nano_secs
[nanoseconds]
_MBG_API_ATTR int _MBG_API mbg_get_time_info_tstamp(MBG_DEV_HANDLE dh, MBG_TIME_INFO_TSTAMP *p)
Read both system time and associated device timestamp from the kernel driver.
int64_t secs
[seconds], usually since 1970-01-01 00:00:00
int snprint_chk_time_info(char *s, size_t max_len, const MBG_CHK_TIME_INFO *p, const PCPS_DEV *p_dev, int frac_digits, int print_raw)
Print info from a MBG_CHK_TIME_INFO structure into a string buffer.
int64_t MBG_PC_CYCLES
Generic types to hold PC cycle counter values.
A structure to keep filter data for cycles values.
double d_sys
System timestamp in floating point format, [s].
static __mbg_inline void setup_hr_time_cycles_from_timestamp_cycles(PCPS_HR_TIME_CYCLES *p_ht_c, const PCPS_TIME_STAMP_CYCLES *p_ts_c)