mbgtools-lx
4.2.8
|
Go to the source code of this file.
Macros | |
#define | _ext extern |
Functions | |
int | chk_fast_tstamp_supp (MBG_DEV_HANDLE dh1, const PCPS_DEV *p_dev_1, MBG_DEV_HANDLE dh2, const PCPS_DEV *p_dev_2, MBG_ERR_MSG_FNC err_msg_fnc) |
Check if both devices support fast HR timestamps. More... | |
int | get_htc_timestamps (MBG_DEV_HANDLE dh1, PCPS_HR_TIME_CYCLES *p_htc1, MBG_DEV_HANDLE dh2, PCPS_HR_TIME_CYCLES *p_htc2, int read_fast) |
Read timestamps and cycles from both devices. More... | |
double | get_htc_delta (const PCPS_HR_TIME_CYCLES *p_htc, const PCPS_HR_TIME_CYCLES *p_htc_ref, double *p_delta_ts, double *p_delta_cyc) |
Compute the delta cycles and time difference. More... | |
int | mbg_snprint_hr_tstamp_ext (char *s, int max_len, const PCPS_TIME_STAMP *p, int print_raw) |
Print UTC date and time from a PCPS_TIME_STAMP structure to a string. More... | |
int | mbg_snprint_hr_time_loc (char *s, size_t max_len, const PCPS_HR_TIME *p) |
Print local date and time from a PCPS_TIME_STAMP structure to a string. More... | |
Variables | |
MBG_PC_CYCLES_FREQUENCY | cyc_freq |
Must be set up tby the application. More... | |
#define _ext extern |
Definition at line 35 of file cmp_time_util.h.
int chk_fast_tstamp_supp | ( | MBG_DEV_HANDLE | dh1, |
const PCPS_DEV * | p_dev_1, | ||
MBG_DEV_HANDLE | dh2, | ||
const PCPS_DEV * | p_dev_2, | ||
MBG_ERR_MSG_FNC | err_msg_fnc | ||
) |
Check if both devices support fast HR timestamps.
[in] | dh1 | Handle of the first device |
[in] | p_dev_1 | Device info of the first device |
[in] | dh2 | Handle of the second device |
[in] | p_dev_2 | Device info of the second device |
[in] | err_msg_fnc | Pointer to a function to be called in case of error |
Definition at line 54 of file cmp_time_util.c.
References chk_feat_supp(), mbg_chk_dev_has_fast_hr_timestamp, and mbg_rc_is_success.
Referenced by do_mbgcmptime().
double get_htc_delta | ( | const PCPS_HR_TIME_CYCLES * | p_htc, |
const PCPS_HR_TIME_CYCLES * | p_htc_ref, | ||
double * | p_delta_ts, | ||
double * | p_delta_cyc | ||
) |
Compute the delta cycles and time difference.
[in] | p_htc | Timestamp/cycles t from device under test. |
[in] | p_htc_ref | Timestamp/cycles t_ref from reference device. |
[out] | p_delta_ts | Pointer to save time difference (t - tref), can be NULL. |
[out] | p_delta_cyc | Pointer to save delta cycles (t - tref), can be NULL. |
Definition at line 140 of file cmp_time_util.c.
References cyc_freq, PCPS_HR_TIME_CYCLES::cycles, dfrac_sec_from_bin(), PCPS_TIME_STAMP::frac, PCPS_TIME_STAMP::sec, PCPS_HR_TIME_CYCLES::t, and PCPS_HR_TIME::tstamp.
Referenced by do_mbgcmptime().
int get_htc_timestamps | ( | MBG_DEV_HANDLE | dh1, |
PCPS_HR_TIME_CYCLES * | p_htc1, | ||
MBG_DEV_HANDLE | dh2, | ||
PCPS_HR_TIME_CYCLES * | p_htc2, | ||
int | read_fast | ||
) |
Read timestamps and cycles from both devices.
[in] | dh1 | Handle of the first device |
[out] | p_htc1 | Timestamp and cycles read from the first device |
[in] | dh2 | Handle of the second device |
[out] | p_htc2 | Timestamp and cycles read from the first device |
[in] | read_fast | Flag indicating that fast timestamps should be read |
Definition at line 85 of file cmp_time_util.c.
References mbg_cond_err_msg(), mbg_get_fast_hr_timestamp_cycles(), mbg_get_hr_time_cycles(), and setup_hr_time_cycles_from_timestamp_cycles().
Referenced by do_mbgcmptime().
int mbg_snprint_hr_time_loc | ( | char * | s, |
size_t | max_len, | ||
const PCPS_HR_TIME * | p | ||
) |
Print local date and time from a PCPS_TIME_STAMP structure to a string.
This function is mostly similar to mbg_snprint_hr_tstamp, but optionally appends the raw timestamp instead of inserting it at the beginning.
[out] | s | Address of a string buffer to be filled. |
[in] | max_len | Size of the string buffer. |
[in] | p | Pointer to a PCPS_TIME_STAMP structure to be evaluated. |
Definition at line 220 of file cmp_time_util.c.
References _int_from_size_t, mbg_snprint_hr_tstamp(), mbg_snprintf(), mbg_str_pcps_hr_time_offs(), PCPS_UTC, snprintf_safe(), PCPS_HR_TIME::status, PCPS_HR_TIME::tstamp, and PCPS_HR_TIME::utc_offs.
int mbg_snprint_hr_tstamp_ext | ( | char * | s, |
int | max_len, | ||
const PCPS_TIME_STAMP * | p, | ||
int | print_raw | ||
) |
Print UTC date and time from a PCPS_TIME_STAMP structure to a string.
This function is mostly similar to mbg_snprint_hr_tstamp, but optionally appends the raw timestamp instead of inserting it at the beginning.
[out] | s | Address of a string buffer to be filled. |
[in] | max_len | Size of the string buffer. |
[in] | p | Pointer to a PCPS_TIME_STAMP structure to be evaluated. |
[in] | print_raw | Flag indicating if a raw timestamp (hex) is to be appended. |
Definition at line 188 of file cmp_time_util.c.
References PCPS_TIME_STAMP::frac, mbg_snprint_hr_tstamp(), and PCPS_TIME_STAMP::sec.
Referenced by do_mbgcmptime().
MBG_PC_CYCLES_FREQUENCY cyc_freq |
Must be set up tby the application.
Definition at line 72 of file mbgcmptime.c.
Referenced by do_mbgcmptime(), and do_mbgsvctasks().