code cleanup
Costa Tsaousis (ktsaou) committed
Mar 30, 2015 at 01:41 UTC
133d7abbb4caebd1fc0dfe3a47b099aff697dfa5
2 files changed
+11
-11
src/plugins.d/apps_plugin.c
+1
-1
@@ -675,7 +675,7 @@ int read_proc_pid_stat(struct pid_stat *p) {
675
// p->guest_time = strtoull(procfile_lineword(ff, 0, 42), NULL, 10);
676
// p->cguest_time = strtoull(procfile_lineword(ff, 0, 43), NULL, 10);
677
678
- if(debug || (p->target && p->target->debug)) fprintf(stderr, "apps.plugin: VALUES: %s utime=%llu, stime=%llu, cutime=%llu, cstime=%llu, minflt=%llu, majflt=%llu, cminflt=%llu, cmajflt=%llu\n", p->comm, p->utime, p->stime, p->cutime, p->cstime, p->minflt, p->majflt, p->cminflt, p->cmajflt);
678
+ if(debug || (p->target && p->target->debug)) fprintf(stderr, "apps.plugin: VALUES: %s utime=%llu, stime=%llu, cutime=%llu, cstime=%llu, minflt=%llu, majflt=%llu, cminflt=%llu, cmajflt=%llu, threads=%d\n", p->comm, p->utime, p->stime, p->cutime, p->cstime, p->minflt, p->majflt, p->cminflt, p->cmajflt, p->num_threads);
679
680
procfile_close(ff);
681
return 0;
src/procfile.c
+10
-10
@@ -26,10 +26,10 @@
26
#define PFWORDS_INCREASE_STEP 200
27
28
pfwords *pfwords_add(pfwords *fw, char *str) {
29
- debug(D_PROCFILE, PF_PREFIX ": adding word No %d: '%s'", fw->len, str);
29
+ // debug(D_PROCFILE, PF_PREFIX ": adding word No %d: '%s'", fw->len, str);
30
31
if(fw->len == fw->size) {
32
- debug(D_PROCFILE, PF_PREFIX ": expanding words");
32
+ // debug(D_PROCFILE, PF_PREFIX ": expanding words");
33
34
pfwords *new = realloc(fw, sizeof(pfwords) + (fw->size + PFWORDS_INCREASE_STEP) * sizeof(char *));
35
if(!new) {
@@ -47,7 +47,7 @@ pfwords *pfwords_add(pfwords *fw, char *str) {
47
}
48
49
pfwords *pfwords_new(void) {
50
- debug(D_PROCFILE, PF_PREFIX ": initializing words");
50
+ // debug(D_PROCFILE, PF_PREFIX ": initializing words");
51
52
pfwords *new = malloc(sizeof(pfwords) + PFWORDS_INCREASE_STEP * sizeof(char *));
53
if(!new) return NULL;
@@ -58,12 +58,12 @@ pfwords *pfwords_new(void) {
58
}
59
60
void pfwords_reset(pfwords *fw) {
61
- debug(D_PROCFILE, PF_PREFIX ": reseting words");
61
+ // debug(D_PROCFILE, PF_PREFIX ": reseting words");
62
fw->len = 0;
63
}
64
65
void pfwords_free(pfwords *fw) {
66
- debug(D_PROCFILE, PF_PREFIX ": freeing words");
66
+ // debug(D_PROCFILE, PF_PREFIX ": freeing words");
67
68
free(fw);
69
}
@@ -75,10 +75,10 @@ void pfwords_free(pfwords *fw) {
75
#define PFLINES_INCREASE_STEP 10
76
77
pflines *pflines_add(pflines *fl, uint32_t first_word) {
78
- debug(D_PROCFILE, PF_PREFIX ": adding line %d at word %d", fl->len, first_word);
78
+ // debug(D_PROCFILE, PF_PREFIX ": adding line %d at word %d", fl->len, first_word);
79
80
if(fl->len == fl->size) {
81
- debug(D_PROCFILE, PF_PREFIX ": expanding lines");
81
+ // debug(D_PROCFILE, PF_PREFIX ": expanding lines");
82
83
pflines *new = realloc(fl, sizeof(pflines) + (fl->size + PFLINES_INCREASE_STEP) * sizeof(ffline));
84
if(!new) {
@@ -97,7 +97,7 @@ pflines *pflines_add(pflines *fl, uint32_t first_word) {
97
}
98
99
pflines *pflines_new(void) {
100
- debug(D_PROCFILE, PF_PREFIX ": initializing lines");
100
+ // debug(D_PROCFILE, PF_PREFIX ": initializing lines");
101
102
pflines *new = malloc(sizeof(pflines) + PFLINES_INCREASE_STEP * sizeof(ffline));
103
if(!new) return NULL;
@@ -108,13 +108,13 @@ pflines *pflines_new(void) {
108
}
109
110
void pflines_reset(pflines *fl) {
111
- debug(D_PROCFILE, PF_PREFIX ": reseting lines");
111
+ // debug(D_PROCFILE, PF_PREFIX ": reseting lines");
112
113
fl->len = 0;
114
}
115
116
void pflines_free(pflines *fl) {
117
- debug(D_PROCFILE, PF_PREFIX ": freeing lines");
117
+ // debug(D_PROCFILE, PF_PREFIX ": freeing lines");
118
119
free(fl);
120
}