Added commands to debugcmd.c that enable and disable logs for a single session.

Added the session id to dprintAllSessions and dprintSession output.
This commit is contained in:
Markus Makela
2014-11-19 12:25:33 +02:00
parent a65d8cd525
commit 2556097a98
3 changed files with 40 additions and 29 deletions

View File

@ -572,7 +572,7 @@ SESSION *ptr;
ptr = allSessions;
while (ptr)
{
dcb_printf(dcb, "Session %p\n", ptr);
dcb_printf(dcb, "Session %d (%p)\n",ptr->ses_id, ptr);
dcb_printf(dcb, "\tState: %s\n", session_state(ptr->state));
dcb_printf(dcb, "\tService: %s (%p)\n", ptr->service->name, ptr->service);
dcb_printf(dcb, "\tClient DCB: %p\n", ptr->client);
@ -598,7 +598,7 @@ dprintSession(DCB *dcb, SESSION *ptr)
{
int i;
dcb_printf(dcb, "Session %p\n", ptr);
dcb_printf(dcb, "Session %d (%p)\n",ptr->ses_id, ptr);
dcb_printf(dcb, "\tState: %s\n", session_state(ptr->state));
dcb_printf(dcb, "\tService: %s (%p)\n", ptr->service->name, ptr->service);
dcb_printf(dcb, "\tClient DCB: %p\n", ptr->client);
@ -853,3 +853,11 @@ session_getUser(SESSION *session)
{
return (session && session->client) ? session->client->user : NULL;
}
/**
* Return the pointer to the list of all sessions.
* @return Pointer to the list of all sessions.
*/
SESSION *get_all_sessions()
{
return allSessions;
}