-
Marc Alff authored
Before this fix, any thread waiting for a specific condition to happen, which corresponds to a call to THD::enter_cond(), would: - set THD::proc_info member directly - ignore instrumentation apis such as set_thd_proc_info and THD_STAGE_INFO. As a result, conditions involving THD::enter_cond() would be: - captured in SHOW PROCESSLIST - captured in table INFORMATION_SCHEMA.PROCESSLIST - missing in SHOW PROFILES - missing in table INFORMATION_SCHEMA.PROFILING - missing in table performance_schema.threads; - missing in table performance_schema.events_stages_current; - missing in table performance_schema.events_stages_history; - missing in table performance_schema.events_stages_history_long; This fix changes the THD::enter_cond() and THD::exit_cond() apis, to include informations about the calling code such as: - the caller function name - the caller file name - the caller line number and to include an instrumented stage name parameter, "PSI_stage_info". The structure PSI_stage_info is used instead of a plain "const char *msg", because PSI_stage_info contains more semantic, and can be used to instrument both: - the SHOW PROFILE code, which needs a plain string - the performance schema stages, which needs a pre registered stage key. With this change, the implementation of THD::enter_cond() can now maintain coherence between all available instrumentations: - the SHOW PROCESSLIST implementation (thd->proc_info) - the SHOW PROFILES implementation (thd->profiling) - the performance schema stages implementation (MYSQL_SET_STAGE) This is done in a new THD::enter_stage() method. Changing the THD::enter_cond() and THD:exit_cond() apis caused mechanical adjustments to many places in the server, and forced callers to explicitely declare stages to the instrumentation. The number of instrumented stages in the server has increased, so the max number of stages has been bumped from 100 to 150, causing adjustments to many performance schema test result files.
Marc Alff authoredBefore this fix, any thread waiting for a specific condition to happen, which corresponds to a call to THD::enter_cond(), would: - set THD::proc_info member directly - ignore instrumentation apis such as set_thd_proc_info and THD_STAGE_INFO. As a result, conditions involving THD::enter_cond() would be: - captured in SHOW PROCESSLIST - captured in table INFORMATION_SCHEMA.PROCESSLIST - missing in SHOW PROFILES - missing in table INFORMATION_SCHEMA.PROFILING - missing in table performance_schema.threads; - missing in table performance_schema.events_stages_current; - missing in table performance_schema.events_stages_history; - missing in table performance_schema.events_stages_history_long; This fix changes the THD::enter_cond() and THD::exit_cond() apis, to include informations about the calling code such as: - the caller function name - the caller file name - the caller line number and to include an instrumented stage name parameter, "PSI_stage_info". The structure PSI_stage_info is used instead of a plain "const char *msg", because PSI_stage_info contains more semantic, and can be used to instrument both: - the SHOW PROFILE code, which needs a plain string - the performance schema stages, which needs a pre registered stage key. With this change, the implementation of THD::enter_cond() can now maintain coherence between all available instrumentations: - the SHOW PROCESSLIST implementation (thd->proc_info) - the SHOW PROFILES implementation (thd->profiling) - the performance schema stages implementation (MYSQL_SET_STAGE) This is done in a new THD::enter_stage() method. Changing the THD::enter_cond() and THD:exit_cond() apis caused mechanical adjustments to many places in the server, and forced callers to explicitely declare stages to the instrumentation. The number of instrumented stages in the server has increased, so the max number of stages has been bumped from 100 to 150, causing adjustments to many performance schema test result files.
Loading