debug for negative number of threads
Costa Tsaousis (ktsaou) committed
Mar 30, 2015 at 02:22 UTC
516799ab4deb86aa0d0e9dcaf63e52a93f51774c
1 file changed
+4
-1
src/plugins.d/apps_plugin.c
+4
-1
@@ -1376,7 +1376,10 @@ void update_statistics(void)
1376
p->target->majflt += p->majflt; //+ (p->pid != 1)?(p->cmajflt - p->fix_cmajflt):0;
1377
1378
if(p->num_threads < 0)
1379
- error("Negative threads number for pid '%s': %d", p->comm, p->num_threads);
1379
+ error("Negative threads number for pid '%s' (%d): %d", p->comm, p->pid, p->num_threads);
1380
+
1381
+ if(p->num_threads > 1000)
1382
+ error("Excessive threads number for pid '%s' (%d): %d", p->comm, p->pid, p->num_threads);
1383
1384
p->target->num_threads += p->num_threads;
1385
p->target->rss += p->rss;