mirror of
https://github.com/NLnetLabs/unbound.git
synced 2024-09-21 14:47:09 +00:00
memory indication.
typo fix. git-svn-id: file:///svn/unbound/trunk@503 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
45f95a18af
commit
d5e4fa21de
@ -55,6 +55,9 @@
|
|||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
|
|
||||||
|
/** global debug value to keep track of heap memory allocation */
|
||||||
|
void* unbound_start_brk = 0;
|
||||||
|
|
||||||
/** print usage. */
|
/** print usage. */
|
||||||
static void usage()
|
static void usage()
|
||||||
{
|
{
|
||||||
@ -359,6 +362,9 @@ main(int argc, char* argv[])
|
|||||||
int cmdline_verbose = 0;
|
int cmdline_verbose = 0;
|
||||||
int debug_mode = 0;
|
int debug_mode = 0;
|
||||||
|
|
||||||
|
/* take debug snapshot of heap */
|
||||||
|
unbound_start_brk = sbrk(0);
|
||||||
|
|
||||||
log_init(NULL);
|
log_init(NULL);
|
||||||
/* parse the options */
|
/* parse the options */
|
||||||
while( (c=getopt(argc, argv, "c:dhv")) != -1) {
|
while( (c=getopt(argc, argv, "c:dhv")) != -1) {
|
||||||
|
@ -69,6 +69,16 @@
|
|||||||
/** Size of an UDP datagram */
|
/** Size of an UDP datagram */
|
||||||
#define NORMAL_UDP_SIZE 512 /* bytes */
|
#define NORMAL_UDP_SIZE 512 /* bytes */
|
||||||
|
|
||||||
|
/** give debug heap size indication */
|
||||||
|
static void
|
||||||
|
debug_total_mem()
|
||||||
|
{
|
||||||
|
extern void* unbound_start_brk;
|
||||||
|
void* cur = sbrk(0);
|
||||||
|
int total = cur-unbound_start_brk;
|
||||||
|
log_info("Total heap memory estimate: %u", (unsigned)total);
|
||||||
|
}
|
||||||
|
|
||||||
/** Report on memory usage by this thread and global */
|
/** Report on memory usage by this thread and global */
|
||||||
static void
|
static void
|
||||||
worker_mem_report(struct worker* worker)
|
worker_mem_report(struct worker* worker)
|
||||||
@ -95,6 +105,7 @@ worker_mem_report(struct worker* worker)
|
|||||||
(unsigned)mesh, (unsigned)msg, (unsigned)rrset,
|
(unsigned)mesh, (unsigned)msg, (unsigned)rrset,
|
||||||
(unsigned)infra, (unsigned)ac, (unsigned)superac,
|
(unsigned)infra, (unsigned)ac, (unsigned)superac,
|
||||||
(unsigned)me);
|
(unsigned)me);
|
||||||
|
debug_total_mem();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -151,7 +162,7 @@ worker_handle_service_reply(struct comm_point* c, void* arg, int error,
|
|||||||
struct outbound_entry* e = (struct outbound_entry*)arg;
|
struct outbound_entry* e = (struct outbound_entry*)arg;
|
||||||
struct worker* worker = e->qstate->env->worker;
|
struct worker* worker = e->qstate->env->worker;
|
||||||
|
|
||||||
verbose(VERB_ALGO, "worker scvd callback for qstate %p", e->qstate);
|
verbose(VERB_ALGO, "worker svcd callback for qstate %p", e->qstate);
|
||||||
if(error != 0) {
|
if(error != 0) {
|
||||||
mesh_report_reply(worker->env.mesh, e, 0, reply_info);
|
mesh_report_reply(worker->env.mesh, e, 0, reply_info);
|
||||||
worker_mem_report(worker);
|
worker_mem_report(worker);
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
9 August 2007: Wouter
|
9 August 2007: Wouter
|
||||||
- canonicalization, signature checks
|
- canonicalization, signature checks
|
||||||
- dname signature label count and unit test.
|
- dname signature label count and unit test.
|
||||||
|
- added debug heap size print to memory printout.
|
||||||
|
- typo fixup in worker.c
|
||||||
|
|
||||||
8 August 2007: Wouter
|
8 August 2007: Wouter
|
||||||
- ldns _raw routines created (in ldns trunk).
|
- ldns _raw routines created (in ldns trunk).
|
||||||
|
Loading…
Reference in New Issue
Block a user