Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
comparison VMS.c @ 110:724c7a0b687f
save counters to file in csv
| author | Nina Engelhardt |
|---|---|
| date | Wed, 03 Aug 2011 17:05:18 +0200 |
| parents | 659299627e70 |
| children | 43ea731da94e |
comparison
equal
deleted
inserted
replaced
| 50:549f4f51e4d4 | 51:567ee4dea225 |
|---|---|
| 185 #endif | 185 #endif |
| 186 | 186 |
| 187 MakeTheMeasHists(); | 187 MakeTheMeasHists(); |
| 188 | 188 |
| 189 #ifdef MEAS__PERF_COUNTERS | 189 #ifdef MEAS__PERF_COUNTERS |
| 190 printf("Creating HW counters..."); | 190 //printf("Creating HW counters..."); |
| 191 FILE* output; | |
| 192 int n; | |
| 193 char filename[255]; | |
| 194 for(n=0;n<255;n++) | |
| 195 { | |
| 196 sprintf(filename, "./counters/Counters.%d.dat",n); | |
| 197 output = fopen(filename,"r"); | |
| 198 if(output) | |
| 199 { | |
| 200 fclose(output); | |
| 201 }else{ | |
| 202 break; | |
| 203 } | |
| 204 } | |
| 205 printf("Saving Counter measurements to File: %s ...\n", filename); | |
| 206 output = fopen(filename,"w+"); | |
| 207 _VMSMasterEnv->counteroutput = output; | |
| 208 | |
| 191 struct perf_event_attr hw_event; | 209 struct perf_event_attr hw_event; |
| 192 memset(&hw_event,0,sizeof(hw_event)); | 210 memset(&hw_event,0,sizeof(hw_event)); |
| 193 hw_event.type = PERF_TYPE_HARDWARE; | 211 hw_event.type = PERF_TYPE_HARDWARE; |
| 194 hw_event.size = sizeof(hw_event); | 212 hw_event.size = sizeof(hw_event); |
| 195 hw_event.disabled = 1; | 213 hw_event.disabled = 1; |
| 435 *Having a standard VMSNewPrReqData struc allows the language to create and | 453 *Having a standard VMSNewPrReqData struc allows the language to create and |
| 436 * free the struc, while VMS knows how to get the newPr if it wants it, and | 454 * free the struc, while VMS knows how to get the newPr if it wants it, and |
| 437 * it lets the lang have lang-specific data related to creation transported | 455 * it lets the lang have lang-specific data related to creation transported |
| 438 * to the plugin. | 456 * to the plugin. |
| 439 */ | 457 */ |
| 440 void | 458 __attribute__ ((noinline)) void |
| 441 VMS__send_create_procr_req( void *semReqData, VirtProcr *reqstingPr ) __attribute__ ((noinline)) | 459 VMS__send_create_procr_req( void *semReqData, VirtProcr *reqstingPr ) |
| 442 | 460 |
| 443 { VMSReqst req; | 461 { VMSReqst req; |
| 444 | 462 |
| 445 req.reqType = createReq; | 463 req.reqType = createReq; |
| 446 req.semReqData = semReqData; | 464 req.semReqData = semReqData; |
| 470 * function to just poof into thin air -- the virtual processor's trace | 488 * function to just poof into thin air -- the virtual processor's trace |
| 471 * never returns from this call, but instead the virtual processor's trace | 489 * never returns from this call, but instead the virtual processor's trace |
| 472 * gets suspended in this call and all the virt processor's state disap- | 490 * gets suspended in this call and all the virt processor's state disap- |
| 473 * pears -- making that suspend the last thing in the virt procr's trace. | 491 * pears -- making that suspend the last thing in the virt procr's trace. |
| 474 */ | 492 */ |
| 475 void | 493 __attribute__ ((noinline)) void |
| 476 VMS__send_dissipate_req( VirtProcr *procrToDissipate ) __attribute__ ((noinline)) | 494 VMS__send_dissipate_req( VirtProcr *procrToDissipate ) |
| 477 { VMSReqst req; | 495 { VMSReqst req; |
| 478 | 496 |
| 479 req.reqType = dissipate; | 497 req.reqType = dissipate; |
| 480 req.nextReqst = procrToDissipate->requests; | 498 req.nextReqst = procrToDissipate->requests; |
| 481 procrToDissipate->requests = &req; | 499 procrToDissipate->requests = &req; |
| 530 /*This inserts the semantic-layer's request data into standard VMS carrier | 548 /*This inserts the semantic-layer's request data into standard VMS carrier |
| 531 * request data-struct is allocated on stack of this call & ptr to it sent | 549 * request data-struct is allocated on stack of this call & ptr to it sent |
| 532 * to plugin | 550 * to plugin |
| 533 *Then it does suspend, to cause request to be sent. | 551 *Then it does suspend, to cause request to be sent. |
| 534 */ | 552 */ |
| 535 /*inline*/ void | 553 /*inline*/__attribute__ ((noinline)) void |
| 536 VMS__send_sem_request( void *semReqData, VirtProcr *callingPr ) __attribute__ ((noinline)) | 554 VMS__send_sem_request( void *semReqData, VirtProcr *callingPr ) |
| 537 { VMSReqst req; | 555 { VMSReqst req; |
| 538 | 556 |
| 539 req.reqType = semantic; | 557 req.reqType = semantic; |
| 540 req.semReqData = semReqData; | 558 req.semReqData = semReqData; |
| 541 req.nextReqst = callingPr->requests; | 559 req.nextReqst = callingPr->requests; |
| 543 | 561 |
| 544 VMS__suspend_procr( callingPr ); | 562 VMS__suspend_procr( callingPr ); |
| 545 } | 563 } |
| 546 | 564 |
| 547 | 565 |
| 548 /*inline*/ void | 566 /*inline*/ __attribute__ ((noinline)) void |
| 549 VMS__send_VMSSem_request( void *semReqData, VirtProcr *callingPr ) __attribute__ ((noinline)) | 567 VMS__send_VMSSem_request( void *semReqData, VirtProcr *callingPr ) |
| 550 | 568 |
| 551 { VMSReqst req; | 569 { VMSReqst req; |
| 552 | 570 |
| 553 req.reqType = VMSSemantic; | 571 req.reqType = VMSSemantic; |
| 554 req.semReqData = semReqData; | 572 req.semReqData = semReqData; |
