Re: [RESEND PATCH v2] perf stat: improve readability of shadow stats

2021-03-21 Thread Andi Kleen
> > But is this a real problem? > > perhaps not, Andi, any idea about this? It's not a problem for my tools which don't use the unit, but I could imagine one for other parsers. I would recommend to not change it for CSV, which is expected to be parsed by tools. -Andi

Re: [RESEND PATCH v2] perf stat: improve readability of shadow stats

2021-03-19 Thread Jiri Olsa
On Thu, Mar 18, 2021 at 11:12:40PM +0800, Changbin Du wrote: > On Tue, Mar 16, 2021 at 02:53:41PM +0100, Jiri Olsa wrote: > > On Mon, Mar 15, 2021 at 10:30:47PM +0800, Changbin Du wrote: > > > > SNIP > > > > > diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c > > > index

Re: [RESEND PATCH v2] perf stat: improve readability of shadow stats

2021-03-18 Thread Namhyung Kim
Hello, On Mon, Mar 15, 2021 at 11:31 PM Changbin Du wrote: > > This adds function convert_unit_double() and selects appropriate > unit for shadow stats between K/M/G. > > $ sudo ./perf stat -a -- sleep 1 > > Before: Unit 'M' is selected even the number is very small. > Performance counter stats

Re: [RESEND PATCH v2] perf stat: improve readability of shadow stats

2021-03-18 Thread Changbin Du
On Tue, Mar 16, 2021 at 02:53:41PM +0100, Jiri Olsa wrote: > On Mon, Mar 15, 2021 at 10:30:47PM +0800, Changbin Du wrote: > > SNIP > > > diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c > > index 6ccf21a72f06..3f800e71126f 100644 > > --- a/tools/perf/util/stat-shadow.c >

Re: [RESEND PATCH v2] perf stat: improve readability of shadow stats

2021-03-16 Thread Jiri Olsa
On Mon, Mar 15, 2021 at 10:30:47PM +0800, Changbin Du wrote: SNIP > diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c > index 6ccf21a72f06..3f800e71126f 100644 > --- a/tools/perf/util/stat-shadow.c > +++ b/tools/perf/util/stat-shadow.c > @@ -9,6 +9,7 @@ > #include "expr.

[RESEND PATCH v2] perf stat: improve readability of shadow stats

2021-03-15 Thread Changbin Du
This adds function convert_unit_double() and selects appropriate unit for shadow stats between K/M/G. $ sudo ./perf stat -a -- sleep 1 Before: Unit 'M' is selected even the number is very small. Performance counter stats for 'system wide': 4,003.06 msec cpu-clock #