summaryrefslogtreecommitdiff
path: root/rts/ThreadLabels.c
diff options
context:
space:
mode:
authorAdam Sandberg Ericsson <adam@sandbergericsson.se>2020-05-03 18:47:20 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-12-20 20:45:55 -0500
commit35fa0786b6ded2420f0a07446c8e45bff9bb01e0 (patch)
tree6b2014ceee09be269379c28f3fa9110b6bd60eba /rts/ThreadLabels.c
parent65721691ce9c4107d1cf84ad131bf167a9e42a7d (diff)
downloadhaskell-35fa0786b6ded2420f0a07446c8e45bff9bb01e0.tar.gz
rts: enable thread label table in all RTS flavours #17972
Diffstat (limited to 'rts/ThreadLabels.c')
-rw-r--r--rts/ThreadLabels.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/rts/ThreadLabels.c b/rts/ThreadLabels.c
index 7a06580efc..b982c7995c 100644
--- a/rts/ThreadLabels.c
+++ b/rts/ThreadLabels.c
@@ -18,8 +18,6 @@
#include <stdlib.h>
#include <string.h>
-#if defined(DEBUG)
-
#if defined(THREADED_RTS)
static Mutex threadLabels_mutex;
#endif /* THREADED_RTS */
@@ -90,23 +88,21 @@ removeThreadLabel(StgWord key)
RELEASE_LOCK(&threadLabels_mutex);
}
-#endif /* DEBUG */
-
void
labelThread(Capability *cap STG_UNUSED,
StgTSO *tso STG_UNUSED,
char *label STG_UNUSED)
{
-#if defined(DEBUG)
int len;
void *buf;
/* Caveat: Once set, you can only set the thread name to "" */
len = strlen(label)+1;
- buf = stgMallocBytes(len * sizeof(char), "Schedule.c:labelThread()");
+ buf = stgMallocBytes(len * sizeof(char), "ThreadLabels.c:labelThread()");
strncpy(buf,label,len);
+
/* Update will free the old memory for us */
updateThreadLabel(tso->id,buf);
-#endif
+
traceThreadLabel(cap, tso, label);
}