summaryrefslogtreecommitdiff
path: root/rts/ProfilerReportJson.c
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-11-09 12:39:47 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-12-16 16:12:44 -0500
commit70999283156f527c5aea6dee57a3d14989a9903a (patch)
tree50a7d056523d831e4df2202911b78ebb5c92a9af /rts/ProfilerReportJson.c
parent99269b9fd817262a686867383bf0fe88fdc64fb0 (diff)
downloadhaskell-70999283156f527c5aea6dee57a3d14989a9903a.tar.gz
rts: Introduce getNumCapabilities
And ensure accesses to n_capabilities are atomic (although with relaxed ordering). This is necessary as RTS API callers may concurrently call into the RTS without holding a capability.
Diffstat (limited to 'rts/ProfilerReportJson.c')
-rw-r--r--rts/ProfilerReportJson.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rts/ProfilerReportJson.c b/rts/ProfilerReportJson.c
index 71a557b8de..2cc0163a16 100644
--- a/rts/ProfilerReportJson.c
+++ b/rts/ProfilerReportJson.c
@@ -133,7 +133,7 @@ writeCCSReportJson(FILE *prof_file,
RtsFlags.ParFlags.nCapabilities);
fprintf(prof_file, "\"total_time\": %11.2f,\n",
((double) totals.total_prof_ticks *
- (double) RtsFlags.MiscFlags.tickInterval) / (TIME_RESOLUTION * n_capabilities));
+ (double) RtsFlags.MiscFlags.tickInterval) / (TIME_RESOLUTION * getNumCapabilities()));
fprintf(prof_file, "\"total_ticks\": %lu,\n",
(unsigned long) totals.total_prof_ticks);
fprintf(prof_file, "\"tick_interval\": %d,\n",