# HG changeset patch # User Nina Engelhardt # Date 1323107988 -3600 # Node ID 981acd1db6afdc628350ac8e3a03044b2b07b1bd # Parent aefd87f9d12fb59c11b7498ce37352f51d7f6c25 Separate UCC recording from VMS core and put it into SSR plugin diff -r aefd87f9d12f -r 981acd1db6af Counters/run_graph.py --- a/Counters/run_graph.py Tue Oct 18 15:53:04 2011 +0200 +++ b/Counters/run_graph.py Mon Dec 05 18:59:48 2011 +0100 @@ -17,7 +17,7 @@ try: counterfile = open(sys.argv[2]) except IOError as (errno, strerror): - print "Error {0}: {1}".format(errno, strerror) + print (("Error {0}: {1}".format)(errno, strerror)) sys.exit() from pygraph.readwrite.dot import read,write @@ -26,7 +26,7 @@ import csv -counterreader = csv.reader(counterfile) +counterreader = (csv.reader)(counterfile) diff -r aefd87f9d12f -r 981acd1db6af MasterLoop.c --- a/MasterLoop.c Tue Oct 18 15:53:04 2011 +0200 +++ b/MasterLoop.c Mon Dec 05 18:59:48 2011 +0100 @@ -167,8 +167,7 @@ addToDynArray((void*)lastRecord,masterEnv->counter_history_array_info); print_record_csv_to_file(lastRecord,_VMSMasterEnv->counteroutput); - Dependency* newd = new_dependency(currSlot->procrAssignedToSlot->procrID,lastRecord->task_position,currSlot->procrAssignedToSlot->procrID,lastRecord->task_position + 1); - addToDynArray((void*) newd ,masterEnv->dependenciesInfo); + @@ -217,6 +216,7 @@ schedVirtPr->schedSlot = currSlot; currSlot->needsProcrAssigned = FALSE; numSlotsFilled += 1; + schedVirtPr->numTimesScheduled++; #ifdef MEAS__PERF_COUNTERS //end assigner int lastRecordIdx = currSlot->procrAssignedToSlot->counter_history_array_info->numInArray -1; diff -r aefd87f9d12f -r 981acd1db6af ProcrContext.c --- a/ProcrContext.c Tue Oct 18 15:53:04 2011 +0200 +++ b/ProcrContext.c Mon Dec 05 18:59:48 2011 +0100 @@ -23,6 +23,7 @@ newPr->startOfStack = stackLocs; newPr->procrID = _VMSMasterEnv->numProcrsCreated++; + newPr->numTimesScheduled = 0; newPr->initialData = initialData; newPr->requests = NULL; newPr->schedSlot = NULL; diff -r aefd87f9d12f -r 981acd1db6af VMS.c --- a/VMS.c Tue Oct 18 15:53:04 2011 +0200 +++ b/VMS.c Mon Dec 05 18:59:48 2011 +0100 @@ -186,10 +186,6 @@ MakeTheMeasHists(); - #ifdef DETECT_DEPENDENCIES - _VMSMasterEnv->dependencies = VMS__malloc(10*sizeof(void*)); - _VMSMasterEnv->dependenciesInfo = makePrivDynArrayInfoFrom((void***)&(_VMSMasterEnv->dependencies),10); - #endif #ifdef DETECT_LOOP_GRAPH _VMSMasterEnv->loop_graph = VMS__malloc(10*sizeof(void*)); @@ -245,7 +241,7 @@ hw_event.config = 0x0000000000000000; //cycles _VMSMasterEnv->cycles_counter_fd[coreIdx] = syscall(__NR_perf_event_open, &hw_event, 0,//pid_t pid, - -1,//int cpu, + coreIdx,//int cpu, -1,//int group_fd, 0//unsigned long flags ); @@ -256,7 +252,7 @@ hw_event.config = 0x0000000000000001; //instrs _VMSMasterEnv->instrs_counter_fd[coreIdx] = syscall(__NR_perf_event_open, &hw_event, 0,//pid_t pid, - -1,//int cpu, + coreIdx,//int cpu, -1,//int group_fd, 0//unsigned long flags ); @@ -788,37 +784,7 @@ //forAllInDynArrayDo( _VMSMasterEnv->measHistsInfo, (DynArrayFnPtr)&printHist ); //forAllInDynArrayDo( _VMSMasterEnv->measHistsInfo, (DynArrayFnPtr)&saveHistToFile); //forAllInDynArrayDo( _VMSMasterEnv->measHistsInfo, &freeHistExt ); -#ifdef DETECT_DEPENDENCIES - FILE* output; - int n; - char filename[255]; - for(n=0;n<255;n++) - { - sprintf(filename, "./counters/Dependencies.%d.dot",n); - output = fopen(filename,"r"); - if(output) - { - fclose(output); - }else{ - break; - } - } - if(n<255){ - printf("Saving Dependencies to File: %s ...\n", filename); - output = fopen(filename,"w+"); - if(output!=NULL){ - set_dependency_file(output); - fprintf(output,"digraph Dependencies {\n"); - set_dot_file(output); - forAllInDynArrayDo(_VMSMasterEnv->counter_history_array_info, &print_dot_node_info ); - forAllInDynArrayDo( _VMSMasterEnv->dependenciesInfo, &print_dependency_to_file ); - fprintf(output,"}\n"); - } else - printf("Opening Dependencies file failed. Please check that folder \"counters\" exists in run directory.\n"); - } else { - printf("Could not open Dependencies file, please clean \"counters\" folder. (Must contain less than 255 files.)\n"); - } -#endif + #ifdef DETECT_LOOP_GRAPH FILE* loop_output; int loop_n; diff -r aefd87f9d12f -r 981acd1db6af VMS.h --- a/VMS.h Tue Oct 18 15:53:04 2011 +0200 +++ b/VMS.h Mon Dec 05 18:59:48 2011 +0100 @@ -17,7 +17,6 @@ #include "Hash_impl/PrivateHash.h" #include "vmalloc.h" #include "Counters/Counters.h" -#include "dependency.h" #include "loop.h" #include @@ -77,7 +76,7 @@ //#define NUM_TSC_ROUND_TRIPS 10 #define MEAS__PERF_COUNTERS -#define DETECT_DEPENDENCIES +#define OBSERVE_UCC #define DETECT_LOOP_GRAPH //========================= Hardware related Constants ===================== @@ -216,6 +215,7 @@ //======================================== float64 createPtInSecs; //have space but don't use on some configs + int numTimesScheduled; //defines units together w/ procrID }; //VirtProcr @@ -274,10 +274,6 @@ int instrs_counter_fd[NUM_CORES]; FILE* counteroutput; #endif - #ifdef DETECT_DEPENDENCIES - Dependency** dependencies; - PrivDynArrayInfo* dependenciesInfo; - #endif #ifdef MEAS__PERF_COUNTERS // CounterRecord** counter_history; PrivDynArrayInfo* counter_history_array_info; diff -r aefd87f9d12f -r 981acd1db6af dependency.c --- a/dependency.c Tue Oct 18 15:53:04 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -#include "dependency.h" -#include "vmalloc.h" - -Dependency* new_dependency(int from_vp, int from_task, int to_vp, int to_task){ - Dependency* newDep = (Dependency*) VMS__malloc(sizeof(Dependency)); - if (newDep!=NULL){ - newDep->from_vp = from_vp; - newDep->from_task = from_task; - newDep->to_vp = to_vp; - newDep->to_task = to_task; - } - return newDep; -} - -int set_dependency_file(FILE* file){ - dependency_file = file; -} - -void print_dependency_to_file(void* _dep){ - Dependency* dep = (Dependency*) _dep; - fprintf(dependency_file,"VP_%d_%d -> VP_%d_%d;\n",dep->from_vp,dep->from_task,dep->to_vp,dep->to_task); -} diff -r aefd87f9d12f -r 981acd1db6af dependency.h --- a/dependency.h Tue Oct 18 15:53:04 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* - * File: dependency.h - * Author: engelhardt - * - * Created on 29. August 2011, 17:41 - */ - -#ifndef DEPENDENCY_H -#define DEPENDENCY_H - -#include "DynArray/DynArray.h" -#include - - - -typedef struct { - int from_vp; - int from_task; - int to_vp; - int to_task; -} Dependency; - -FILE* dependency_file; - -Dependency* new_dependency(int from_vp, int from_task, int to_vp, int to_task); - -int set_dependency_file(FILE* file); - -void print_dependency_to_file(void* dep); - -#endif /* DEPENDENCY_H */ -