# HG changeset patch # User Nina Engelhardt # Date 1331316081 -3600 # Node ID 471c89d1d5455149d6ff4c898dfb6410ca0f3de5 # Parent e11ba112a0c73126491df50d6f850b607435bde9 try 40 cores diff -r e11ba112a0c7 -r 471c89d1d545 SSR_Counter_Recording.c --- a/SSR_Counter_Recording.c Thu Mar 08 19:04:08 2012 +0100 +++ b/SSR_Counter_Recording.c Fri Mar 09 19:01:21 2012 +0100 @@ -10,6 +10,17 @@ } } +void addToListOfArraysCounterEvent(CounterEvent value, ListOfArrays* list){ + int offset_in_fragment = list->next_free_index % list->num_entries_per_fragment; + if(offset_in_fragment == 0){ + void* newBlock = malloc(list->entry_size * list->num_entries_per_fragment); + addToDynArray(newBlock,list->dim1info); + } + CounterEvent* typedFragment = (CounterEvent*) ((list->dim1)[list->dim1info->numInArray -1]); + typedFragment[offset_in_fragment] = value; + list->next_free_index++; +} + void SSR__counter_handler(int evt_type, int vpid, int task, VirtProcr* pr, uint64 cycles, uint64 instrs) { @@ -42,7 +53,7 @@ if(evt_type==Work_start || evt_type==Work_end || evt_type==AppResponderInvocation_start){ addToListOfArrays_ext(CounterEvent,e,semanticEnv->counterList[corenum]); } else { - addToListOfArrays(CounterEvent,e,semanticEnv->counterList[corenum]); + addToListOfArraysCounterEvent(e,semanticEnv->counterList[corenum]); } }