Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
1d95c792
Commit
1d95c792
authored
Feb 07, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a debug.persistent command so we can fondle persistent storage for
testing and debugging.
parent
856edab5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
0 deletions
+44
-0
cache.h
bin/varnishd/cache.h
+1
-0
cache_main.c
bin/varnishd/cache_main.c
+1
-0
storage_persistent.c
bin/varnishd/storage_persistent.c
+42
-0
No files found.
bin/varnishd/cache.h
View file @
1d95c792
...
...
@@ -849,6 +849,7 @@ struct vsb *SMS_Makesynth(struct object *obj);
void
SMS_Finish
(
struct
object
*
obj
);
/* storage_persistent.c */
void
SMP_Init
(
void
);
void
SMP_Ready
(
void
);
void
SMP_NewBan
(
double
t0
,
const
char
*
ban
);
...
...
bin/varnishd/cache_main.c
View file @
1d95c792
...
...
@@ -127,6 +127,7 @@ child_main(void)
VCA_Init
();
SMS_Init
();
SMP_Init
();
STV_open
();
VMOD_Init
();
...
...
bin/varnishd/storage_persistent.c
View file @
1d95c792
...
...
@@ -52,6 +52,8 @@ SVNID("$Id$")
#include "stevedore.h"
#include "hash_slinger.h"
#include "vsha256.h"
#include "cli.h"
#include "cli_priv.h"
#include "persistent.h"
...
...
@@ -124,6 +126,7 @@ struct smp_sc {
unsigned
flags
;
#define SMP_F_LOADED (1 << 0)
const
struct
stevedore
*
stevedore
;
int
fd
;
const
char
*
filename
;
off_t
mediasize
;
...
...
@@ -1292,6 +1295,8 @@ smp_open(const struct stevedore *st)
Lck_New
(
&
sc
->
mtx
,
lck_smp
);
Lck_Lock
(
&
sc
->
mtx
);
sc
->
stevedore
=
st
;
/* We trust the parent to give us a valid silo, for good measure: */
AZ
(
smp_valid_silo
(
sc
));
...
...
@@ -1569,3 +1574,40 @@ const struct stevedore smp_stevedore = {
.
free
=
smp_free
,
.
trim
=
smp_trim
,
};
/*--------------------------------------------------------------------*/
static
void
debug_persistent
(
struct
cli
*
cli
,
const
char
*
const
*
av
,
void
*
priv
)
{
struct
smp_sc
*
sc
;
struct
smp_seg
*
sg
;
(
void
)
priv
;
if
(
av
[
2
]
==
NULL
||
av
[
3
]
==
NULL
)
{
VTAILQ_FOREACH
(
sc
,
&
silos
,
list
)
{
if
(
av
[
2
]
!=
NULL
&&
strcmp
(
av
[
2
],
sc
->
stevedore
->
ident
))
continue
;
cli_out
(
cli
,
"Silo: %s (%s)
\n
"
,
sc
->
stevedore
->
ident
,
sc
->
filename
);
VTAILQ_FOREACH
(
sg
,
&
sc
->
segments
,
list
)
{
cli_out
(
cli
,
" Seg: %p
\n
"
,
sg
);
}
}
return
;
}
}
static
struct
cli_proto
debug_cmds
[]
=
{
{
"debug.persistent"
,
"debug.persistent"
,
"Persistent debugging magic
\n
"
,
0
,
2
,
"d"
,
debug_persistent
},
{
NULL
}
};
void
SMP_Init
(
void
)
{
CLI_AddFuncs
(
debug_cmds
);
}
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