Session info always copied to tls
Maxadmin earlier gave the impression that you could change whether messages for different log files could be specifically enabled for a session. In practice that was true only for trace messages as the session id and the bitmask telling what logfiles are enabled, were copied to thread local storage only as far as trace messages were concered. The code for setting that information in place is quit short and efficient, so there is really no reason not to do that always. This also means that it always will be possible to get your hands on the session object if there is a need for that.
This commit is contained in:
@ -90,9 +90,6 @@ extern __thread log_info_t tls_log_info;
|
|||||||
(log_ses_count[id] > 0 && \
|
(log_ses_count[id] > 0 && \
|
||||||
tls_log_info.li_enabled_logs & id)) ? true : false)
|
tls_log_info.li_enabled_logs & id)) ? true : false)
|
||||||
|
|
||||||
#define LOG_MAY_BE_ENABLED(id) (((lm_enabled_logfiles_bitmask & id) || \
|
|
||||||
log_ses_count[id] > 0) ? true : false)
|
|
||||||
|
|
||||||
// TODO: Add this at a later stage.
|
// TODO: Add this at a later stage.
|
||||||
#define MXS_LOG_PRIORITY_IS_ENABLED(priority) false
|
#define MXS_LOG_PRIORITY_IS_ENABLED(priority) false
|
||||||
|
|
||||||
|
@ -618,12 +618,9 @@ dcb_process_victim_queue(DCB *listofdcb)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LOG_MAY_BE_ENABLED(LOGFILE_TRACE))
|
dcb_get_ses_log_info(dcb,
|
||||||
{
|
&tls_log_info.li_sesid,
|
||||||
dcb_get_ses_log_info(dcb,
|
&tls_log_info.li_enabled_logs);
|
||||||
&tls_log_info.li_sesid,
|
|
||||||
&tls_log_info.li_enabled_logs);
|
|
||||||
}
|
|
||||||
|
|
||||||
dcb->state = DCB_STATE_DISCONNECTED;
|
dcb->state = DCB_STATE_DISCONNECTED;
|
||||||
nextdcb = dcb->memdata.next;
|
nextdcb = dcb->memdata.next;
|
||||||
|
@ -858,12 +858,9 @@ unsigned long qtime;
|
|||||||
if (eno == 0) {
|
if (eno == 0) {
|
||||||
atomic_add(&pollStats.n_write, 1);
|
atomic_add(&pollStats.n_write, 1);
|
||||||
/** Read session id to thread's local storage */
|
/** Read session id to thread's local storage */
|
||||||
if (LOG_MAY_BE_ENABLED(LOGFILE_TRACE))
|
dcb_get_ses_log_info(dcb,
|
||||||
{
|
&tls_log_info.li_sesid,
|
||||||
dcb_get_ses_log_info(dcb,
|
&tls_log_info.li_enabled_logs);
|
||||||
&tls_log_info.li_sesid,
|
|
||||||
&tls_log_info.li_enabled_logs);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (poll_dcb_session_check(dcb, "write_ready"))
|
if (poll_dcb_session_check(dcb, "write_ready"))
|
||||||
{
|
{
|
||||||
@ -891,12 +888,9 @@ unsigned long qtime;
|
|||||||
dcb->fd);
|
dcb->fd);
|
||||||
atomic_add(
|
atomic_add(
|
||||||
&pollStats.n_accept, 1);
|
&pollStats.n_accept, 1);
|
||||||
if (LOG_MAY_BE_ENABLED(LOGFILE_TRACE))
|
dcb_get_ses_log_info(dcb,
|
||||||
{
|
&tls_log_info.li_sesid,
|
||||||
dcb_get_ses_log_info(dcb,
|
&tls_log_info.li_enabled_logs);
|
||||||
&tls_log_info.li_sesid,
|
|
||||||
&tls_log_info.li_enabled_logs);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (poll_dcb_session_check(dcb, "accept"))
|
if (poll_dcb_session_check(dcb, "accept"))
|
||||||
{
|
{
|
||||||
@ -912,12 +906,9 @@ unsigned long qtime;
|
|||||||
dcb->fd);
|
dcb->fd);
|
||||||
atomic_add(&pollStats.n_read, 1);
|
atomic_add(&pollStats.n_read, 1);
|
||||||
/** Read session id to thread's local storage */
|
/** Read session id to thread's local storage */
|
||||||
if (LOG_MAY_BE_ENABLED(LOGFILE_TRACE))
|
dcb_get_ses_log_info(dcb,
|
||||||
{
|
&tls_log_info.li_sesid,
|
||||||
dcb_get_ses_log_info(dcb,
|
&tls_log_info.li_enabled_logs);
|
||||||
&tls_log_info.li_sesid,
|
|
||||||
&tls_log_info.li_enabled_logs);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (poll_dcb_session_check(dcb, "read"))
|
if (poll_dcb_session_check(dcb, "read"))
|
||||||
{
|
{
|
||||||
@ -951,12 +942,10 @@ unsigned long qtime;
|
|||||||
}
|
}
|
||||||
atomic_add(&pollStats.n_error, 1);
|
atomic_add(&pollStats.n_error, 1);
|
||||||
/** Read session id to thread's local storage */
|
/** Read session id to thread's local storage */
|
||||||
if (LOG_MAY_BE_ENABLED(LOGFILE_TRACE))
|
dcb_get_ses_log_info(dcb,
|
||||||
{
|
&tls_log_info.li_sesid,
|
||||||
dcb_get_ses_log_info(dcb,
|
&tls_log_info.li_enabled_logs);
|
||||||
&tls_log_info.li_sesid,
|
|
||||||
&tls_log_info.li_enabled_logs);
|
|
||||||
}
|
|
||||||
if (poll_dcb_session_check(dcb, "error"))
|
if (poll_dcb_session_check(dcb, "error"))
|
||||||
{
|
{
|
||||||
dcb->func.error(dcb);
|
dcb->func.error(dcb);
|
||||||
@ -983,12 +972,10 @@ unsigned long qtime;
|
|||||||
dcb->flags |= DCBF_HUNG;
|
dcb->flags |= DCBF_HUNG;
|
||||||
spinlock_release(&dcb->dcb_initlock);
|
spinlock_release(&dcb->dcb_initlock);
|
||||||
/** Read session id to thread's local storage */
|
/** Read session id to thread's local storage */
|
||||||
if (LOG_MAY_BE_ENABLED(LOGFILE_TRACE))
|
dcb_get_ses_log_info(dcb,
|
||||||
{
|
&tls_log_info.li_sesid,
|
||||||
dcb_get_ses_log_info(dcb,
|
&tls_log_info.li_enabled_logs);
|
||||||
&tls_log_info.li_sesid,
|
|
||||||
&tls_log_info.li_enabled_logs);
|
|
||||||
}
|
|
||||||
if (poll_dcb_session_check(dcb, "hangup EPOLLHUP"))
|
if (poll_dcb_session_check(dcb, "hangup EPOLLHUP"))
|
||||||
{
|
{
|
||||||
dcb->func.hangup(dcb);
|
dcb->func.hangup(dcb);
|
||||||
@ -1019,12 +1006,10 @@ unsigned long qtime;
|
|||||||
dcb->flags |= DCBF_HUNG;
|
dcb->flags |= DCBF_HUNG;
|
||||||
spinlock_release(&dcb->dcb_initlock);
|
spinlock_release(&dcb->dcb_initlock);
|
||||||
/** Read session id to thread's local storage */
|
/** Read session id to thread's local storage */
|
||||||
if (LOG_MAY_BE_ENABLED(LOGFILE_TRACE))
|
dcb_get_ses_log_info(dcb,
|
||||||
{
|
&tls_log_info.li_sesid,
|
||||||
dcb_get_ses_log_info(dcb,
|
&tls_log_info.li_enabled_logs);
|
||||||
&tls_log_info.li_sesid,
|
|
||||||
&tls_log_info.li_enabled_logs);
|
|
||||||
}
|
|
||||||
if (poll_dcb_session_check(dcb, "hangup EPOLLRDHUP"))
|
if (poll_dcb_session_check(dcb, "hangup EPOLLRDHUP"))
|
||||||
{
|
{
|
||||||
dcb->func.hangup(dcb);
|
dcb->func.hangup(dcb);
|
||||||
|
Reference in New Issue
Block a user