You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by GitBox <gi...@apache.org> on 2021/06/02 15:28:20 UTC

[GitHub] [mesos] qianzhangxa commented on a change in pull request #391: Fixed parsing of `perf` output on some locales.

qianzhangxa commented on a change in pull request #391:
URL: https://github.com/apache/mesos/pull/391#discussion_r644077753



##########
File path: src/linux/perf.cpp
##########
@@ -125,6 +125,12 @@ class Perf : public Process<Perf>
 private:
   void execute()
   {
+    // If the locale is such that `LC_NUMERIC` uses the comma ',' as decimal
+    // separator, parsing won't work - because of unexpected number of fields
+    // and floating points format - so make sure it's set to `C`.
+    std::map<string, string> env = os::environment();
+    env["LC_ALL"] = "C";

Review comment:
       So here we set `LC_ALL` to `C` to make sure the output of `perf stat` always has `.` as the decimal
   separator (e.g., `100.00` instead of `100,00`) regardless user's locale, right?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org