From 1669c8890ca2e9092213626e5b047e58ca8b1e77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 3 Dec 2020 09:55:53 +0200 Subject: MDEV-24167 fixup: Improve the PERFORMANCE_SCHEMA instrumentation Let us try to avoid code bloat for the common case that performance_schema is disabled at runtime, and use ATTRIBUTE_NOINLINE member functions for instrumented latch acquisition. Also, let us distinguish lock waits from non-contended lock requests by using write_lock,read_lock for the requests that lead to waits, and try_write_lock,try_read_lock for the wait-free lock acquisitions. Actual 'try' operations are not being instrumented at all. --- storage/innobase/trx/trx0i_s.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'storage/innobase/trx/trx0i_s.cc') diff --git a/storage/innobase/trx/trx0i_s.cc b/storage/innobase/trx/trx0i_s.cc index d870c46d34c..4af37c1d35f 100644 --- a/storage/innobase/trx/trx0i_s.cc +++ b/storage/innobase/trx/trx0i_s.cc @@ -1305,7 +1305,7 @@ trx_i_s_cache_start_read( /*=====================*/ trx_i_s_cache_t* cache) /*!< in: cache */ { - cache->rw_lock.rd_lock(); + cache->rw_lock.rd_lock(SRW_LOCK_CALL); } /*******************************************************************//** @@ -1326,7 +1326,7 @@ trx_i_s_cache_start_write( /*======================*/ trx_i_s_cache_t* cache) /*!< in: cache */ { - cache->rw_lock.wr_lock(); + cache->rw_lock.wr_lock(SRW_LOCK_CALL); } /*******************************************************************//** -- cgit v1.2.1