Commit ea32abba authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Move the sizeof debugging output to an undocumented debug.sizeof

CLI command.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2469 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 1ede7d84
......@@ -50,6 +50,30 @@ pthread_t cli_thread;
/*--------------------------------------------------------------------*/
static void
cli_debug_sizeof(struct cli *cli, const char * const *av, void *priv)
{
(void)av;
(void)priv;
#define SZOF(foo) cli_out(cli, \
"sizeof(%s) = %zd = 0x%zx\n", #foo, sizeof(foo), sizeof(foo));
SZOF(struct ws);
SZOF(struct http);
SZOF(struct http_conn);
SZOF(struct acct);
SZOF(struct worker);
SZOF(struct workreq);
SZOF(struct bereq);
SZOF(struct storage);
SZOF(struct object);
SZOF(struct objhead);
SZOF(struct sess);
SZOF(struct vbe_conn);
}
/*--------------------------------------------------------------------*/
static void
cli_func_start(struct cli *cli, const char * const *av, void *priv)
{
......@@ -77,6 +101,10 @@ struct cli_proto CLI_cmds[] = {
{ CLI_VCL_DISCARD, cli_func_config_discard },
{ CLI_VCL_USE, cli_func_config_use },
/* Undocumented functions for debugging */
{ "debug.sizeof", "debug.sizeof",
"\tDump sizeof various data structures\n",
0, 0, cli_debug_sizeof },
{ NULL }
};
......
......@@ -72,21 +72,6 @@ child_main(void)
THR_Name("cache-main");
#define SZOF(foo) printf("sizeof(%s) = %zd\n", #foo, sizeof(foo));
SZOF(struct ws);
SZOF(struct http);
SZOF(struct http_conn);
SZOF(struct acct);
SZOF(struct worker);
SZOF(struct workreq);
SZOF(struct bereq);
SZOF(struct storage);
SZOF(struct object);
SZOF(struct objhead);
SZOF(struct sess);
SZOF(struct vbe_conn);
CNT_Init();
VCL_Init();
......
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