[Git][ghc/ghc][wip/tsan/all] 2 commits: Stats: squash

Ben Gamari gitlab at gitlab.haskell.org
Sun Oct 25 00:18:47 UTC 2020



Ben Gamari pushed to branch wip/tsan/all at Glasgow Haskell Compiler / GHC


Commits:
76600026 by Ben Gamari at 2020-10-24T20:18:22-04:00
Stats: squash

- - - - -
52901280 by Ben Gamari at 2020-10-24T20:18:37-04:00
hadrian flavour

- - - - -


5 changed files:

- hadrian/src/Flavour.hs
- rts/RtsStartup.c
- rts/Stats.c
- rts/Stats.h
- rts/sm/Storage.c


Changes:

=====================================
hadrian/src/Flavour.hs
=====================================
@@ -120,9 +120,9 @@ splitSections = splitSectionsIf (/=ghc)
 enableThreadSanitizer :: Flavour -> Flavour
 enableThreadSanitizer = addArgs $ mconcat
     [ builder (Ghc CompileHs) ? arg "-optc-fsanitize=thread"
-    , builder (Ghc CompileCWithGhc) ? arg "-optc-fsanitize=thread"
+    , builder (Ghc CompileCWithGhc) ? (arg "-optc-fsanitize=thread" <> arg "-DTSAN_ENABLED")
     , builder (Ghc LinkHs) ? arg "-optl-fsanitize=thread"
-    , builder (Cc  CompileC) ? arg "-fsanitize=thread"
+    , builder (Cc  CompileC) ? (arg "-fsanitize=thread" <> arg "-DTSAN_ENABLED")
     , builder (Cabal Flags) ? arg "thread-sanitizer"
     , builder  RunTest ? arg "--config=have_thread_sanitizer=True"
     ]


=====================================
rts/RtsStartup.c
=====================================
@@ -575,7 +575,7 @@ hs_exit_(bool wait_foreign)
       hs_restoreConsoleCP();
 #endif
 
-    /* Print the final runtime stats */
+    /* tear down statistics subsystem */
     stat_exit();
 
     /* free hash table storage */


=====================================
rts/Stats.c
=====================================
@@ -1245,7 +1245,7 @@ static void report_one_line(const RTSSummaryStats * sum)
 }
 
 void
-stat_exit (void)
+stat_exitReport (void)
 {
     RTSSummaryStats sum;
     init_RTSSummaryStats(&sum);
@@ -1450,9 +1450,6 @@ stat_exit (void)
             }
         }
         RELEASE_LOCK(&stats_mutex);
-#if defined(THREADED_RTS)
-        closeMutex(&stats_mutex);
-#endif
 
         statsFlush();
         statsClose();
@@ -1476,6 +1473,13 @@ stat_exit (void)
     RELEASE_LOCK(&all_tasks_mutex);
 }
 
+void stat_exit()
+{
+#if defined(THREADED_RTS)
+        closeMutex(&stats_mutex);
+#endif
+}
+
 /* Note [Work Balance]
 ----------------------
 Work balance is a measure of how evenly the work done during parallel garbage


=====================================
rts/Stats.h
=====================================
@@ -58,6 +58,7 @@ void      stat_endHeapCensus(void);
 void      stat_startExit(void);
 void      stat_endExit(void);
 
+void      stat_exitReport(void);
 void      stat_exit(void);
 void      stat_workerStop(void);
 


=====================================
rts/sm/Storage.c
=====================================
@@ -302,6 +302,7 @@ exitStorage (void)
 {
     nonmovingExit();
     updateNurseriesStats();
+    stat_exitReport();
 }
 
 void



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/eb195518f11b9cc28c051388484d867124f390dd...52901280e40cb05c3566c857e92caf1296d8d3ee

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/eb195518f11b9cc28c051388484d867124f390dd...52901280e40cb05c3566c857e92caf1296d8d3ee
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201024/efc75d9c/attachment-0001.html>


More information about the ghc-commits mailing list