mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
Fixup memstats for pretty time print in log file.
git-svn-id: file:///svn/unbound/trunk@1834 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
795a25c117
commit
90b4b1dae9
2 changed files with 8 additions and 9 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue