Re: pgbench - use pg logging capabilities
Michael Paquier <[email protected]> Fri, 10 Jan 2020 17:27:51 +0900
| Newsgroups | gmane.comp.db.postgresql.devel.general |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Jan 10, 2020 at 08:52:17AM +0100, Fabien COELHO wrote: > Compared to dealing with the level inside the call, the use of the level > variable avoids a call-test-return cycle in this case, and the unlikely > should help the compiler reorder instructions so that no actual branch is > taken under the common case. > > So I think that the current situation is a good thing at least for debug. If you look at some of my messages on other threads, you would likely notice that my mood of the day is to not design things which try to outsmart a user's expectations :) So I would stand on the position to just remove those likely/unlikely parts if we want this logging to be generic. > For other levels, they are on by default AND would not be placed at critical > performance points, so the whole effort of avoiding the call are moot. > > I agree with Tom that __pg_log_level variable name violates usages. My own taste would be to still keep the variable local to logging.c, and use a "get"-like routine to be consistent with the "set" part. I don't have to be right, let's see where this discussion leads us. (I mentioned that upthread, but I don't think it is a good idea to discuss about a redesign of those routines on a thread about pgbench based on $subject. All the main players are here so it likely does not matter, but..) -- Michael
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl4YNYcACgkQnvQgOdby QH1nXg//cNBUpIdTEqZI47yqO+FOt2puDnSwNI5Aro4IJe5qlffnmuEXdEPLo+uz eC3BphRH8+lu0SxZxnyZWqH/RTgeJLMRuQ3ota7tHUPuaSbGFNEa3aelh/rC2D9Z +NNSp4DvMwPWXuwI6K1j9gKLVhZKZqDnV7YZMPjGV/n9pcXXWLKOhlcM9A6NmkrR Yppuj9ucD4+MIx/BiEaH/QhBmBjbvQlWzcnyUGimns5CAk6a7nKm/+LNjj/ScCU6 v/g16ji0HW2gmHJWiaK3SIOlhWoo/TOdj5MT4/xqff/Ecpol7sXOLshICRke9t98 h2bXjHH3rg3QE4THAfUJ7+eZfaVfS4A+KQFIMnNGhF9Jgool8YFsVMrdvLXyCVu7 B4HICx01BAPf07+eK0aagXe4WkEirfjc2kzhCpINTHs61/8JXEf562jVdSkcGkdF 1ZQToefZxQeNhGr3dc9apsEycKako3Vs1A1Oec+7Ygxrd5q0a0vNPBM/HEiYflyU 72eF3afbsNASLsV5AjnE9cfME/7FfPq3soLQayQ/ktHUkGmJI55ds/Yf/NpSMfO4 udYMc5dka38Vp+O7FN7nrGIVFeLf5Z+NeJHQm89LFh/mAKwGV5jl8QCIGslDNM/y YDECSnH/7bWEsvgU2UOtbvQOkCAfy7BE8HJ1JV/utSNlofcD/ys= =RMu1 -----END PGP SIGNATURE-----