[MDEV-29616] cmake -DWITH_DBUG_TRACE=OFF does not disable DBUG_PRINT Created: 2022-09-23  Updated: 2022-09-23  Resolved: 2022-09-23

Status: Closed
Project: MariaDB Server
Component/s: Server, Storage Engine - InnoDB, Tests
Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
Fix Version/s: 10.4.27, 10.5.18, 10.6.11, 10.7.7, 10.8.6, 10.9.4, 10.10.2

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-29613 Improve WITH_DBUG_TRACE=OFF Closed

 Description   

The CMake parameter WITH_DBUG_TRACE allows debug tests to run much faster by disabling macros like DBUG_ENTER and DBUG_RETURN.

We should go one step further and also disable DBUG_PRINT output. It turns out that only a small number of InnoDB redo log related tests were making use of DEBUG_DBUG='+d,ib_log' to check that some log records were written or parsed. We can live very well without those checks.

Conditional branches are bad for tools like the rr debugger. Even if all DBUG_PRINT statements are normally disabled in test runs, the conditional branches would create unnecessary (and useless) opportunity of context switches in rr. I have witnessed a case where a test that would take more than 2 hours to run would finish in a few seconds when the server was compiled with cmake -DPLUGIN_PERFSCHEMA=NO -DWITH_DBUG_TRACE=OFF -DWITH_SAFEMALLOC=OFF.

Thanks to wlad for noticing this additional opportunity.

After this change, enabling cmake -DWITH_DBUG_TRACE=OFF on debug builders would trivially work around MDEV-21361.


Generated at Thu Feb 08 10:09:59 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.