Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
Dnsmasq
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Dnsmasq
Commits
c2207688
Commit
c2207688
authored
Jan 08, 2014
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Memory stats for DNSSEC.
parent
98c098bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
5 deletions
+23
-5
src/blockdata.c
src/blockdata.c
+19
-5
src/cache.c
src/cache.c
+3
-0
src/dnsmasq.h
src/dnsmasq.h
+1
-0
No files found.
src/blockdata.c
View file @
c2207688
...
@@ -19,6 +19,13 @@
...
@@ -19,6 +19,13 @@
#ifdef HAVE_DNSSEC
#ifdef HAVE_DNSSEC
static
struct
blockdata
*
keyblock_free
=
NULL
;
static
struct
blockdata
*
keyblock_free
=
NULL
;
static
unsigned
int
blockdata_count
=
0
,
blockdata_hwm
=
0
;
void
blockdata_report
(
void
)
{
my_syslog
(
LOG_INFO
,
_
(
"DNSSEC memory in use %u, max %u"
),
blockdata_count
*
KEYBLOCK_LEN
,
blockdata_hwm
*
KEYBLOCK_LEN
);
}
struct
blockdata
*
blockdata_alloc
(
char
*
data
,
size_t
len
)
struct
blockdata
*
blockdata_alloc
(
char
*
data
,
size_t
len
)
{
{
...
@@ -32,10 +39,15 @@ struct blockdata *blockdata_alloc(char *data, size_t len)
...
@@ -32,10 +39,15 @@ struct blockdata *blockdata_alloc(char *data, size_t len)
{
{
block
=
keyblock_free
;
block
=
keyblock_free
;
keyblock_free
=
block
->
next
;
keyblock_free
=
block
->
next
;
blockdata_count
++
;
}
}
else
else
if
((
block
=
whine_malloc
(
sizeof
(
struct
blockdata
))))
block
=
whine_malloc
(
sizeof
(
struct
blockdata
));
{
blockdata_count
++
;
if
(
blockdata_hwm
<
blockdata_count
)
blockdata_hwm
=
blockdata_count
;
}
if
(
!
block
)
if
(
!
block
)
{
{
/* failed to alloc, free partial chain */
/* failed to alloc, free partial chain */
...
@@ -76,9 +88,11 @@ void blockdata_free(struct blockdata *blocks)
...
@@ -76,9 +88,11 @@ void blockdata_free(struct blockdata *blocks)
if
(
blocks
)
if
(
blocks
)
{
{
for
(
tmp
=
blocks
;
tmp
->
next
;
tmp
=
tmp
->
next
);
for
(
tmp
=
blocks
;
tmp
->
next
;
tmp
=
tmp
->
next
)
blockdata_count
--
;
tmp
->
next
=
keyblock_free
;
tmp
->
next
=
keyblock_free
;
keyblock_free
=
blocks
;
keyblock_free
=
blocks
;
blockdata_count
--
;
}
}
}
}
...
...
src/cache.c
View file @
c2207688
...
@@ -1184,6 +1184,9 @@ void dump_cache(time_t now)
...
@@ -1184,6 +1184,9 @@ void dump_cache(time_t now)
#ifdef HAVE_AUTH
#ifdef HAVE_AUTH
my_syslog
(
LOG_INFO
,
_
(
"queries for authoritative zones %u"
),
daemon
->
auth_answer
);
my_syslog
(
LOG_INFO
,
_
(
"queries for authoritative zones %u"
),
daemon
->
auth_answer
);
#endif
#endif
#ifdef HAVE_DNSSEC
blockdata_report
();
#endif
/* sum counts from different records for same server */
/* sum counts from different records for same server */
for
(
serv
=
daemon
->
servers
;
serv
;
serv
=
serv
->
next
)
for
(
serv
=
daemon
->
servers
;
serv
;
serv
=
serv
->
next
)
...
...
src/dnsmasq.h
View file @
c2207688
...
@@ -990,6 +990,7 @@ struct crec *cache_enumerate(int init);
...
@@ -990,6 +990,7 @@ struct crec *cache_enumerate(int init);
/* blockdata.c */
/* blockdata.c */
#ifdef HAVE_DNSSEC
#ifdef HAVE_DNSSEC
void
blockdata_report
(
void
);
struct
blockdata
*
blockdata_alloc
(
char
*
data
,
size_t
len
);
struct
blockdata
*
blockdata_alloc
(
char
*
data
,
size_t
len
);
size_t
blockdata_walk
(
struct
blockdata
**
key
,
unsigned
char
**
p
,
size_t
cnt
);
size_t
blockdata_walk
(
struct
blockdata
**
key
,
unsigned
char
**
p
,
size_t
cnt
);
void
blockdata_retrieve
(
struct
blockdata
*
block
,
size_t
len
,
void
*
data
);
void
blockdata_retrieve
(
struct
blockdata
*
block
,
size_t
len
,
void
*
data
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment