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
a187a0ad
Commit
a187a0ad
authored
Aug 28, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Elimiante diag_bitmaps and the mutex-profiling/measuring code.
XXX: doc-change needed.
parent
13c8fedd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
79 deletions
+13
-79
cache_lck.c
bin/varnishd/cache/cache_lck.c
+13
-41
params.h
bin/varnishd/common/params.h
+0
-3
mgt_param.c
bin/varnishd/mgt/mgt_param.c
+0
-29
b00008.vtc
bin/varnishtest/tests/b00008.vtc
+0
-6
No files found.
bin/varnishd/cache/cache_lck.c
View file @
a187a0ad
...
...
@@ -37,7 +37,6 @@
#include <stdlib.h>
#include "vtim.h"
#include "cache.h"
/*The constability of lck depends on platform pthreads implementation */
...
...
@@ -48,7 +47,6 @@ struct ilck {
pthread_mutex_t
mtx
;
int
held
;
pthread_t
owner
;
double
t0
;
VTAILQ_ENTRY
(
ilck
)
list
;
const
char
*
w
;
struct
VSC_C_lck
*
stat
;
...
...
@@ -63,37 +61,13 @@ void __match_proto__()
Lck__Lock
(
struct
lock
*
lck
,
const
char
*
p
,
const
char
*
f
,
int
l
)
{
struct
ilck
*
ilck
;
int
r
;
double
t0
=
0
,
t
;
(
void
)
p
;
(
void
)
f
;
(
void
)
l
;
CAST_OBJ_NOTNULL
(
ilck
,
lck
->
priv
,
ILCK_MAGIC
);
if
(
!
(
cache_param
->
diag_bitmap
&
0x98
))
{
AZ
(
pthread_mutex_lock
(
&
ilck
->
mtx
));
AZ
(
ilck
->
held
);
ilck
->
stat
->
locks
++
;
ilck
->
owner
=
pthread_self
();
ilck
->
held
=
1
;
return
;
}
if
(
cache_param
->
diag_bitmap
&
0x80
)
t0
=
VTIM_real
();
r
=
pthread_mutex_trylock
(
&
ilck
->
mtx
);
assert
(
r
==
0
||
r
==
EBUSY
);
if
(
r
)
{
ilck
->
stat
->
colls
++
;
if
(
cache_param
->
diag_bitmap
&
0x8
)
VSL
(
SLT_Debug
,
0
,
"MTX_CONTEST(%s,%s,%d,%s)"
,
p
,
f
,
l
,
ilck
->
w
);
AZ
(
pthread_mutex_lock
(
&
ilck
->
mtx
));
}
else
if
(
cache_param
->
diag_bitmap
&
0x8
)
{
VSL
(
SLT_Debug
,
0
,
"MTX_LOCK(%s,%s,%d,%s)"
,
p
,
f
,
l
,
ilck
->
w
);
}
if
(
cache_param
->
diag_bitmap
&
0x80
)
{
t
=
VTIM_real
();
VSL
(
SLT_Debug
,
0
,
"MTX_LOCKWAIT(%s,%s,%d,%s) %.9fs"
,
p
,
f
,
l
,
ilck
->
w
,
t
-
t0
);
ilck
->
t0
=
t
;
}
AZ
(
pthread_mutex_lock
(
&
ilck
->
mtx
));
AZ
(
ilck
->
held
);
ilck
->
stat
->
locks
++
;
ilck
->
owner
=
pthread_self
();
...
...
@@ -105,6 +79,10 @@ Lck__Unlock(struct lock *lck, const char *p, const char *f, int l)
{
struct
ilck
*
ilck
;
(
void
)
p
;
(
void
)
f
;
(
void
)
l
;
CAST_OBJ_NOTNULL
(
ilck
,
lck
->
priv
,
ILCK_MAGIC
);
assert
(
pthread_equal
(
ilck
->
owner
,
pthread_self
()));
AN
(
ilck
->
held
);
...
...
@@ -121,11 +99,6 @@ Lck__Unlock(struct lock *lck, const char *p, const char *f, int l)
*/
memset
(
&
ilck
->
owner
,
0
,
sizeof
ilck
->
owner
);
AZ
(
pthread_mutex_unlock
(
&
ilck
->
mtx
));
if
(
cache_param
->
diag_bitmap
&
0x80
)
VSL
(
SLT_Debug
,
0
,
"MTX_UNLOCK(%s,%s,%d,%s) %.9fs"
,
p
,
f
,
l
,
ilck
->
w
,
VTIM_real
()
-
ilck
->
t0
);
else
if
(
cache_param
->
diag_bitmap
&
0x8
)
VSL
(
SLT_Debug
,
0
,
"MTX_UNLOCK(%s,%s,%d,%s)"
,
p
,
f
,
l
,
ilck
->
w
);
}
int
__match_proto__
()
...
...
@@ -134,19 +107,18 @@ Lck__Trylock(struct lock *lck, const char *p, const char *f, int l)
struct
ilck
*
ilck
;
int
r
;
(
void
)
p
;
(
void
)
f
;
(
void
)
l
;
CAST_OBJ_NOTNULL
(
ilck
,
lck
->
priv
,
ILCK_MAGIC
);
r
=
pthread_mutex_trylock
(
&
ilck
->
mtx
);
assert
(
r
==
0
||
r
==
EBUSY
);
if
(
cache_param
->
diag_bitmap
&
0x8
)
VSL
(
SLT_Debug
,
0
,
"MTX_TRYLOCK(%s,%s,%d,%s) = %d"
,
p
,
f
,
l
,
ilck
->
w
,
r
);
if
(
r
==
0
)
{
AZ
(
ilck
->
held
);
ilck
->
held
=
1
;
ilck
->
stat
->
locks
++
;
ilck
->
owner
=
pthread_self
();
if
(
cache_param
->
diag_bitmap
&
0x80
)
ilck
->
t0
=
VTIM_real
();
}
return
(
r
);
}
...
...
bin/varnishd/common/params.h
View file @
a187a0ad
...
...
@@ -155,9 +155,6 @@ struct params {
/* CLI buffer size */
unsigned
cli_buffer
;
/* Control diagnostic code */
unsigned
diag_bitmap
;
/* Log local socket address to shm */
unsigned
log_local_addr
;
...
...
bin/varnishd/mgt/mgt_param.c
View file @
a187a0ad
...
...
@@ -578,22 +578,6 @@ tweak_waiter(struct cli *cli, const struct parspec *par, const char *arg)
/*--------------------------------------------------------------------*/
static
void
tweak_diag_bitmap
(
struct
cli
*
cli
,
const
struct
parspec
*
par
,
const
char
*
arg
)
{
unsigned
u
;
(
void
)
par
;
if
(
arg
!=
NULL
)
{
u
=
strtoul
(
arg
,
NULL
,
0
);
mgt_param
.
diag_bitmap
=
u
;
}
else
{
VCLI_Out
(
cli
,
"0x%x"
,
mgt_param
.
diag_bitmap
);
}
}
/*--------------------------------------------------------------------*/
static
void
tweak_poolparam
(
struct
cli
*
cli
,
const
struct
parspec
*
par
,
const
char
*
arg
)
{
...
...
@@ -1044,19 +1028,6 @@ static const struct parspec input_parspec[] = {
"Select the waiter kernel interface.
\n
"
,
WIZARD
|
MUST_RESTART
,
WAITER_DEFAULT
,
NULL
},
{
"diag_bitmap"
,
tweak_diag_bitmap
,
0
,
0
,
0
,
"Bitmap controlling diagnostics code:
\n
"
" 0x00000008 - mutex logging.
\n
"
" 0x00000010 - mutex contests.
\n
"
" 0x00000080 - mutex timing.
\n
"
"
\n
"
"Use 0x notation and do the bitor in your head :-)
\n
"
"
\n
"
"Note: Mutex timing will add extra overhead and "
"synchronization between threads, consequently changing the "
"locking characteristics.
\n
"
,
0
,
"0"
,
"bitmap"
},
{
"ban_dups"
,
tweak_bool
,
&
mgt_param
.
ban_dups
,
0
,
0
,
"Detect and eliminate duplicate bans.
\n
"
,
0
,
...
...
bin/varnishtest/tests/b00008.vtc
View file @
a187a0ad
...
...
@@ -20,12 +20,6 @@ varnish v1 -clierr 105 "help 1 2 3"
varnish v1 -cliok "param.show"
varnish v1 -cliok "param.show diag_bitmap"
varnish v1 -cliok "param.set diag_bitmap 0x80"
varnish v1 -cliok "param.set diag_bitmap 0x0"
varnish v1 -start
varnish v1 -cliok "help"
...
...
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