@cryptotaxi247 / netdata-1 / commits / 4012e6163

added procfile debug

Costa Tsaousis (ktsaou) committed Mar 19, 2015 at 10:39 UTC 4012e616365239fd00c2a1e1fbe1ad9cae52baf3
1 file changed +2
src/procfile.c
+2
@@ -240,6 +240,7 @@ procfile *procfile_readall(procfile *ff) {
240 x = PROCFILE_INCREMENT_BUFFER;
241 }
242
243 + debug(D_PROCFILE, "Reading file '%s', from position %ld with length %ld", ff->filename, s, ff->size - s);
244 r = read(ff->fd, &ff->data[s], ff->size - s);
245 if(r == -1) {
246 error(PF_PREFIX ": Cannot read from file '%s'. Reason: %s\n", ff->filename, strerror(errno));
@@ -251,6 +252,7 @@ procfile *procfile_readall(procfile *ff) {
252 s = ff->len;
253 }
254
255 + debug(D_PROCFILE, "Rewinding file '%s'", ff->filename);
256 if(lseek(ff->fd, 0, SEEK_SET) == -1) {
257 error(PF_PREFIX ": Cannot rewind on file '%s'.\n", ff->filename);
258 procfile_close(ff);