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
611815fa
Commit
611815fa
authored
Jun 19, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tag threads separately with request and session.
parent
7ac1238e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
32 deletions
+68
-32
cache.h
bin/varnishd/cache/cache.h
+3
-1
cache_gzip.c
bin/varnishd/cache/cache_gzip.c
+1
-1
cache_main.c
bin/varnishd/cache/cache_main.c
+16
-0
cache_panic.c
bin/varnishd/cache/cache_panic.c
+46
-30
cache_session.c
bin/varnishd/cache/cache_session.c
+2
-0
No files found.
bin/varnishd/cache/cache.h
View file @
611815fa
...
...
@@ -854,7 +854,9 @@ uint32_t VXID_Get(struct vxid *v);
extern
volatile
struct
params
*
cache_param
;
void
THR_SetName
(
const
char
*
name
);
const
char
*
THR_GetName
(
void
);
void
THR_SetSession
(
const
struct
sess
*
sp
);
void
THR_SetRequest
(
const
struct
req
*
);
const
struct
req
*
THR_GetRequest
(
void
);
void
THR_SetSession
(
const
struct
sess
*
);
const
struct
sess
*
THR_GetSession
(
void
);
/* cache_lck.c */
...
...
bin/varnishd/cache/cache_gzip.c
View file @
611815fa
bin/varnishd/cache/cache_main.c
View file @
611815fa
...
...
@@ -46,6 +46,7 @@ volatile struct params *cache_param;
*/
static
pthread_key_t
sp_key
;
static
pthread_key_t
req_key
;
void
THR_SetSession
(
const
struct
sess
*
sp
)
...
...
@@ -61,6 +62,20 @@ THR_GetSession(void)
return
(
pthread_getspecific
(
sp_key
));
}
void
THR_SetRequest
(
const
struct
req
*
req
)
{
AZ
(
pthread_setspecific
(
req_key
,
req
));
}
const
struct
req
*
THR_GetRequest
(
void
)
{
return
(
pthread_getspecific
(
req_key
));
}
/*--------------------------------------------------------------------
* Name threads if our pthreads implementation supports it.
*/
...
...
@@ -126,6 +141,7 @@ child_main(void)
cache_param
=
heritage
.
param
;
AZ
(
pthread_key_create
(
&
sp_key
,
NULL
));
AZ
(
pthread_key_create
(
&
req_key
,
NULL
));
AZ
(
pthread_key_create
(
&
name_key
,
NULL
));
THR_SetName
(
"cache-main"
);
...
...
bin/varnishd/cache/cache_panic.c
View file @
611815fa
...
...
@@ -227,15 +227,53 @@ pan_busyobj(const struct busyobj *bo)
/*--------------------------------------------------------------------*/
static
void
pan_req
(
const
struct
req
*
req
)
{
const
char
*
hand
;
VSB_printf
(
pan_vsp
,
"req = %p {
\n
"
,
req
);
VSB_printf
(
pan_vsp
,
" sp = %p, xid = %u,
\n
"
,
req
->
sp
,
req
->
xid
);
hand
=
VCL_Return_Name
(
req
->
handling
);
if
(
hand
!=
NULL
)
VSB_printf
(
pan_vsp
,
" handling = %s,
\n
"
,
hand
);
else
VSB_printf
(
pan_vsp
,
" handling = 0x%x,
\n
"
,
req
->
handling
);
if
(
req
->
err_code
)
VSB_printf
(
pan_vsp
,
" err_code = %d, err_reason = %s,
\n
"
,
req
->
err_code
,
req
->
err_reason
?
req
->
err_reason
:
"(null)"
);
VSB_printf
(
pan_vsp
,
" restarts = %d, esi_level = %d
\n
"
,
req
->
restarts
,
req
->
esi_level
);
if
(
req
->
busyobj
!=
NULL
)
pan_busyobj
(
req
->
busyobj
);
pan_ws
(
req
->
ws
,
2
);
pan_http
(
"req"
,
req
->
http
,
2
);
if
(
req
->
resp
->
ws
!=
NULL
)
pan_http
(
"resp"
,
req
->
resp
,
4
);
if
(
VALID_OBJ
(
req
->
vcl
,
VCL_CONF_MAGIC
))
pan_vcl
(
req
->
vcl
);
if
(
VALID_OBJ
(
req
->
obj
,
OBJECT_MAGIC
))
pan_object
(
req
->
obj
);
VSB_printf
(
pan_vsp
,
"},
\n
"
);
}
/*--------------------------------------------------------------------*/
static
void
pan_sess
(
const
struct
sess
*
sp
)
{
const
char
*
stp
,
*
hand
;
const
char
*
stp
;
VSB_printf
(
pan_vsp
,
"sp = %p {
\n
"
,
sp
);
VSB_printf
(
pan_vsp
,
" fd = %d, id = %u, xid = %u,
\n
"
,
sp
->
fd
,
sp
->
vsl_id
&
VSL_IDENTMASK
,
sp
->
req
->
xid
);
VSB_printf
(
pan_vsp
,
" fd = %d, id = %u,
\n
"
,
sp
->
fd
,
sp
->
vsl_id
&
VSL_IDENTMASK
);
VSB_printf
(
pan_vsp
,
" client = %s %s,
\n
"
,
sp
->
addr
?
sp
->
addr
:
"?.?.?.?"
,
sp
->
port
?
sp
->
port
:
"?"
);
...
...
@@ -245,40 +283,14 @@ pan_sess(const struct sess *sp)
#undef STEP
default:
stp
=
NULL
;
}
hand
=
VCL_Return_Name
(
sp
->
req
->
handling
);
if
(
stp
!=
NULL
)
VSB_printf
(
pan_vsp
,
" step = %s,
\n
"
,
stp
);
else
VSB_printf
(
pan_vsp
,
" step = 0x%x,
\n
"
,
sp
->
step
);
if
(
hand
!=
NULL
)
VSB_printf
(
pan_vsp
,
" handling = %s,
\n
"
,
hand
);
else
VSB_printf
(
pan_vsp
,
" handling = 0x%x,
\n
"
,
sp
->
req
->
handling
);
if
(
sp
->
req
->
err_code
)
VSB_printf
(
pan_vsp
,
" err_code = %d, err_reason = %s,
\n
"
,
sp
->
req
->
err_code
,
sp
->
req
->
err_reason
?
sp
->
req
->
err_reason
:
"(null)"
);
VSB_printf
(
pan_vsp
,
" restarts = %d, esi_level = %d
\n
"
,
sp
->
req
->
restarts
,
sp
->
req
->
esi_level
);
if
(
sp
->
req
->
busyobj
!=
NULL
)
pan_busyobj
(
sp
->
req
->
busyobj
);
pan_ws
(
sp
->
req
->
ws
,
2
);
pan_http
(
"req"
,
sp
->
req
->
http
,
2
);
if
(
sp
->
req
->
resp
->
ws
!=
NULL
)
pan_http
(
"resp"
,
sp
->
req
->
resp
,
4
);
if
(
sp
->
wrk
!=
NULL
)
pan_wrk
(
sp
->
wrk
);
if
(
VALID_OBJ
(
sp
->
req
->
vcl
,
VCL_CONF_MAGIC
))
pan_vcl
(
sp
->
req
->
vcl
);
if
(
VALID_OBJ
(
sp
->
req
->
obj
,
OBJECT_MAGIC
))
pan_object
(
sp
->
req
->
obj
);
VSB_printf
(
pan_vsp
,
"},
\n
"
);
}
...
...
@@ -318,6 +330,7 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
{
const
char
*
q
;
const
struct
sess
*
sp
;
const
struct
req
*
req
;
AZ
(
pthread_mutex_lock
(
&
panicstr_mtx
));
/* Won't be released,
we're going to die
...
...
@@ -361,6 +374,9 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
sp
=
THR_GetSession
();
if
(
sp
!=
NULL
)
pan_sess
(
sp
);
req
=
THR_GetRequest
();
if
(
req
!=
NULL
)
pan_req
(
req
);
}
VSB_printf
(
pan_vsp
,
"
\n
"
);
VSB_bcat
(
pan_vsp
,
""
,
1
);
/* NUL termination */
...
...
bin/varnishd/cache/cache_session.c
View file @
611815fa
...
...
@@ -307,6 +307,7 @@ SES_GetReq(struct sess *sp)
req
->
magic
=
REQ_MAGIC
;
sp
->
req
=
req
;
req
->
sp
=
sp
;
THR_SetRequest
(
req
);
e
=
(
char
*
)
req
+
sz
;
p
=
(
char
*
)(
req
+
1
);
...
...
@@ -359,6 +360,7 @@ SES_ReleaseReq(struct sess *sp)
sp
->
req
->
sp
=
NULL
;
MPL_Free
(
pp
->
mpl_req
,
sp
->
req
);
sp
->
req
=
NULL
;
THR_SetRequest
(
NULL
);
}
/*--------------------------------------------------------------------
...
...
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