Home | History | Annotate | Download | only in cachegrind

Lines Matching refs:cpf

337    CacheProfFile* cpf = malloc(sizeof(CacheProfFile));
338 if (cpf == NULL)
340 cpf->desc_lines = desc_lines;
341 cpf->cmd_line = cmd_line;
342 cpf->events_line = events_line;
343 cpf->n_events = n_events;
344 cpf->summary_line = summary_line;
345 cpf->outerMap = outerMap;
346 cpf->summary = summary;
347 return cpf;
361 static void ddel_CacheProfFile ( CacheProfFile* cpf )
364 if (cpf->desc_lines) {
365 for (p = cpf->desc_lines; *p; p++)
367 free(cpf->desc_lines);
369 if (cpf->cmd_line)
370 free(cpf->cmd_line);
371 if (cpf->events_line)
372 free(cpf->events_line);
373 if (cpf->summary_line)
374 free(cpf->summary_line);
375 if (cpf->outerMap)
376 deleteFM( cpf->outerMap, (void(*)(Word))ddel_FileFn,
378 if (cpf->summary)
379 ddel_Counts(cpf->summary);
381 memset(cpf, 0, sizeof(CacheProfFile));
382 free(cpf);
393 static void show_CacheProfFile ( FILE* f, CacheProfFile* cpf )
402 for (d = cpf->desc_lines; *d; d++)
404 fprintf(f, "%s\n", cpf->cmd_line);
405 fprintf(f, "%s\n", cpf->events_line);
407 initIterFM( cpf->outerMap );
408 while (nextIterFM( cpf->outerMap, (Word*)(&topKey), (Word*)(&topVal) )) {
419 doneIterFM( cpf->outerMap );
421 //fprintf(f, "%s\n", cpf->summary_line);
423 for (i = 0; i < cpf->summary->n_counts; i++)
424 fprintf(f, " %lld", cpf->summary->counts[i]);
536 CacheProfFile* cpf,
551 if (newCounts->n_counts != cpf->n_events)
564 if (lookupFM( cpf->outerMap, (Word*)(&countsMap), (Word)topKey )) {
573 addToFM( cpf->outerMap, (Word)topKey, (Word)countsMap );
578 addCounts( s, cpf->summary, newCounts );
605 CacheProfFile* cpf;
612 cpf
613 if (cpf == NULL)
631 cpf->desc_lines = malloc( (1+n_tmp_desclines) * sizeof(char*) );
632 if (cpf->desc_lines == NULL)
635 cpf->desc_lines[n_tmp_desclines] = NULL;
637 cpf->desc_lines[i] = tmp_desclines[i];
643 cpf->cmd_line = strdup(line);
644 if (cpf->cmd_line == NULL)
656 cpf->events_line = strdup(line);
657 if (cpf->events_line == NULL)
660 cpf->n_events = 0;
661 assert(cpf->events_line[6] == ':');
662 for (p = &cpf->events_line[6]; *p; p++) {
664 cpf->n_events++;
668 cpf->summary = new_Counts_Zeroed( cpf->n_events );
669 if (cpf->summary == NULL)
673 cpf->outerMap = newFM ( malloc, free, cmp_FileFn );
674 if (cpf->outerMap == NULL)
684 handle_counts(s, cpf, curr_fl, curr_fn, line);
713 cpf->summary_line = strdup(line);
714 if (cpf->summary_line == NULL)
724 summaryRead = splitUpCountsLine( s, NULL, &cpf->summary_line[8] );
727 if (summaryRead->n_counts != cpf->n_events)
730 if (summaryRead->counts[i] != cpf->summary->counts[i]) {
740 if (cpf->summary_line) {
741 free(cpf->summary_line);
742 cpf->summary_line = NULL;
751 return cpf;
852 CacheProfFile *cpf, *cpfTmp;
882 cpf = NULL;
905 if (cpf == NULL) {
907 cpf = cpfTmp;
911 merge_CacheProfInfo( &src, cpf, cpfTmp );
919 if (cpf) {
937 show_CacheProfFile( outfile, cpf );
951 ddel_CacheProfFile( cpf );