From c0e1f63f4da29a03cd3b214834e90b9cc043717a Mon Sep 17 00:00:00 2001 From: Adrien Mahieux Date: Fri, 20 Dec 2019 13:31:25 +0100 Subject: Set standard name to non-libnetdata threads (libuv, pthread) (#7584) * [libnetdata/threads] Add uv_thread_set_name This is inspired from thread_set_name() but for libuv threads. Both are based on pthread, but for uv we need to call it with the uv_thread_t pointer, instead of being the thread that calls the function for itself. * [exporting] Set libuv threadname to "EXPORTING-index" * [database/engine] Set libuv thread name to "DBENGINE" * [daemon/command] Set libuv thread name to "DAEMON-COMMAND" * [collectors/proc] Set pthread name to "PLUGIN[cpuidle]" * Use new 'thread_set_name_np' name --- database/engine/rrdengineapi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'database') diff --git a/database/engine/rrdengineapi.c b/database/engine/rrdengineapi.c index fd41a0cd89..ce465e7638 100755 --- a/database/engine/rrdengineapi.c +++ b/database/engine/rrdengineapi.c @@ -792,6 +792,7 @@ int rrdeng_init(struct rrdengine_instance **ctxp, char *dbfiles_path, unsigned p /* wait for worker thread to initialize */ wait_for_completion(&ctx->rrdengine_completion); destroy_completion(&ctx->rrdengine_completion); + uv_thread_set_name_np(ctx->worker_config.thread, "DBENGINE"); if (ctx->worker_config.error) { goto error_after_rrdeng_worker; } @@ -834,4 +835,4 @@ int rrdeng_exit(struct rrdengine_instance *ctx) } rrd_stat_atomic_add(&rrdeng_reserved_file_descriptors, -RRDENG_FD_BUDGET_PER_INSTANCE); return 0; -} \ No newline at end of file +} -- cgit v1.2.3