summaryrefslogtreecommitdiff
path: root/shaping/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'shaping/src/main.cpp')
-rw-r--r--shaping/src/main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/shaping/src/main.cpp b/shaping/src/main.cpp
index 8143bce..b7807f7 100644
--- a/shaping/src/main.cpp
+++ b/shaping/src/main.cpp
@@ -4,6 +4,7 @@
#include <unistd.h>
#include <assert.h>
#include <signal.h>
+#include <sys/prctl.h>
#include <jemalloc/jemalloc.h>
#include "log.h"
@@ -19,8 +20,12 @@ static int quit = 0;
static void *shaper_thread_loop(void *data)
{
+ char thread_name[16] = {0};
struct shaping_thread_ctx *ctx = (struct shaping_thread_ctx *)data;
+ snprintf(thread_name, sizeof(thread_name), "shape-work-%d", ctx->thread_index);
+ prctl(PR_SET_NAME, (unsigned long long)thread_name, NULL, NULL, NULL);
+
if (marsio_thread_init(ctx->marsio_info->instance) != 0) {
LOG_ERROR("%s: marsio_thread_init failed", LOG_TAG_SHAPING);
return NULL;