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
c6d80ca7
Commit
c6d80ca7
authored
May 25, 2016
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stringify oc->flags and oc->exp_flags on panic
parent
f08820b3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
101 additions
and
16 deletions
+101
-16
cache.h
bin/varnishd/cache/cache.h
+12
-11
cache_panic.c
bin/varnishd/cache/cache_panic.c
+18
-5
oc_exp_flags.h
include/tbl/oc_exp_flags.h
+35
-0
oc_flags.h
include/tbl/oc_flags.h
+36
-0
No files found.
bin/varnishd/cache/cache.h
View file @
c6d80ca7
...
@@ -405,6 +405,18 @@ enum obj_flags {
...
@@ -405,6 +405,18 @@ enum obj_flags {
#undef OBJ_FLAG
#undef OBJ_FLAG
};
};
enum
oc_flags
{
#define OC_FLAG(U, l, v) OC_F_##U = v,
#include "tbl/oc_flags.h"
#undef OC_FLAG
};
enum
oc_exp_flags
{
#define OC_EXP_FLAG(U, l, v) OC_EF_##U = v,
#include "tbl/oc_exp_flags.h"
#undef OC_EXP_FLAG
};
struct
objcore
{
struct
objcore
{
unsigned
magic
;
unsigned
magic
;
#define OBJCORE_MAGIC 0x4d301302
#define OBJCORE_MAGIC 0x4d301302
...
@@ -421,19 +433,8 @@ struct objcore {
...
@@ -421,19 +433,8 @@ struct objcore {
float
keep
;
float
keep
;
uint8_t
flags
;
uint8_t
flags
;
#define OC_F_BUSY (1<<1)
#define OC_F_PASS (1<<2)
#define OC_F_ABANDON (1<<4)
#define OC_F_PRIVATE (1<<5)
#define OC_F_FAILED (1<<6)
#define OC_F_DYING (1<<7)
uint8_t
exp_flags
;
uint8_t
exp_flags
;
#define OC_EF_POSTED (1<<1)
#define OC_EF_REFD (1<<2)
#define OC_EF_MOVE (1<<3)
#define OC_EF_INSERT (1<<4)
#define OC_EF_REMOVE (1<<5)
uint16_t
oa_present
;
uint16_t
oa_present
;
...
...
bin/varnishd/cache/cache_panic.c
View file @
c6d80ca7
...
@@ -243,6 +243,7 @@ pan_boc(struct vsb *vsb, const struct boc *boc)
...
@@ -243,6 +243,7 @@ pan_boc(struct vsb *vsb, const struct boc *boc)
static
void
static
void
pan_objcore
(
struct
vsb
*
vsb
,
const
char
*
typ
,
const
struct
objcore
*
oc
)
pan_objcore
(
struct
vsb
*
vsb
,
const
char
*
typ
,
const
struct
objcore
*
oc
)
{
{
const
char
*
p
;
VSB_printf
(
vsb
,
"objcore[%s] = %p {
\n
"
,
typ
,
oc
);
VSB_printf
(
vsb
,
"objcore[%s] = %p {
\n
"
,
typ
,
oc
);
if
(
pan_already
(
vsb
,
oc
))
if
(
pan_already
(
vsb
,
oc
))
...
@@ -250,8 +251,20 @@ pan_objcore(struct vsb *vsb, const char *typ, const struct objcore *oc)
...
@@ -250,8 +251,20 @@ pan_objcore(struct vsb *vsb, const char *typ, const struct objcore *oc)
VSB_indent
(
vsb
,
2
);
VSB_indent
(
vsb
,
2
);
PAN_CheckMagic
(
vsb
,
oc
,
OBJCORE_MAGIC
);
PAN_CheckMagic
(
vsb
,
oc
,
OBJCORE_MAGIC
);
VSB_printf
(
vsb
,
"refcnt = %d,
\n
"
,
oc
->
refcnt
);
VSB_printf
(
vsb
,
"refcnt = %d,
\n
"
,
oc
->
refcnt
);
VSB_printf
(
vsb
,
"flags = 0x%x,
\n
"
,
oc
->
flags
);
VSB_printf
(
vsb
,
"flags = {"
);
VSB_printf
(
vsb
,
"exp_flags = 0x%x,
\n
"
,
oc
->
exp_flags
);
p
=
""
;
#define OC_FLAG(U, l, v) \
if (oc->flags & v) { VSB_printf(vsb, "%s" #l, p); p = ", "; }
#include "tbl/oc_flags.h"
#undef OC_FLAG
VSB_printf
(
vsb
,
"},
\n
"
);
VSB_printf
(
vsb
,
"exp_flags = {"
);
p
=
""
;
#define OC_EXP_FLAG(U, l, v) \
if (oc->exp_flags & v) { VSB_printf(vsb, "%s" #l, p); p = ", "; }
#include "tbl/oc_exp_flags.h"
#undef OC_EXP_FLAG
VSB_printf
(
vsb
,
"},
\n
"
);
if
(
oc
->
boc
!=
NULL
)
if
(
oc
->
boc
!=
NULL
)
pan_boc
(
vsb
,
oc
->
boc
);
pan_boc
(
vsb
,
oc
->
boc
);
VSB_printf
(
vsb
,
"exp = {%f, %f, %f, %f}
\n
"
,
VSB_printf
(
vsb
,
"exp = {%f, %f, %f, %f}
\n
"
,
...
...
include/tbl/oc_exp_flags.h
0 → 100644
View file @
c6d80ca7
/*-
* Copyright (c) 2016 Varnish Software AS
* All rights reserved.
*
* Author: Federico G. Schwindt <fgsch@lodoss.net>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*lint -save -e525 -e539 */
OC_EXP_FLAG
(
POSTED
,
posted
,
(
1
<<
1
))
OC_EXP_FLAG
(
REFD
,
refd
,
(
1
<<
2
))
OC_EXP_FLAG
(
MOVE
,
move
,
(
1
<<
3
))
OC_EXP_FLAG
(
INSERT
,
insert
,
(
1
<<
4
))
OC_EXP_FLAG
(
REMOVE
,
remove
,
(
1
<<
5
))
/*lint -restore */
include/tbl/oc_flags.h
0 → 100644
View file @
c6d80ca7
/*-
* Copyright (c) 2016 Varnish Software AS
* All rights reserved.
*
* Author: Federico G. Schwindt <fgsch@lodoss.net>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*lint -save -e525 -e539 */
OC_FLAG
(
BUSY
,
busy
,
(
1
<<
1
))
OC_FLAG
(
PASS
,
pass
,
(
1
<<
2
))
OC_FLAG
(
ABANDON
,
abandon
,
(
1
<<
4
))
OC_FLAG
(
PRIVATE
,
private
,
(
1
<<
5
))
OC_FLAG
(
FAILED
,
failed
,
(
1
<<
6
))
OC_FLAG
(
DYING
,
dying
,
(
1
<<
7
))
/*lint -restore */
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