diff VMS.c @ 129:ce02441b77cf

dependency tracking
author Nina Engelhardt
date Mon, 29 Aug 2011 19:12:06 +0200
parents 73fc5aafbe45
children 5475f90c248a
line diff
     1.1 --- a/VMS.c	Wed Aug 24 16:07:38 2011 +0200
     1.2 +++ b/VMS.c	Mon Aug 29 19:12:06 2011 +0200
     1.3 @@ -186,6 +186,11 @@
     1.4     
     1.5     MakeTheMeasHists();
     1.6     
     1.7 +   #ifdef DETECT_DEPENDENCIES
     1.8 +   _VMSMasterEnv->dependencies = VMS__malloc(10*sizeof(void*));
     1.9 +   _VMSMasterEnv->dependenciesInfo = makePrivDynArrayInfoFrom((void***)&(_VMSMasterEnv->dependencies),10);
    1.10 +   #endif
    1.11 +   
    1.12     #ifdef MEAS__PERF_COUNTERS
    1.13     //printf("Creating HW counters...");
    1.14     FILE* output;
    1.15 @@ -771,6 +776,29 @@
    1.16     //forAllInDynArrayDo( _VMSMasterEnv->measHistsInfo, (DynArrayFnPtr)&printHist );
    1.17     //forAllInDynArrayDo( _VMSMasterEnv->measHistsInfo, (DynArrayFnPtr)&saveHistToFile);
    1.18     //forAllInDynArrayDo( _VMSMasterEnv->measHistsInfo, &freeHistExt );
    1.19 +#ifdef DETECT_DEPENDENCIES
    1.20 +   FILE* output;
    1.21 +   int n;
    1.22 +   char filename[255];    
    1.23 +    for(n=0;n<255;n++)
    1.24 +    {
    1.25 +        sprintf(filename, "./counters/Dependencies.%d.csv",n);
    1.26 +        output = fopen(filename,"r");
    1.27 +        if(output)
    1.28 +        {
    1.29 +            fclose(output);
    1.30 +        }else{
    1.31 +            break;
    1.32 +        }
    1.33 +    }
    1.34 +    printf("Saving Dependencies to File: %s ...\n", filename);
    1.35 +    output = fopen(filename,"w+");
    1.36 +    set_dependency_file(output);
    1.37 +    fprintf(output,"digraph Dependencies {\n");
    1.38 +    
    1.39 +    forAllInDynArrayDo( _VMSMasterEnv->dependenciesInfo, &print_dependency_to_file );
    1.40 +    fprintf(output,"}\n");
    1.41 +#endif
    1.42     #ifdef MEAS__TIME_PLUGIN
    1.43     printHist( _VMSMasterEnv->reqHdlrLowTimeHist );
    1.44     saveHistToFile( _VMSMasterEnv->reqHdlrLowTimeHist );