summaryrefslogtreecommitdiffstats
path: root/collectors/proc.plugin
diff options
context:
space:
mode:
authorAdrien Mahieux <adrien.mahieux@gmail.com>2019-12-20 13:31:25 +0100
committerVladimir Kobal <vlad@prokk.net>2019-12-20 14:31:25 +0200
commitc0e1f63f4da29a03cd3b214834e90b9cc043717a (patch)
treef41f161453612fd76d4e144d8f57037e11021b67 /collectors/proc.plugin
parentd0e424144749a9748c5de4f0888d8e8ec5647b78 (diff)
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
Diffstat (limited to 'collectors/proc.plugin')
-rw-r--r--collectors/proc.plugin/proc_stat.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/collectors/proc.plugin/proc_stat.c b/collectors/proc.plugin/proc_stat.c
index 5e6b79fc8c..50fab90e64 100644
--- a/collectors/proc.plugin/proc_stat.c
+++ b/collectors/proc.plugin/proc_stat.c
@@ -1007,6 +1007,8 @@ int do_proc_stat(int update_every, usec_t dt) {
error("Cannot create wake_cpu_thread");
else if(unlikely(pthread_join(thread, NULL)))
error("Cannot join wake_cpu_thread");
+ if(thread)
+ pthread_setname_np(thread, "PLUGIN[cpuidle]");
cpu_states_updated = 1;
}
}