Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1302225
| From | Andi Kleen <andi@firstfloor.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] perf, tools, stat: Force C numeric locale for CSV mode |
| Date | 2016-01-05 22:30 +0100 |
| Message-ID | <qNHkZ-5x-3@gated-at.bofh.it> (permalink) |
| References | <qNFjd-7by-31@gated-at.bofh.it> <qNH1E-8oZ-19@gated-at.bofh.it> <qNHbl-8sH-47@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, Jan 05, 2016 at 06:17:57PM -0300, Arnaldo Carvalho de Melo wrote: > Em Tue, Jan 05, 2016 at 10:05:01PM +0100, Jiri Olsa escreveu: > > On Tue, Jan 05, 2016 at 11:17:45AM -0800, Andi Kleen wrote: > > > From: Andi Kleen <ak@linux.intel.com> > > > > > > Some locales print floating point numbers with a comma instead of a dot. > > > This causes problems with CSV mode because it causes extra false CSV > > > fields. Force the numeric locale to be always C in CSV mode. > > > > > > Before: > > > > > > $ LC_ALL=pl_PL.utf8 perf stat -x, true > > > 0,399472,,task-clock,399472,100,00 <---- extra bogus field > > > ... > > > > > > After: > > > $ LC_ALL=pl_PL.utf8 ./obj-perf/perf stat -x, true > > > 0.338422,,task-clock,338422,100.00 > > > > > > Originally reported in https://github.com/andikleen/pmu-tools/issues/43 > > > > > > Signed-off-by: Andi Kleen <ak@linux.intel.com> > > > > Acked-by: Jiri Olsa <jolsa@kernel.org> > > I wonder what is that other tools do when stumbling on this, i.e. > some other tool output that produces values that have the CSV character > in it... Proper CSV supports escaping the separator by putting the whole field into quotes. Unfortunately perf stat doesn't output proper CSV, the event fields with commas are not quoted. I usually work around it by using -x\; instead But the , problem should be still fixed. > > Completely disabling the configured locale seems too harsh to me, aren't > people used to changing the csv char via some option like we have in > 'perf stat': > > -x, --field-separator > > when changing the locale from the default 'C' one? Hey, you even used it > above, but you chose a CSV char that is used in this locale, oops ;-) It's just for numbers (LC_NUMERIC), everything else is still localized. -Andi -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] perf, tools, stat: Force C numeric locale for CSV mode Andi Kleen <andi@firstfloor.org> - 2016-01-05 20:20 +0100
Re: [PATCH] perf, tools, stat: Force C numeric locale for CSV mode Jiri Olsa <jolsa@redhat.com> - 2016-01-05 22:10 +0100
Re: [PATCH] perf, tools, stat: Force C numeric locale for CSV mode Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-01-05 22:20 +0100
Re: [PATCH] perf, tools, stat: Force C numeric locale for CSV mode Andi Kleen <andi@firstfloor.org> - 2016-01-05 22:30 +0100
Re: [PATCH] perf, tools, stat: Force C numeric locale for CSV mode Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-01-06 00:30 +0100
Re: [PATCH] perf, tools, stat: Force C numeric locale for CSV mode Andi Kleen <andi@firstfloor.org> - 2016-01-06 02:40 +0100
csiph-web