mbgtools-lx
4.2.8
|
Go to the source code of this file.
Macros | |
#define | _CHK_TIME_INFO |
Functions | |
static MBG_PC_CYCLES | do_filter (CYCLES_FILTER_DATA *p, MBG_PC_CYCLES cyc) |
Compute the mean value of a number of cycles. More... | |
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. More... | |
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. More... | |
Variables | |
MBG_PC_CYCLES_FREQUENCY | cyc_freq |
#define _CHK_TIME_INFO |
Definition at line 31 of file chk_time_info.c.
|
static |
Compute the mean value of a number of cycles.
[in,out] | p | Address of a CYCLES_FILTER_DATA structure that needs to be updated. |
[in] | cyc | The last recent cycles value to be taken into account. |
p
. Definition at line 60 of file chk_time_info.c.
References CYCLES_FILTER_DATA::cyc, CYCLES_FILTER_DATA::entries, CYCLES_FILTER_DATA::index, MAX_CYCLES_FILTER_ENTRIES, and CYCLES_FILTER_DATA::sum.
Referenced by mbg_chk_time_info().
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.
The device timestamp is considered as reference timestamp.
Usually the fast_ts_only
flag should be 0, in which case a PCPS_HR_TIME is read from the device in conjunction with the system timestamp.
If the fast_ts_only
flag is not 0 then only a PCPS_TIME_STAMP instead of a PCPS_HR_TIME is read in conjunction with the system timestamp. In this case the call executes faster, but this is only supported if the device supports memory mapped timestamps (see chk_fast_tstamp_supp). Also, the returned data doesn't include the device status information in this case.
Once the device system timestamp / reference timestamp pair has been read successfully, the associated cycles values are evaluated to simplify further processing by the calling application.
[in] | dh | Valid MBG_DEV_HANDLE handle to a Meinberg device. |
[out] | p | Pointer to a POUT_SETTINGS_IDX structure to be written. |
[in,out] | p_filter | Optional address of a CYCLES_FILTER_DATA instance associated with the device that is referenced by dh . If this parameter is not NULL then |
[in] | fast_ts_only | A flag indicating that only a PCPS_TIME_STAMP instead of a PCPS_HR_TIME is to be read in conjunction with the system timestamp, usually 0. |
Definition at line 115 of file chk_time_info.c.
References MBG_SYS_TIME_CYCLES::cyc_after, MBG_SYS_TIME_CYCLES::cyc_before, cyc_freq, PCPS_HR_TIME_CYCLES::cycles, MBG_CHK_TIME_INFO::d_ref, MBG_CHK_TIME_INFO::d_ref_comp, MBG_CHK_TIME_INFO::d_sys, do_filter(), MBG_CHK_TIME_INFO::exec_cyc, MBG_CHK_TIME_INFO::exec_cyc_limit, MBG_CHK_TIME_INFO::exec_sec, MBG_CHK_TIME_INFO::exec_sec_limit, PCPS_TIME_STAMP::frac, MBG_CHK_TIME_INFO::hrti, MBG_CHK_TIME_INFO::ltcy_cyc, MBG_CHK_TIME_INFO::ltcy_sec, mbg_delta_pc_cycles(), MBG_FRAC32_UNITS_PER_SEC, mbg_get_time_info_hrt(), mbg_get_time_info_tstamp(), mbg_rc_is_error, MBG_SUCCESS, NANO_TIME_64::nano_secs, NSEC_PER_SEC, MBG_TIME_INFO_HRT::ref_hr_time_cycles, MBG_TIME_INFO_TSTAMP::ref_tstamp_cycles, PCPS_TIME_STAMP::sec, NANO_TIME_64::secs, setup_hr_time_cycles_from_timestamp_cycles(), MBG_SYS_TIME_CYCLES::sys_time, MBG_TIME_INFO_HRT::sys_time_cycles, MBG_TIME_INFO_TSTAMP::sys_time_cycles, PCPS_HR_TIME_CYCLES::t, and PCPS_HR_TIME::tstamp.
Referenced by do_mbgsvctasks().
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.
[out] | s | The string buffer to be filled. |
[in] | max_len | Size of the output buffer for 0-terminated string. |
[in] | p | Pointer to a MBG_CHK_TIME_INFO to be evaluated. |
[in] | p_dev | |
[in] | frac_digits | |
[in] | print_raw |
Definition at line 206 of file chk_time_info.c.
References _int_from_size_t, _pcps_type_name, cyc_freq, MBG_CHK_TIME_INFO::d_ref, MBG_CHK_TIME_INFO::d_ref_comp, MBG_CHK_TIME_INFO::d_sys, MBG_CHK_TIME_INFO::exec_cyc, MBG_CHK_TIME_INFO::exec_cyc_limit, MBG_CHK_TIME_INFO::exec_sec, MBG_CHK_TIME_INFO::exec_sec_limit, MBG_CHK_TIME_INFO::hrti, MBG_CHK_TIME_INFO::ltcy_cyc, MBG_CHK_TIME_INFO::ltcy_sec, mbg_snprint_hr_tstamp(), MBG_TIME_INFO_HRT::ref_hr_time_cycles, snprintf_safe(), PCPS_HR_TIME_CYCLES::t, and PCPS_HR_TIME::tstamp.
Referenced by do_mbgsvctasks().
MBG_PC_CYCLES_FREQUENCY cyc_freq |
Definition at line 72 of file mbgcmptime.c.
Referenced by mbg_chk_time_info(), and snprint_chk_time_info().