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

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Mon Aug 12 05:41:11 CEST 2013


At Mon, 12 Aug 2013 11:17:04 +0800,
Liu Yuan wrote:
> 
> 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.

I think 'Total TIme' is 'cumulative seconds'.  It includes the time
spent by internally called functions, too.

Thanks,

Kazutaka



More information about the sheepdog mailing list