mbgtools-lx  4.2.8
chk_time_info.h
Go to the documentation of this file.
1 
2 /**************************************************************************
3  *
4  * $Id: chk_time_info.h 1.4 2019/02/08 10:30:36 martin REL_M $
5  *
6  * Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany
7  *
8  * Description:
9  * Definitions and prototypes for chk_time_info.c.
10  *
11  * -----------------------------------------------------------------------
12  * $Log: chk_time_info.h $
13  * Revision 1.4 2019/02/08 10:30:36 martin
14  * Renamed some symbols.
15  * Added doxygen comments.
16  * Updated function prototypes.
17  * Revision 1.3 2017/07/05 09:01:46 martin
18  * Tiny cleanup.
19  * Updated function prototypes.
20  * Revision 1.2 2013/03/04 16:02:31 martin
21  * Updated function prototypes.
22  * Revision 1.1 2012/05/29 09:52:27 martin
23  * Initial revision.
24  *
25  **************************************************************************/
26 
27 #ifndef _CHK_TIME_INFO_H
28 #define _CHK_TIME_INFO_H
29 
30 
31 /* Other headers to be included */
32 
33 #include <mbgdevio.h>
34 
35 
36 #ifdef _CHK_TIME_INFO
37  #define _ext
38  #define _DO_INIT
39 #else
40  #define _ext extern
41 #endif
42 
43 
44 /* Start of header body */
45 
46 #if 0 && defined( _USE_PACK ) // use default alignment
47  #pragma pack( 1 ) // set byte alignment
48  #define _USING_BYTE_ALIGNMENT
49 #endif
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 
56 #if !defined( MAX_CYCLES_FILTER_ENTRIES )
57  #define MAX_CYCLES_FILTER_ENTRIES 32
58 #endif
59 
60 
61 
67 typedef struct
68 {
71  int entries;
72  int index;
73 
75 
76 
77 
83 typedef struct
84 {
86 
90 
91  double ltcy_sec;
92  double exec_sec;
93  double exec_sec_limit;
94 
95  double d_sys;
96  double d_ref;
97  double d_ref_comp;
98 
100 
101 
102 
103 /* ----- function prototypes begin ----- */
104 
105 /* This section was generated automatically */
106 /* by MAKEHDR, do not remove the comments. */
107 
143  int mbg_chk_time_info( MBG_DEV_HANDLE dh, MBG_CHK_TIME_INFO *p, CYCLES_FILTER_DATA *p_filter, int fast_ts_only ) ;
144 
159  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 ) ;
160 
161 
162 /* ----- function prototypes end ----- */
163 
164 #ifdef __cplusplus
165 }
166 #endif
167 
168 
169 #if defined( _USING_BYTE_ALIGNMENT )
170  #pragma pack() // set default alignment
171  #undef _USING_BYTE_ALIGNMENT
172 #endif
173 
174 /* End of header body */
175 
176 
177 #undef _ext
178 #undef _DO_INIT
179 
180 #endif /* _CHK_TIME_INFO_H */
181 
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.
High resolution device time, system time, and associated cycles counts.
Definition: pcpsdev.h:1418
MBG_PC_CYCLES exec_cyc
Computed execution time of the call, in [cycles].
Definition: chk_time_info.h:88
#define MAX_CYCLES_FILTER_ENTRIES
Definition: chk_time_info.h:57
double d_ref
Raw reference timestamp in floating point format, [s].
Definition: chk_time_info.h:96
static int print_raw
Definition: mbgcmptime.c:63
double exec_sec_limit
Execution time limit, in [s]. Only available if cycles frequency is known.
Definition: chk_time_info.h:93
int index
Index of the "current" cycles value.
Definition: chk_time_info.h:72
double d_ref_comp
Compensated reference timestamp in floating point format, [s].
Definition: chk_time_info.h:97
MBG_TIME_INFO_HRT hrti
System time, device time, and cycles read from the driver.
Definition: chk_time_info.h:85
double ltcy_sec
Computed latency of the call, in [s]. Only available if cycles frequency is known.
Definition: chk_time_info.h:91
A structure to store the results of the mbg_chk_time_info routine.
Definition: chk_time_info.h:83
MBG_PC_CYCLES sum
The current sum of the cycles values.
Definition: chk_time_info.h:70
MBG_PC_CYCLES exec_cyc_limit
Execution time limit, in [cycles], computed based on usual execution time.
Definition: chk_time_info.h:89
double exec_sec
Computed execution time of the call, in [s]. Only available if cycles frequency is known...
Definition: chk_time_info.h:92
MBG_PC_CYCLES ltcy_cyc
Computed latency of the call, in [cycles].
Definition: chk_time_info.h:87
static int frac_digits
Definition: mbgsvcd.c:91
int entries
The number of cycles values already saved.
Definition: chk_time_info.h:71
int64_t MBG_PC_CYCLES
Generic types to hold PC cycle counter values.
Definition: mbgpccyc.h:97
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 structure to keep filter data for cycles values.
Definition: chk_time_info.h:67
double d_sys
System timestamp in floating point format, [s].
Definition: chk_time_info.h:95
Device info structure.
Definition: pcpsdev.h:1043