[sheepdog] [PATCH v2 4/5] collie/trace: add graph stat function

Liu Yuan namei.unix at gmail.com
Mon Aug 12 05:17:04 CEST 2013


On Mon, Aug 12, 2013 at 05:04:12AM +0900, MORITA Kazutaka wrote:
> > +
> > +static void stat_list_print(void)
> > +{
> > +	struct graph_stat_entry *entry;
> > +
> > +	list_for_each_entry(entry, &stat_list, list) {
> > +		float f = (float)entry->duration / 1000000000;
> > +		float pf = (float)entry->duration / entry->nr_calls / 1000;
> > +
> > +		printf("%-*s| %-10"PRIu32" | %-16f| %-16f\n", TRACE_FNAME_LEN,
> > +		       entry->fname, entry->nr_calls, f, pf);
> 
> I prefer a right-aligned number.  In addition, the default number of
> digits after the decimal point looks long to me.  Then the format
> string is like "%-*s| %10"PRIu32" |%16.3f |%16.3f \n".
> 
> I wonder if we can use the same format as the existing tool's one?
> E.g. gprof output is
> 
> http://sourceware.org/binutils/docs/gprof/Flat-Profile.html#Flat-Profile
> 
> I think it'd be great if we can have the "self seconds" column to
> investigate a bottleneck.

'Total Time' is 'self seconds'. The gprof format looks obscure and redundant.
I think total time, time per call, call nr, name is good enough.

Thanks
Yuan



More information about the sheepdog mailing list