]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Fixup memstats for pretty time print in log file.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 16 Sep 2009 13:01:51 +0000 (13:01 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 16 Sep 2009 13:01:51 +0000 (13:01 +0000)
git-svn-id: file:///svn/unbound/trunk@1834 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
testcode/memstats.c

index e0069a9b6d965eea11a7159d87929188b006b911..c23f713df6e24c132e54b1e228db6fb80c895ece 100644 (file)
@@ -1,5 +1,6 @@
 16 September 2009: Wouter
        - Fix memory leak reported by Tao Ma.
+       - Fix memstats test tool for log-time-ascii log format.
 
 15 September 2009: Wouter
        - iana portlist updated.
index 5fc079dcbdc4a951bf6ccdf2a6f1ff98f1c14ccc..fca3f2c2c92c2bff44f928e1b865139a99c539fd 100644 (file)
@@ -83,17 +83,15 @@ match(char* line)
         * But now also:
         * Sep 16 15:18:20 unbound[17428:0] info: ul/nh.c:143 memdup malloc(11)
         */
-       if(strlen(line) < 36) /* up to 'info: ' */
+       if(strlen(line) < 32) /* up to 'info: ' */
                return 0;
-       if(strncmp(line+30, "info: ", 6) != 0 &&
-               strncmp(line+33, "info: ", 6) != 0)
+       if(!strstr(line, "] info: "))
                return 0;
-       if(strncmp(line+36, "stat ", 5) == 0 || 
-               strncmp(line+39, "stat ", 5) == 0)
+       if(strstr(line, "info: stat"))
                return 0; /* skip the hex dumps */
-       if(strstr(line+36, "malloc("))
+       if(strstr(line+30, "malloc("))
                return 1;
-       else if(strstr(line+36, "calloc("))
+       else if(strstr(line+30, "calloc("))
                return 1;
        /* skip reallocs */
        return 0;
@@ -203,9 +201,9 @@ readfile(rbtree_t* tree, const char* fname)
 
                if(!match(buf))
                        continue;
-               else if(strstr(buf+36, "malloc("))
+               else if(strstr(buf+30, "malloc("))
                        read_malloc_stat(buf, tree);
-               else if(strstr(buf+36, "calloc("))
+               else if(strstr(buf+30, "calloc("))
                        read_calloc_stat(buf, tree);
                else {
                        printf("%s\n", buf);