Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
comparison VMS.c @ 167:981acd1db6af
Separate UCC recording from VMS core and put it into SSR plugin
| author | Nina Engelhardt |
|---|---|
| date | Mon, 05 Dec 2011 18:59:48 +0100 |
| parents | aefd87f9d12f |
| children | 3bd35fc83c61 |
comparison
equal
deleted
inserted
replaced
| 79:2d9162b961f3 | 80:bbcb869667c8 |
|---|---|
| 184 "master lock high time hist"); | 184 "master lock high time hist"); |
| 185 #endif | 185 #endif |
| 186 | 186 |
| 187 MakeTheMeasHists(); | 187 MakeTheMeasHists(); |
| 188 | 188 |
| 189 #ifdef DETECT_DEPENDENCIES | |
| 190 _VMSMasterEnv->dependencies = VMS__malloc(10*sizeof(void*)); | |
| 191 _VMSMasterEnv->dependenciesInfo = makePrivDynArrayInfoFrom((void***)&(_VMSMasterEnv->dependencies),10); | |
| 192 #endif | |
| 193 | 189 |
| 194 #ifdef DETECT_LOOP_GRAPH | 190 #ifdef DETECT_LOOP_GRAPH |
| 195 _VMSMasterEnv->loop_graph = VMS__malloc(10*sizeof(void*)); | 191 _VMSMasterEnv->loop_graph = VMS__malloc(10*sizeof(void*)); |
| 196 _VMSMasterEnv->loop_graph_array_info = makePrivDynArrayInfoFrom((void***)&(_VMSMasterEnv->loop_graph),10); | 192 _VMSMasterEnv->loop_graph_array_info = makePrivDynArrayInfoFrom((void***)&(_VMSMasterEnv->loop_graph),10); |
| 197 int loop_i; | 193 int loop_i; |
| 243 for( coreIdx = 0; coreIdx < NUM_CORES; coreIdx++ ) | 239 for( coreIdx = 0; coreIdx < NUM_CORES; coreIdx++ ) |
| 244 { | 240 { |
| 245 hw_event.config = 0x0000000000000000; //cycles | 241 hw_event.config = 0x0000000000000000; //cycles |
| 246 _VMSMasterEnv->cycles_counter_fd[coreIdx] = syscall(__NR_perf_event_open, &hw_event, | 242 _VMSMasterEnv->cycles_counter_fd[coreIdx] = syscall(__NR_perf_event_open, &hw_event, |
| 247 0,//pid_t pid, | 243 0,//pid_t pid, |
| 248 -1,//int cpu, | 244 coreIdx,//int cpu, |
| 249 -1,//int group_fd, | 245 -1,//int group_fd, |
| 250 0//unsigned long flags | 246 0//unsigned long flags |
| 251 ); | 247 ); |
| 252 if (_VMSMasterEnv->cycles_counter_fd[coreIdx]<0){ | 248 if (_VMSMasterEnv->cycles_counter_fd[coreIdx]<0){ |
| 253 fprintf(stderr,"On core %d: ",coreIdx); | 249 fprintf(stderr,"On core %d: ",coreIdx); |
| 254 perror("Failed to open cycles counter"); | 250 perror("Failed to open cycles counter"); |
| 255 } | 251 } |
| 256 hw_event.config = 0x0000000000000001; //instrs | 252 hw_event.config = 0x0000000000000001; //instrs |
| 257 _VMSMasterEnv->instrs_counter_fd[coreIdx] = syscall(__NR_perf_event_open, &hw_event, | 253 _VMSMasterEnv->instrs_counter_fd[coreIdx] = syscall(__NR_perf_event_open, &hw_event, |
| 258 0,//pid_t pid, | 254 0,//pid_t pid, |
| 259 -1,//int cpu, | 255 coreIdx,//int cpu, |
| 260 -1,//int group_fd, | 256 -1,//int group_fd, |
| 261 0//unsigned long flags | 257 0//unsigned long flags |
| 262 ); | 258 ); |
| 263 if (_VMSMasterEnv->instrs_counter_fd[coreIdx]<0){ | 259 if (_VMSMasterEnv->instrs_counter_fd[coreIdx]<0){ |
| 264 fprintf(stderr,"On core %d: ",coreIdx); | 260 fprintf(stderr,"On core %d: ",coreIdx); |
| 786 | 782 |
| 787 //Before getting rid of everything, print out any measurements made | 783 //Before getting rid of everything, print out any measurements made |
| 788 //forAllInDynArrayDo( _VMSMasterEnv->measHistsInfo, (DynArrayFnPtr)&printHist ); | 784 //forAllInDynArrayDo( _VMSMasterEnv->measHistsInfo, (DynArrayFnPtr)&printHist ); |
| 789 //forAllInDynArrayDo( _VMSMasterEnv->measHistsInfo, (DynArrayFnPtr)&saveHistToFile); | 785 //forAllInDynArrayDo( _VMSMasterEnv->measHistsInfo, (DynArrayFnPtr)&saveHistToFile); |
| 790 //forAllInDynArrayDo( _VMSMasterEnv->measHistsInfo, &freeHistExt ); | 786 //forAllInDynArrayDo( _VMSMasterEnv->measHistsInfo, &freeHistExt ); |
| 791 #ifdef DETECT_DEPENDENCIES | 787 |
| 792 FILE* output; | |
| 793 int n; | |
| 794 char filename[255]; | |
| 795 for(n=0;n<255;n++) | |
| 796 { | |
| 797 sprintf(filename, "./counters/Dependencies.%d.dot",n); | |
| 798 output = fopen(filename,"r"); | |
| 799 if(output) | |
| 800 { | |
| 801 fclose(output); | |
| 802 }else{ | |
| 803 break; | |
| 804 } | |
| 805 } | |
| 806 if(n<255){ | |
| 807 printf("Saving Dependencies to File: %s ...\n", filename); | |
| 808 output = fopen(filename,"w+"); | |
| 809 if(output!=NULL){ | |
| 810 set_dependency_file(output); | |
| 811 fprintf(output,"digraph Dependencies {\n"); | |
| 812 set_dot_file(output); | |
| 813 forAllInDynArrayDo(_VMSMasterEnv->counter_history_array_info, &print_dot_node_info ); | |
| 814 forAllInDynArrayDo( _VMSMasterEnv->dependenciesInfo, &print_dependency_to_file ); | |
| 815 fprintf(output,"}\n"); | |
| 816 } else | |
| 817 printf("Opening Dependencies file failed. Please check that folder \"counters\" exists in run directory.\n"); | |
| 818 } else { | |
| 819 printf("Could not open Dependencies file, please clean \"counters\" folder. (Must contain less than 255 files.)\n"); | |
| 820 } | |
| 821 #endif | |
| 822 #ifdef DETECT_LOOP_GRAPH | 788 #ifdef DETECT_LOOP_GRAPH |
| 823 FILE* loop_output; | 789 FILE* loop_output; |
| 824 int loop_n; | 790 int loop_n; |
| 825 char loop_filename[255]; | 791 char loop_filename[255]; |
| 826 for(loop_n=0;loop_n<255;loop_n++) | 792 for(loop_n=0;loop_n<255;loop_n++) |
