Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
4e750aa1
Commit
4e750aa1
authored
Sep 15, 2014
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delay allocating log line data until it's known to be needed in varnishtop
parent
6382a1e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
9 deletions
+3
-9
varnishtop.c
bin/varnishtop/varnishtop.c
+3
-9
No files found.
bin/varnishtop/varnishtop.c
View file @
4e750aa1
...
...
@@ -117,7 +117,6 @@ accumulate(struct VSL_data *vsl, struct VSL_transaction * const pt[],
void
*
priv
)
{
struct
top
*
tp
,
t
;
char
*
rd
;
unsigned
int
u
;
unsigned
tag
;
const
char
*
b
,
*
e
,
*
p
;
...
...
@@ -148,12 +147,7 @@ accumulate(struct VSL_data *vsl, struct VSL_transaction * const pt[],
t
.
hash
=
u
;
t
.
tag
=
tag
;
t
.
clen
=
len
;
t
.
count
=
0
;
rd
=
calloc
(
len
+
1
,
1
);
AN
(
rd
);
memcpy
(
rd
,
VSL_CDATA
(
tr
->
c
->
rec
.
ptr
),
len
);
rd
[
len
]
=
'\0'
;
t
.
rec_data
=
rd
;
t
.
rec_data
=
(
char
*
)
VSL_CDATA
(
tr
->
c
->
rec
.
ptr
);
AZ
(
pthread_mutex_lock
(
&
mtx
));
tp
=
VRB_FIND
(
top_tree
,
&
top_tree_head
,
&
t
);
...
...
@@ -162,7 +156,6 @@ accumulate(struct VSL_data *vsl, struct VSL_transaction * const pt[],
tp
->
count
+=
1
.
0
;
/* Reinsert to rebalance */
VRB_INSERT
(
top_tree
,
&
top_tree_head
,
tp
);
free
(
rd
);
}
else
{
ntop
++
;
tp
=
calloc
(
sizeof
*
tp
,
1
);
...
...
@@ -171,7 +164,8 @@ accumulate(struct VSL_data *vsl, struct VSL_transaction * const pt[],
tp
->
count
=
1
.
0
;
tp
->
clen
=
len
;
tp
->
tag
=
tag
;
tp
->
rec_data
=
rd
;
tp
->
rec_data
=
strdup
(
t
.
rec_data
);
AN
(
tp
->
rec_data
);
VRB_INSERT
(
top_tree
,
&
top_tree_head
,
tp
);
}
AZ
(
pthread_mutex_unlock
(
&
mtx
));
...
...
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