summaryrefslogtreecommitdiff
path: root/storage/innobase/fil
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-01-03 15:38:09 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2017-01-05 10:51:18 +0200
commitbf35deda09f18f5c7f3179ace731a2a186e05445 (patch)
tree3588ee94c8cee94e6abf50a2d14e79a1234c424e /storage/innobase/fil
parent4e7b382d3132e6be0e597d19d6467a9f58b459a7 (diff)
downloadmariadb-git-bf35deda09f18f5c7f3179ace731a2a186e05445.tar.gz
MDEV-11713 Optimize DBUG_PRINT and introduce DBUG_LOG
MariaDB Server is unnecessarily evaluating the arguments of DBUG_PRINT() macros when the label is not defined. The macro DBUG_LOG() for C++ operator<< output which was added for InnoDB diagnostics in MySQL 5.7 is missing from MariaDB. Unlike the MySQL 5.7 implementation, MariaDB will avoid allocating and initializing the output string when the label is not defined. Introduce DBUG_OUT("crypt") and DBUG_OUT("checksum") for some InnoDB diagnostics, replacing some use of ib::info().
Diffstat (limited to 'storage/innobase/fil')
-rw-r--r--storage/innobase/fil/fil0fil.cc28
1 files changed, 12 insertions, 16 deletions
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index 43b31002306..19318358dc4 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -1691,12 +1691,17 @@ fil_space_create(
space->page_0_crypt_read = true;
}
-#ifdef UNIV_DEBUG
- ib::info() << "Created tablespace for space " << space->id
- << " name " << space->name
- << " key_id " << (space->crypt_data ? space->crypt_data->key_id : 0)
- << " encryption " << (space->crypt_data ? space->crypt_data->encryption : 0);
-#endif
+ DBUG_LOG("tablespace",
+ "Tablespace for space " << id << " name " << name
+ << create_table ? " created" : " opened");
+ if (crypt_data) {
+ DBUG_LOG("crypt",
+ "Tablespace " << id << " name " << name
+ << " encryption " << crypt_data->encryption
+ << " key id " << crypt_data->key_id
+ << ":" << fil_crypt_get_mode(crypt_data)
+ << " " << fil_crypt_get_type(crypt_data));
+ }
space->encryption_type = Encryption::NONE;
@@ -1718,15 +1723,6 @@ fil_space_create(
fil_system->max_assigned_id = id;
}
-#ifdef UNIV_DEBUG
- if (crypt_data) {
- /* If table could be encrypted print info */
- ib::info() << "Tablespace ID " << id << " name " << space->name
- << ":" << fil_crypt_get_mode(crypt_data)
- << " " << fil_crypt_get_type(crypt_data);
- }
-#endif
-
mutex_exit(&fil_system->mutex);
return(space);
@@ -7735,4 +7731,4 @@ fil_system_exit(void)
{
ut_ad(mutex_own(&fil_system->mutex));
mutex_exit(&fil_system->mutex);
-}
+} \ No newline at end of file