Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
comparison probes.c @ 81:a214c84dff4e
malloc_touch
| author | Merten Sach <msach@mailbox.tu-berlin.de> |
|---|---|
| date | Mon, 11 Jul 2011 20:35:54 +0200 |
| parents | 13b22ffb8a2f |
| children | 96e273d9f66f 0320b49ca013 |
comparison
equal
deleted
inserted
replaced
| 7:b286608ae8e6 | 8:ee75f63fd44f |
|---|---|
| 3 * | 3 * |
| 4 * Licensed under BSD | 4 * Licensed under BSD |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 #include <stdlib.h> | |
| 9 #include <malloc.h> | 8 #include <malloc.h> |
| 10 #include <sys/time.h> | 9 #include <sys/time.h> |
| 11 #include <string.h> | |
| 12 | 10 |
| 13 #include "VMS.h" | 11 #include "VMS.h" |
| 14 #include "Queue_impl/BlockingQueue.h" | 12 #include "Queue_impl/BlockingQueue.h" |
| 15 #include "Histogram/Histogram.h" | 13 #include "Histogram/Histogram.h" |
| 16 | 14 |
| 109 * the dynamic array in the master env is only modified from the master | 107 * the dynamic array in the master env is only modified from the master |
| 110 * | 108 * |
| 111 */ | 109 */ |
| 112 IntervalProbe * | 110 IntervalProbe * |
| 113 create_generic_probe( char *nameStr, VirtProcr *animPr ) | 111 create_generic_probe( char *nameStr, VirtProcr *animPr ) |
| 114 { IntervalProbe *newProbe; | 112 { |
| 115 VMSSemReq reqData; | 113 VMSSemReq reqData; |
| 116 | 114 |
| 117 reqData.reqType = createProbe; | 115 reqData.reqType = createProbe; |
| 118 reqData.nameStr = nameStr; | 116 reqData.nameStr = nameStr; |
| 119 | 117 |
| 295 void | 293 void |
| 296 print_probe_helper( IntervalProbe *probe ) | 294 print_probe_helper( IntervalProbe *probe ) |
| 297 { | 295 { |
| 298 printf( "\nprobe: %s, ", probe->nameStr ); | 296 printf( "\nprobe: %s, ", probe->nameStr ); |
| 299 | 297 |
| 298 | |
| 300 if( probe->schedChoiceWasRecorded ) | 299 if( probe->schedChoiceWasRecorded ) |
| 301 { printf( "coreNum: %d, procrID: %d, procrCreated: %.6lf | ", | 300 { printf( "coreNum: %d, procrID: %d, procrCreated: %0.6f | ", |
| 302 probe->coreNum, probe->procrID, probe->procrCreateSecs ); | 301 probe->coreNum, probe->procrID, probe->procrCreateSecs ); |
| 303 } | 302 } |
| 304 | 303 |
| 305 if( probe->endSecs == 0 ) //just a single point in time | 304 if( probe->endSecs == 0 ) //just a single point in time |
| 306 { | 305 { |
| 307 printf( " time point: %.6lf\n", | 306 printf( " time point: %.6f\n", |
| 308 probe->startSecs - _VMSMasterEnv->createPtInSecs ); | 307 probe->startSecs - _VMSMasterEnv->createPtInSecs ); |
| 309 } | 308 } |
| 310 else if( probe->hist == NULL ) //just an interval | 309 else if( probe->hist == NULL ) //just an interval |
| 311 { | 310 { |
| 312 printf( " startSecs: %.6lf, interval: %.6lf\n", | 311 printf( " startSecs: %.6f interval: %.6f\n", |
| 313 probe->startSecs - _VMSMasterEnv->createPtInSecs, probe->interval); | 312 (probe->startSecs - _VMSMasterEnv->createPtInSecs), probe->interval); |
| 314 } | 313 } |
| 315 else //a full histogram of intervals | 314 else //a full histogram of intervals |
| 316 { | 315 { |
| 317 printDblHist( probe->hist ); | 316 printDblHist( probe->hist ); |
| 318 } | 317 } |
| 336 | 335 |
| 337 inline void doNothing(){}; | 336 inline void doNothing(){}; |
| 338 | 337 |
| 339 void | 338 void |
| 340 generic_print_probe( void *_probe ) | 339 generic_print_probe( void *_probe ) |
| 341 { IntervalProbe *probe; | 340 { |
| 342 | 341 IntervalProbe *probe = (IntervalProbe *)_probe; |
| 343 probe = (IntervalProbe *)_probe; | 342 |
| 344 print_probe_helper( probe ); | 343 //TODO segfault in printf |
| 344 //print_probe_helper( probe ); | |
| 345 } | 345 } |
| 346 | 346 |
| 347 void | 347 void |
| 348 VMS_impl__print_stats_of_all_probes() | 348 VMS_impl__print_stats_of_all_probes() |
| 349 { IntervalProbe *probe; | 349 { |
| 350 | |
| 351 forAllInDynArrayDo( _VMSMasterEnv->dynIntervalProbesInfo, | 350 forAllInDynArrayDo( _VMSMasterEnv->dynIntervalProbesInfo, |
| 352 &generic_print_probe ); | 351 &generic_print_probe ); |
| 353 fflush( stdout ); | 352 fflush( stdout ); |
| 354 } | 353 } |
| 355 #endif | 354 #endif |
