Re: [PATCH 01/10] perf, tools: Factor out scale conversion code

2016-11-23 Thread Jiri Olsa
On Fri, Nov 18, 2016 at 04:36:11PM -0800, Andi Kleen wrote: SNIP > @@ -261,6 +267,12 @@ static int __perf_pmu__new_alias(struct list_head *list, > char *dir, char *name, > alias->long_desc = long_desc ? strdup(long_desc) : > desc ? strdup(desc) : NULL; >

Re: [PATCH 01/10] perf, tools: Factor out scale conversion code

2016-11-23 Thread Jiri Olsa
On Fri, Nov 18, 2016 at 04:36:11PM -0800, Andi Kleen wrote: SNIP > return ret; > @@ -261,6 +267,12 @@ static int __perf_pmu__new_alias(struct list_head *list, > char *dir, char *name, > alias->long_desc = long_desc ? strdup(long_desc) : > desc ? strdup(d

Re: [PATCH 01/10] perf, tools: Factor out scale conversion code

2016-10-14 Thread Arnaldo Carvalho de Melo
Em Fri, Oct 14, 2016 at 09:36:42AM -0700, Andi Kleen escreveu: > > I tools/ specifically, I try to use the same constructs, list.h, rbtree, > > WARN_, pr_, etc, not panic()'ing, etc. > > > > In this specific case, doing a: > > > >printf("life is hard, I give up"); exit(1); > > Ok that would

Re: [PATCH 01/10] perf, tools: Factor out scale conversion code

2016-10-14 Thread Andi Kleen
> I tools/ specifically, I try to use the same constructs, list.h, rbtree, > WARN_, pr_, etc, not panic()'ing, etc. > > In this specific case, doing a: > >printf("life is hard, I give up"); exit(1); Ok that would be just what a wrapper does, only open coded. How about we just add helpers fo

Re: [PATCH 01/10] perf, tools: Factor out scale conversion code

2016-10-14 Thread Arnaldo Carvalho de Melo
Em Fri, Oct 14, 2016 at 09:15:16AM -0700, Andi Kleen escreveu: > On Fri, Oct 14, 2016 at 01:08:42PM -0300, Arnaldo Carvalho de Melo wrote: > > Em Fri, Oct 14, 2016 at 08:45:15AM -0700, Andi Kleen escreveu: > > > > So if we can't convert the scale because of an allocation failure > > > > related to

Re: [PATCH 01/10] perf, tools: Factor out scale conversion code

2016-10-14 Thread Arnaldo Carvalho de Melo
Em Fri, Oct 14, 2016 at 08:45:15AM -0700, Andi Kleen escreveu: > > So if we can't convert the scale because of an allocation failure > > related to locale issues we silently trow it away and do no scale at > > all? > That is right. If your machine is thrashing to death in a OOM this > is your smal

Re: [PATCH 01/10] perf, tools: Factor out scale conversion code

2016-10-14 Thread Andi Kleen
On Fri, Oct 14, 2016 at 01:08:42PM -0300, Arnaldo Carvalho de Melo wrote: > Em Fri, Oct 14, 2016 at 08:45:15AM -0700, Andi Kleen escreveu: > > > So if we can't convert the scale because of an allocation failure > > > related to locale issues we silently trow it away and do no scale at > > > all? >

Re: [PATCH 01/10] perf, tools: Factor out scale conversion code

2016-10-14 Thread Andi Kleen
> So if we can't convert the scale because of an allocation failure > related to locale issues we silently trow it away and do no scale at > all? That is right. If your machine is thrashing to death in a OOM this is your smallest problem. -Andi

Re: [PATCH 01/10] perf, tools: Factor out scale conversion code

2016-10-14 Thread Arnaldo Carvalho de Melo
Em Thu, Oct 13, 2016 at 02:15:23PM -0700, Andi Kleen escreveu: > From: Andi Kleen > > Move the scale factor parsing code to an own function > to reuse it in an upcoming patch. > > Signed-off-by: Andi Kleen > --- > tools/perf/util/pmu.c | 64 > +++---