Patch "perf bench: Add missing setlocale() call to allow usage of %'d style formatting" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    perf bench: Add missing setlocale() call to allow usage of %'d style formatting

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     perf-bench-add-missing-setlocale-call-to-allow-usage.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit e28c7b563899e05f44bbbc0213b34a0103b60b4e
Author: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Date:   Fri Jun 2 15:38:25 2023 -0300

    perf bench: Add missing setlocale() call to allow usage of %'d style formatting
    
    [ Upstream commit 16203e9cd01896b4244100a8e3fb9f6e612ab2b1 ]
    
    Without this we were not getting the thousands separator for big
    numbers.
    
    Noticed while developing 'perf bench uprobe', but the use of %' predates
    that, for instance 'perf bench syscall' uses it.
    
    Before:
    
      # perf bench uprobe all
      # Running uprobe/baseline benchmark...
      # Executed 1000 usleep(1000) calls
           Total time: 1054082243ns
    
       1054082.243000 nsecs/op
    
      #
    
    After:
    
      # perf bench uprobe all
      # Running uprobe/baseline benchmark...
      # Executed 1,000 usleep(1000) calls
           Total time: 1,053,715,144ns
    
       1,053,715.144000 nsecs/op
    
      #
    
    Fixes: c2a08203052f8975 ("perf bench: Add basic syscall benchmark")
    Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
    Cc: Andre Fredette <anfredet@xxxxxxxxxx>
    Cc: Clark Williams <williams@xxxxxxxxxx>
    Cc: Dave Tucker <datucker@xxxxxxxxxx>
    Cc: Davidlohr Bueso <dave@xxxxxxxxxxxx>
    Cc: Derek Barbosa <debarbos@xxxxxxxxxx>
    Cc: Ian Rogers <irogers@xxxxxxxxxx>
    Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
    Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
    Cc: Tiezhu Yang <yangtiezhu@xxxxxxxxxxx>
    Link: https://lore.kernel.org/lkml/ZH3lcepZ4tBYr1jv@xxxxxxxxxx
    Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/perf/builtin-bench.c b/tools/perf/builtin-bench.c
index 609a941ae2963..fb3029495c23c 100644
--- a/tools/perf/builtin-bench.c
+++ b/tools/perf/builtin-bench.c
@@ -21,6 +21,7 @@
 #include "builtin.h"
 #include "bench/bench.h"
 
+#include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -247,6 +248,7 @@ int cmd_bench(int argc, const char **argv)
 
 	/* Unbuffered output */
 	setvbuf(stdout, NULL, _IONBF, 0);
+	setlocale(LC_ALL, "");
 
 	if (argc < 2) {
 		/* No collection specified. */



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux