diff options
author | Adrien Mahieux <adrien.mahieux@gmail.com> | 2019-09-04 19:07:47 +0200 |
---|---|---|
committer | Markos Fountoulakis <44345837+mfundul@users.noreply.github.com> | 2019-09-04 20:07:47 +0300 |
commit | 8ece9b0932a9e5ed94581e984e6947378d32b17e (patch) | |
tree | d92f8fa83fe5fc5a1c1ce62617ac41e3fe85365a /daemon | |
parent | 1eecab0ed87994cf64e230ad6ff53b8a5c26ffa2 (diff) |
[libnetdata/thread] Set thread name from tag (#6745)
* [libnetdata/thread] Set thread name from tag
When calling netdata_thread_create, you can provide a tag to identify
the thread in the error message
This patch uses this tag to rename the thread if supported by the
pthread distribution to allow better identification of the thread.
This have helped identify the bug #6741
Sample output:
ps -L -o tid,pid,comm,args -p $(pgrep netdata)
TID PID COMMAND COMMAND
5123 5123 netdata ./netdata -D
5133 5123 PLUGIN[proc] ./netdata -D
5134 5123 netdata ./netdata -D
5135 5123 PLUGIN[cgroups] ./netdata -D
5136 5123 netdata ./netdata -D
5137 5123 STATSD ./netdata -D
5138 5123 BACKENDS ./netdata -D
5139 5123 netdata ./netdata -D
5140 5123 PLUGINSD ./netdata -D
5141 5123 netdata ./netdata -D
5142 5123 HEALTH ./netdata -D
5143 5123 netdata ./netdata -D
5145 5123 netdata ./netdata -D
5146 5123 PLUGINSD ./netdata -D
5147 5123 PLUGINSD[apps] ./netdata -D
5148 5123 netdata ./netdata -D
5150 5123 netdata ./netdata -D
5151 5123 STATSD ./netdata -D
* [libnetdata/thread] Improve set thread title
Added error check and fixed limit of 15 chars for thread name.
```
ps -L -o tid,pid,comm,args -p $(pgrep netdata)
TID PID COMMAND COMMAND
14521 14521 netdata ./netdata -D
14531 14521 PLUGIN[proc] ./netdata -D
14532 14521 PLUGIN[diskspac ./netdata -D
14533 14521 PLUGIN[cgroups] ./netdata -D
14534 14521 PLUGIN[idlejitt ./netdata -D
14535 14521 STATSD ./netdata -D
14536 14521 BACKENDS ./netdata -D
14537 14521 WEB_SERVER[stat ./netdata -D
14538 14521 PLUGINSD ./netdata -D
14539 14521 HEALTH ./netdata -D
14540 14521 WEB_SERVER[stat ./netdata -D
14541 14521 WEB_SERVER[stat ./netdata -D
14542 14521 WEB_SERVER[stat ./netdata -D
14543 14521 WEB_SERVER[stat ./netdata -D
14544 14521 WEB_SERVER[stat ./netdata -D
14546 14521 STATSD_COLLECTO ./netdata -D
14547 14521 PLUGINSD[python ./netdata -D
14548 14521 PLUGINSD[apps] ./netdata -D
```
* [libnetdata/thread] Moved code to dedicated func
* [libnetdata/thread] Wrong return value for thread_set_name
* [libnetdata/thread] Remove lval for FreeBSD as defined void
* [libnetdata/thread] Change allocation method to stack
Diffstat (limited to 'daemon')
0 files changed, 0 insertions, 0 deletions