This API is used by program running on the Real-Time host to print messages prefixed with a TSC time stamp.
The time stamp is consistent across all processes running under SimWB.
◆ getCpuTicks()
Get the speed of the system so we can convert TSC ticks to micro seconds.
Warning: this function is non deterministic since it reads the /proc file system to get the CPU speed. Use the macro _rdtsc() defined in tscutils.h to get the TSC count.
To time a secion of code you would use:
unsigned long long t1;
t1 = _rdtsc();
.
.
Your code here
.
.
t2 = _rdtsc();
usec = (t2-t1)/cputicks;
int getCpuTicks()
Definition tscutils.c:121
- Returns
- System speed in MHz.
◆ ccurTSC_printf()
| int ccurTSC_printf |
( |
const char * | fmt, |
|
|
| ... ) |
Print to stderr a la printf and prefix with a TSC time stamp
- Parameters
-
| fmt | String with format specifier. |
- Returns
- The length of the string that was printed.
◆ ccurTSC_fprintf()
| int ccurTSC_fprintf |
( |
FILE * | fp, |
|
|
const char * | fmt, |
|
|
| ... ) |
Print to file pointer fp a la printf and prefix with a TSC time stamp
- Parameters
-
| fp | FILE pointer. The file must have been open with a 'C' fp = fopen(filename,"w") prior to this call |
| fmt | String with format specifier. |
- Returns
- The length of the string that was printed.