comparison VMS.c @ 130:5475f90c248a

fix outputs (dependency file creation, counter length)
author Nina Engelhardt
date Wed, 07 Sep 2011 13:26:30 +0200
parents ce02441b77cf
children 395f58384a5c
comparison
equal deleted inserted replaced
55:c4ed4021caab 56:36a0d1c4d8a3
254 } 254 }
255 } 255 }
256 prctl(PR_TASK_PERF_EVENTS_ENABLE); 256 prctl(PR_TASK_PERF_EVENTS_ENABLE);
257 uint64 tmpc,tmpi; 257 uint64 tmpc,tmpi;
258 saveCyclesAndInstrs(0,tmpc,tmpi); 258 saveCyclesAndInstrs(0,tmpc,tmpi);
259 printf("Start: cycles = %lu, instrs = %lu\n",tmpc,tmpi); 259 printf("Start: cycles = %llu, instrs = %llu\n",tmpc,tmpi);
260 #endif 260 #endif
261 261
262 //======================================================================== 262 //========================================================================
263 263
264 } 264 }
723 writeVMSQ( shutDownPr, _VMSMasterEnv->readyToAnimateQs[coreIdx] ); 723 writeVMSQ( shutDownPr, _VMSMasterEnv->readyToAnimateQs[coreIdx] );
724 } 724 }
725 #ifdef MEAS__PERF_COUNTERS 725 #ifdef MEAS__PERF_COUNTERS
726 uint64 tmpc,tmpi; 726 uint64 tmpc,tmpi;
727 saveCyclesAndInstrs(0,tmpc,tmpi); 727 saveCyclesAndInstrs(0,tmpc,tmpi);
728 printf("End: cycles = %lu, instrs = %lu\n",tmpc,tmpi); 728 printf("End: cycles = %llu, instrs = %llu\n",tmpc,tmpi);
729 prctl(PR_TASK_PERF_EVENTS_DISABLE); 729 prctl(PR_TASK_PERF_EVENTS_DISABLE);
730 /* 730 /*
731 for( coreIdx=0; coreIdx < NUM_CORES; coreIdx++ ){ 731 for( coreIdx=0; coreIdx < NUM_CORES; coreIdx++ ){
732 close(_VMSMasterEnv->cycles_counter_fd[coreIdx]); 732 close(_VMSMasterEnv->cycles_counter_fd[coreIdx]);
733 close(_VMSMasterEnv->instrs_counter_fd[coreIdx]); 733 close(_VMSMasterEnv->instrs_counter_fd[coreIdx]);
780 FILE* output; 780 FILE* output;
781 int n; 781 int n;
782 char filename[255]; 782 char filename[255];
783 for(n=0;n<255;n++) 783 for(n=0;n<255;n++)
784 { 784 {
785 sprintf(filename, "./counters/Dependencies.%d.csv",n); 785 sprintf(filename, "./counters/Dependencies.%d.dot",n);
786 output = fopen(filename,"r"); 786 output = fopen(filename,"r");
787 if(output) 787 if(output)
788 { 788 {
789 fclose(output); 789 fclose(output);
790 }else{ 790 }else{
791 break; 791 break;
792 } 792 }
793 } 793 }
794 if(n<255){
794 printf("Saving Dependencies to File: %s ...\n", filename); 795 printf("Saving Dependencies to File: %s ...\n", filename);
795 output = fopen(filename,"w+"); 796 output = fopen(filename,"w+");
796 set_dependency_file(output); 797 if(output!=NULL){
797 fprintf(output,"digraph Dependencies {\n"); 798 set_dependency_file(output);
798 799 fprintf(output,"digraph Dependencies {\n");
799 forAllInDynArrayDo( _VMSMasterEnv->dependenciesInfo, &print_dependency_to_file ); 800
800 fprintf(output,"}\n"); 801 forAllInDynArrayDo( _VMSMasterEnv->dependenciesInfo, &print_dependency_to_file );
802 fprintf(output,"}\n");
803 } else
804 printf("Opening Dependencies file failed. Please check that folder \"counters\" exists in run directory.\n");
805 } else {
806 printf("Could not open Dependencies file, please clean \"counters\" folder. (Must contain less than 255 files.)\n");
807 }
801 #endif 808 #endif
802 #ifdef MEAS__TIME_PLUGIN 809 #ifdef MEAS__TIME_PLUGIN
803 printHist( _VMSMasterEnv->reqHdlrLowTimeHist ); 810 printHist( _VMSMasterEnv->reqHdlrLowTimeHist );
804 saveHistToFile( _VMSMasterEnv->reqHdlrLowTimeHist ); 811 saveHistToFile( _VMSMasterEnv->reqHdlrLowTimeHist );
805 printHist( _VMSMasterEnv->reqHdlrHighTimeHist ); 812 printHist( _VMSMasterEnv->reqHdlrHighTimeHist );