Home | History | Annotate | Download | only in cachegrind

Lines Matching refs:Counts

212       ULong* counts;
214 Counts;
233 where innerMap is WordFM line-number=UWord Counts */
236 // Summary counts (computed whilst parsing)
238 Counts* summary;
271 static Counts* new_Counts ( Int n_counts, /*COPIED*/ULong* counts )
274 Counts* cts = malloc(sizeof(Counts));
279 cts->counts = malloc(n_counts * sizeof(ULong));
280 if (cts->counts == NULL)
285 cts->counts[i] = counts[i];
290 static Counts* new_Counts_Zeroed ( Int n_counts )
293 Counts* cts = malloc(sizeof(Counts));
298 cts->counts = malloc(n_counts * sizeof(ULong));
299 if (cts->counts == NULL)
304 cts->counts[i] = 0;
309 static void sdel_Counts ( Counts* cts )
311 memset(cts, 0, sizeof(Counts));
315 static void ddel_Counts ( Counts* cts )
317 if (cts->counts)
318 free(cts->counts);
319 memset(cts, 0, sizeof(Counts));
323 static Counts* dopy_Counts ( Counts* cts )
325 return new_Counts( cts->n_counts, cts->counts );
335 Counts* summary )
385 static void showCounts ( FILE* f, Counts* c )
389 fprintf(f, "%lld ", c->counts[i]);
400 Counts* subVal;
424 fprintf(f, " %lld", cpf->summary->counts[i]);
472 // allocated Counts struct. If lnno is non-NULL, treat the first
474 // incorporating it in the counts array.
476 Counts* splitUpCountsLine ( SOURCE* s, /*OUT*/UWord* lnno, char* str )
480 Counts* counts;
492 parseError(s, "garbage in counts line");
494 parseError(s, "too few counts in count line");
498 counts = new_Counts( n_tmpC-1, /*COPIED*/&tmpC[1] );
500 counts = new_Counts( n_tmpC, /*COPIED*/&tmpC[0] );
503 return counts;
507 static void addCounts ( SOURCE* s, /*OUT*/Counts* counts1, Counts* counts2 )
511 parseError(s, "addCounts: inconsistent number of counts");
513 counts1->counts[i] += counts2->counts[i];
518 UWord lnno, Counts* newCounts )
520 Counts* oldCounts;
522 // lnno->counts. If present, add counts to the existing entry.
542 Counts* newCounts;
565 // found it. Merge in new counts
587 parseError(s, "# counts doesn't match # events");
606 Counts* summaryRead;
723 // check the summary counts are as expected
728 parseError(s, "parse_CacheProfFile: wrong # counts in SUMMARY line");
730 if (summaryRead->counts[i] != cpf->summary->counts[i]) {
732 "computed vs stated SUMMARY counts mismatch");
735 free(summaryRead->counts);
738 // since the summary counts are OK, free up the summary_line text
766 for each (lineno, counts) in src->innerMap
768 add binding lineno->dopy(counts) to dst->innerMap
770 add counts into dst->innerMap[lineno]
773 Inner iterator: UWord -> Counts*
779 Counts* siVal;
780 Counts* diVal;
807 // for (lno, counts) in soVal (source inner map)
813 // no .. add lineno->dopy(counts) to dst inner map
814 Counts* c_siVal = dopy_Counts( siVal );
820 // yes .. merge counts into dst inner map val