Commit 58687c69 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Reduce the reporting in SLT_SessClose to be boolean bits.

This saves approx 50 bytes of storage for the session structure
and puts us comfortably below 256 bytes, at least i the IPv4 case.
parent 58aafc2a
......@@ -246,6 +246,12 @@ struct acct {
#undef ACCT
};
struct acct_bit {
#define ACCT(foo) unsigned int foo : 1;
#include "tbl/acct_fields.h"
#undef ACCT
};
/*--------------------------------------------------------------------*/
#define L0(t, n)
......@@ -775,7 +781,7 @@ struct sess {
char *client_addr_str;
char *client_port_str;
struct acct acct_ses;
struct acct_bit acct_bit;
/* Timestamps, all on TIM_real() timescale */
double t_open; /* fd accepted */
......
......@@ -81,7 +81,7 @@ SES_Charge(struct worker *wrk, struct req *req)
#define ACCT(foo) \
wrk->stats.s_##foo += a->foo; \
sp->acct_ses.foo += a->foo; \
if (a->foo) sp->acct_bit.foo =1; \
a->foo = 0;
#include "tbl/acct_fields.h"
#undef ACCT
......@@ -312,7 +312,7 @@ SES_Close(struct sess *sp, enum sess_close reason)
void
SES_Delete(struct sess *sp, enum sess_close reason, double now)
{
struct acct *b;
struct acct_bit *b;
struct sesspool *pp;
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
......@@ -328,8 +328,8 @@ SES_Delete(struct sess *sp, enum sess_close reason, double now)
now = VTIM_real();
assert(!isnan(sp->t_open));
b = &sp->acct_ses;
VSL(SLT_SessClose, sp->vxid, "%s %.3f %ju %ju %ju %ju %ju %ju",
b = &sp->acct_bit;
VSL(SLT_SessClose, sp->vxid, "%s %.3f %u %u %u %u %u %u",
sess_close_2str(sp->reason, 0), now - sp->t_open, b->req,
b->pipe, b->pass, b->fetch, b->hdrbytes, b->bodybytes);
VSL(SLT_End, sp->vxid, "%s", "");
......
......@@ -87,7 +87,7 @@ struct parspec mgt_parspec[] = {
"Bytes of workspace for session and TCP connection addresses."
" If larger than 4k, use a multiple of 4k for VM efficiency.",
DELAYED_EFFECT,
"512", "bytes" },
"256", "bytes" },
{ "workspace_client",
tweak_bytes_u, &mgt_param.workspace_client,
"3072", NULL,
......
......@@ -103,12 +103,12 @@ SLTM(SessClose, 0, "Client connection closed",
"The format is::\n\n"
"\t%s %f %u %u %u %u %u %u\n"
"\t| | | | | | | |\n"
"\t| | | | | | | +- Body bytes sent on session\n"
"\t| | | | | | +---- Header bytes sent on session\n"
"\t| | | | | +------- Backend fetches by session\n"
"\t| | | | +---------- Requests handled with pass\n"
"\t| | | +------------- If 'pipe' were used on session\n"
"\t| | +---------------- How many requests on session\n"
"\t| | | | | | | +- Bool: Body bytes were sent\n"
"\t| | | | | | +---- Bool: Resp.Header bytes sent\n"
"\t| | | | | +------- Bool: Backend fetches initiated\n"
"\t| | | | +---------- Bool: 'pass' used\n"
"\t| | | +------------- Bool: 'pipe' used\n"
"\t| | +---------------- Bool: good requests completed\n"
"\t| +------------------- How long the session was open\n"
"\t+---------------------- Why the connection closed\n"
"\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment