Remove support for session specific log priorities

No need to maintain information in thread local storage,
which just added complexity and also incurred a slight
performance penalty.
This commit is contained in:
Johan Wikman
2017-02-14 12:27:57 +02:00
parent d05a533611
commit 5f0346f5a9
7 changed files with 8 additions and 146 deletions

View File

@ -324,7 +324,6 @@ int dcb_count_by_usage(DCB_USAGE); /* Return counts of DCBs */
int dcb_persistent_clean_count(DCB *, int, bool); /* Clean persistent and return count */
void dcb_hangup_foreach (struct server* server);
size_t dcb_get_session_id(DCB* dcb);
bool dcb_get_ses_log_info(DCB* dcb, size_t* sesid, int* enabled_logs);
char *dcb_role_name(DCB *); /* Return the name of a role */
int dcb_accept_SSL(DCB* dcb);
int dcb_connect_SSL(DCB* dcb);

View File

@ -64,8 +64,6 @@ typedef struct mxs_log_info
} mxs_log_info_t;
extern int mxs_log_enabled_priorities;
extern ssize_t mxs_log_session_count[];
extern __thread mxs_log_info_t mxs_log_tls;
/**
* Check if specified log type is enabled in general or if it is enabled
@ -74,9 +72,7 @@ extern __thread mxs_log_info_t mxs_log_tls;
* @param priority One of the syslog LOG_ERR, LOG_WARNING, etc. constants.
*/
#define MXS_LOG_PRIORITY_IS_ENABLED(priority) \
(((mxs_log_enabled_priorities & (1 << priority)) || \
(mxs_log_session_count[priority] > 0 && \
mxs_log_tls.li_enabled_priorities & (1 << priority))) ? true : false)
((mxs_log_enabled_priorities & (1 << priority)) ? true : false)
/**
* LOG_AUGMENT_WITH_FUNCTION Each logged line is suffixed with [function-name].

View File

@ -128,7 +128,6 @@ typedef struct session
skygw_chk_t ses_chk_top;
mxs_session_state_t state; /*< Current descriptor state */
size_t ses_id; /*< Unique session identifier */
int enabled_log_priorities; /*< Bitfield of enabled syslog priorities */
struct dcb *client_dcb; /*< The client connection */
void *router_session; /*< The router instance data */
MXS_SESSION_STATS stats; /*< Session statistics */
@ -172,9 +171,6 @@ MXS_SESSION *session_set_dummy(struct dcb *);
const char *session_get_remote(const MXS_SESSION *);
const char *session_get_user(const MXS_SESSION *);
void session_enable_log_priority(MXS_SESSION* ses, int priority);
void session_disable_log_priority(MXS_SESSION* ses, int priority);
/**
* Convert transaction state to string representation.
*