FreeBSD/usr.sbin/pmcstat/pmcpl_calltree.c
/*
 * Print a calltree (KCachegrind) for all PMCs.
 */
Print a calltree (KCachegrind) for all PMCs.
Print a calltree ( KCachegrind ) for all PMCs .
static void
pmcpl_ct_print(void)
{
	int i;
	char name[40];
	struct pmcpl_ct_sample rsamples;
	pmcpl_ct_samples_root(&rsamples);
	pmcpl_ct_expand_inline();
	fprintf(args.pa_graphfile,
		"version: 1\n"
		"creator: pmcstat\n"
		"positions: instr line\n"
		"events:");
	for (i=0; i<pmcstat_npmcs; i++) {
		snprintf(name, sizeof(name), "%s_%d",
		    pmcstat_pmcindex_to_name(i), i);
		pmcpl_ct_fixup_pmcname(name);
		fprintf(args.pa_graphfile, " %s", name);
	}
	fprintf(args.pa_graphfile, "\nsummary:");
	for (i=0; i<pmcstat_npmcs ; i++)
		fprintf(args.pa_graphfile, " %u",
		    PMCPL_CT_SAMPLE(i, &rsamples));
	fprintf(args.pa_graphfile, "\n");
	pmcpl_ct_bfs(pmcpl_ct_root);
	pmcpl_ct_samples_free(&rsamples);
}
static void pmcpl_ct_print ( void ) { int i ; char name [ 40 ] ; struct pmcpl_ct_sample rsamples ; pmcpl_ct_samples_root ( & rsamples ) ; pmcpl_ct_expand_inline ( ) ; fprintf ( args . pa_graphfile , " \n " " \n " " \n " " " ) ; for ( i = 0 ; i < pmcstat_npmcs ; i ++ ) { snprintf ( name , sizeof ( name ) , " " , pmcstat_pmcindex_to_name ( i ) , i ) ; pmcpl_ct_fixup_pmcname ( name ) ; fprintf ( args . pa_graphfile , " " , name ) ; } fprintf ( args . pa_graphfile , " \n " ) ; for ( i = 0 ; i < pmcstat_npmcs ; i ++ ) fprintf ( args . pa_graphfile , " " , PMCPL_CT_SAMPLE ( i , & rsamples ) ) ; fprintf ( args . pa_graphfile , " \n " ) ; pmcpl_ct_bfs ( pmcpl_ct_root ) ; pmcpl_ct_samples_free ( & rsamples ) ; }
Print a calltree (KCachegrind) for all PMCs.
Print a calltree ( KCachegrind ) for all PMCs .