00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "config.h"
00019
00020 #include <stdlib.h>
00021
00022 #include "instrumentation.h"
00023
00024 #if defined(INSTR_test_data)
00025 static struct iPoint INSTR_test_point = {
00026 INSTR_test_data
00027 };
00028 #endif
00029
00030 int main(int argc, char *argv[])
00031 {
00032 int retval = 0;
00033
00034 instrumentation_data.iid_OutputFileName = "-";
00035 atexit(iPrintPointsAtExit);
00036
00037 {
00038 static double hrtime_test_history[8];
00039 static struct iPoint hrtime_test_point = {
00040 "hrtime",
00041 "test of hrtime() function",
00042 IPF_PRINT_HISTORY,
00043 IPOINT_INIT_HISTORY(hrtime_test_history),
00044 "%8.0f ",
00045 };
00046
00047 hrtime_t start, end;
00048 int lpc;
00049
00050 for( lpc = 0; lpc < 10; lpc++ )
00051 {
00052 volatile int delay;
00053
00054 start = hrtime();
00055 for( delay = 0; delay < 1000; delay++ );
00056 end = hrtime();
00057 iPostFloatData(&hrtime_test_point, (end - start));
00058 }
00059 }
00060
00061 INSTR_test(&INSTR_test_point, {
00062 printf("Hello, World!\n");
00063 });
00064
00065 INSTR_notest(&INSTR_notest_point, {
00066 printf("Goodbye, World!\n");
00067 });
00068
00069 return( retval );
00070 }