freedreno/fdperf: set locale
authorRob Clark <robdclark@chromium.org>
Tue, 10 Mar 2020 15:10:22 +0000 (08:10 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 10 Mar 2020 16:52:02 +0000 (16:52 +0000)
Set local to get numbers printed w/ commas.. much easier to read that
way.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4119>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4119>

src/freedreno/perfcntrs/fdperf.c

index 3c3b9912b3f80404b7d44a8e27069bd231fba2f8..3eb2f827a8d60cf0a4b29921691a7662a39d37d0 100644 (file)
@@ -28,6 +28,7 @@
 #include <err.h>
 #include <fcntl.h>
 #include <ftw.h>
+#include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -1085,6 +1086,8 @@ main(int argc, char **argv)
 
        dev.groups = calloc(dev.ngroups, sizeof(struct counter_group));
 
+       setlocale(LC_NUMERIC, "en_US.UTF-8");
+
        setup_counter_groups(groups);
        restore_counter_groups();
        config_restore();