Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > SSR_impls > SSR__MC_shared_impl
changeset 59:471c89d1d545 perf_counters
try 40 cores
| author | Nina Engelhardt <nengel@mailbox.tu-berlin.de> |
|---|---|
| date | Fri, 09 Mar 2012 19:01:21 +0100 |
| parents | e11ba112a0c7 |
| children | 3c9ed64db705 |
| files | SSR_Counter_Recording.c |
| diffstat | 1 files changed, 12 insertions(+), 1 deletions(-) [+] |
line diff
1.1 --- a/SSR_Counter_Recording.c Thu Mar 08 19:04:08 2012 +0100 1.2 +++ b/SSR_Counter_Recording.c Fri Mar 09 19:01:21 2012 +0100 1.3 @@ -10,6 +10,17 @@ 1.4 } 1.5 } 1.6 1.7 +void addToListOfArraysCounterEvent(CounterEvent value, ListOfArrays* list){ 1.8 + int offset_in_fragment = list->next_free_index % list->num_entries_per_fragment; 1.9 + if(offset_in_fragment == 0){ 1.10 + void* newBlock = malloc(list->entry_size * list->num_entries_per_fragment); 1.11 + addToDynArray(newBlock,list->dim1info); 1.12 + } 1.13 + CounterEvent* typedFragment = (CounterEvent*) ((list->dim1)[list->dim1info->numInArray -1]); 1.14 + typedFragment[offset_in_fragment] = value; 1.15 + list->next_free_index++; 1.16 +} 1.17 + 1.18 void SSR__counter_handler(int evt_type, int vpid, int task, VirtProcr* pr, uint64 cycles, uint64 instrs) 1.19 { 1.20 1.21 @@ -42,7 +53,7 @@ 1.22 if(evt_type==Work_start || evt_type==Work_end || evt_type==AppResponderInvocation_start){ 1.23 addToListOfArrays_ext(CounterEvent,e,semanticEnv->counterList[corenum]); 1.24 } else { 1.25 - addToListOfArrays(CounterEvent,e,semanticEnv->counterList[corenum]); 1.26 + addToListOfArraysCounterEvent(e,semanticEnv->counterList[corenum]); 1.27 } 1.28 } 1.29
