[PATCH] CodeSamples/formal/herd: Tame 'sort' command by setting LC_ALL

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

 



>From d6979ecb0635bd0418c049c89357cadb50cb32de Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@xxxxxxxxx>
Date: Tue, 12 Dec 2017 23:56:07 +0900
Subject: [PATCH] CodeSamples/formal/herd: Tame 'sort' command by setting LC_ALL

Otherwise, results of sorting in targets run-absperf and
run-absperf-all will depend on locale setting.

Fixes: ef392264b2b1 ("CodeSamples/formal/herd: Make use of absperf scripts in make targets")
Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx>
---
Hi Paul,

I suppose your locale setting is "en_US.UTF-8".
If this is the case, the result of run-absperf with a short timeout
will look something like:

    C-SB+l-o-o-u+l-o-o-u-X.litmus 0.04 0.04 0.04
    C-SB+l-o-o-u+l-o-o-u-XE.litmus 0.09 0.09 0.09
    C-SB+l-o-o-u+l-o-o-u+l-o-o-u-X.litmus 1.55 1.55 1.55
    C-SB+l-o-o-u+l-o-o-u+l-o-o-u-XE.litmus 5.26 5.26 5.26
    C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u.litmus 0.6 0.60 0.60
    C-SB+l-o-o-u+l-o-o-u+l-o-o-u.litmus 0.06 0.06 0.06
    C-SB+l-o-o-u+l-o-o-u+l-o-o-u-C.litmus 1.22 1.22 1.22
    C-SB+l-o-o-u+l-o-o-u+l-o-o-u-CE.litmus 2.65 2.65 2.65
    C-SB+l-o-o-u+l-o-o-u.litmus 0.01 0.01 0.01
    C-SB+l-o-o-u+l-o-o-u-C.litmus 0.04 0.04 0.04
    C-SB+l-o-o-u+l-o-o-u-CE.litmus 0.06 0.06 0.06

I used "sort -r" to have the ordering as:

    C-SB+l-o-o-u+l-o-o-u.litmus 0.01 0.01 0.01
    C-SB+l-o-o-u+l-o-o-u-XE.litmus 0.09 0.09 0.09
    C-SB+l-o-o-u+l-o-o-u-X.litmus 0.04 0.04 0.04
    C-SB+l-o-o-u+l-o-o-u-CE.litmus 0.06 0.06 0.06
    C-SB+l-o-o-u+l-o-o-u-C.litmus 0.04 0.04 0.04
    C-SB+l-o-o-u+l-o-o-u+l-o-o-u.litmus 0.06 0.06 0.06
    C-SB+l-o-o-u+l-o-o-u+l-o-o-u-XE.litmus 5.26 5.26 5.26
    C-SB+l-o-o-u+l-o-o-u+l-o-o-u-X.litmus 1.55 1.55 1.55
    C-SB+l-o-o-u+l-o-o-u+l-o-o-u-CE.litmus 2.65 2.65 2.65
    C-SB+l-o-o-u+l-o-o-u+l-o-o-u-C.litmus 1.22 1.22 1.22
    C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u.litmus 0.6 0.60 0.60

This change ensures the intended ordering no matter what your locale is.
(Well, this is not ideal, but close enough.)

        Thanks, Akira
--
 CodeSamples/formal/herd/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CodeSamples/formal/herd/Makefile b/CodeSamples/formal/herd/Makefile
index 7bbfeaf..8e0635a 100644
--- a/CodeSamples/formal/herd/Makefile
+++ b/CodeSamples/formal/herd/Makefile
@@ -79,6 +79,7 @@ absperf.out: ABSPERF_LIST = $(ABSPERF_SHORT)
 absperf.out: $(ABSPERF_SHORT)
 absperf-all.out: ABSPERF_LIST = $(ABSPERF_TEST)
 absperf-all.out: $(ABSPERF_TEST)
+$(ABSPERF_OUT): export LC_ALL = C
 
 $(ABSPERF_OUT):
 	mkdir -p absperf
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe perfbook" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



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

  Powered by Linux