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
db649fe6
Commit
db649fe6
authored
Oct 01, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some sanity-asserts to vsl buffers
parent
3299b793
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
cache_shmlog.c
bin/varnishd/cache/cache_shmlog.c
+18
-1
No files found.
bin/varnishd/cache/cache_shmlog.c
View file @
db649fe6
...
...
@@ -53,6 +53,16 @@ static unsigned vsl_seq;
struct
VSC_C_main
*
VSC_C_main
;
static
void
vsl_sanity
(
const
struct
vsl_log
*
vsl
)
{
AN
(
vsl
);
AN
(
vsl
->
wlp
);
AN
(
vsl
->
wlb
);
AN
(
vsl
->
wle
);
}
/*--------------------------------------------------------------------
* Check if the VSL_tag is masked by parameter bitmap
*/
...
...
@@ -238,6 +248,7 @@ VSL_Flush(struct vsl_log *vsl, int overflow)
uint32_t
*
p
;
unsigned
l
;
vsl_sanity
(
vsl
);
l
=
pdiff
(
vsl
->
wlb
,
vsl
->
wlp
);
if
(
l
==
0
)
return
;
...
...
@@ -264,6 +275,7 @@ VSLbt(struct vsl_log *vsl, enum VSL_tag_e tag, txt t)
unsigned
l
,
mlen
;
char
*
p
;
vsl_sanity
(
vsl
);
Tcheck
(
t
);
if
(
vsl_tag_is_masked
(
tag
))
return
;
...
...
@@ -303,7 +315,7 @@ VSLbv(struct vsl_log *vsl, enum VSL_tag_e tag, const char *fmt, va_list ap)
unsigned
n
,
mlen
;
txt
t
;
AN
(
vsl
);
vsl_sanity
(
vsl
);
AN
(
fmt
);
if
(
vsl_tag_is_masked
(
tag
))
return
;
...
...
@@ -346,6 +358,7 @@ VSLb(struct vsl_log *vsl, enum VSL_tag_e tag, const char *fmt, ...)
{
va_list
ap
;
vsl_sanity
(
vsl
);
va_start
(
ap
,
fmt
);
VSLbv
(
vsl
,
tag
,
fmt
,
ap
);
va_end
(
ap
);
...
...
@@ -360,6 +373,7 @@ VSLb_ts(struct vsl_log *vsl, const char *event, double first, double *pprev,
logging. This must be done carefully because some functions
(e.g. WRW_Reserve) takes the last timestamp as it's inital
value for timeout calculation. */
vsl_sanity
(
vsl
);
assert
(
!
isnan
(
now
)
&&
now
!=
0
.);
VSLb
(
vsl
,
SLT_Timestamp
,
"%s: %.6f %.6f %.6f"
,
event
,
now
,
now
-
first
,
now
-
*
pprev
);
...
...
@@ -385,6 +399,7 @@ VSL_Setup(struct vsl_log *vsl, void *ptr, size_t len)
vsl
->
wle
+=
len
/
sizeof
(
*
vsl
->
wle
);
vsl
->
wlr
=
0
;
vsl
->
wid
=
0
;
vsl_sanity
(
vsl
);
}
/*--------------------------------------------------------------------*/
...
...
@@ -394,6 +409,7 @@ VSL_ChgId(struct vsl_log *vsl, const char *typ, const char *why, uint32_t vxid)
{
uint32_t
ovxid
;
vsl_sanity
(
vsl
);
ovxid
=
vsl
->
wid
;
VSLb
(
vsl
,
SLT_Link
,
"%s %u %s"
,
typ
,
VXID
(
vxid
),
why
);
VSL_End
(
vsl
);
...
...
@@ -409,6 +425,7 @@ VSL_End(struct vsl_log *vsl)
txt
t
;
char
p
[]
=
""
;
vsl_sanity
(
vsl
);
AN
(
vsl
->
wid
);
t
.
b
=
p
;
t
.
e
=
p
;
...
...
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