Mailinglist Archive: zypp-commit (545 mails)

< Previous Next >
[zypp-commit] r8551 - in /branches/tmp/ma/jump_sat/libzypp/zypp: base/LogControl.cc base/Logger.h solver/detail/Types.h
  • From: matz@xxxxxxxxxxxxxxxx
  • Date: Thu, 07 Feb 2008 23:54:38 -0000
  • Message-id: <20080207235438.4838324968@xxxxxxxxxxxxxxxx>
Author: matz
Date: Fri Feb 8 00:54:37 2008
New Revision: 8551

URL: http://svn.opensuse.org/viewcvs/zypp?rev=8551&view=rev
Log:
_XDEBUG is often _extremely_ expensive (the << operators for e.g.
solvables and the like). So guard applying the operators with a check
for excessive debugging. That's nearly 25% of the runtime of "zypper in
-D something".

Modified:
branches/tmp/ma/jump_sat/libzypp/zypp/base/LogControl.cc
branches/tmp/ma/jump_sat/libzypp/zypp/base/Logger.h
branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/Types.h

Modified: branches/tmp/ma/jump_sat/libzypp/zypp/base/LogControl.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/base/LogControl.cc?rev=8551&r1=8550&r2=8551&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/base/LogControl.cc (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/base/LogControl.cc Fri Feb 8
00:54:37 2008
@@ -214,6 +214,9 @@
struct LogControlImpl
{
public:
+ bool isExcessive()
+ { return _excessive; }
+
void excessive( bool onOff_r )
{ _excessive = onOff_r; }

@@ -361,6 +364,9 @@
buffer_r );
}

+ bool isExcessive()
+ { return LogControlImpl::instance.isExcessive(); }
+
/////////////////////////////////////////////////////////////////
} // namespace logger
///////////////////////////////////////////////////////////////////

Modified: branches/tmp/ma/jump_sat/libzypp/zypp/base/Logger.h
URL:
http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/base/Logger.h?rev=8551&r1=8550&r2=8551&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/base/Logger.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/base/Logger.h Fri Feb 8 00:54:37 2008
@@ -109,6 +109,7 @@
const char * file_r,
const char * func_r,
const int line_r );
+ extern bool isExcessive();

/////////////////////////////////////////////////////////////////
} // namespace logger

Modified: branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/Types.h
URL:
http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/Types.h?rev=8551&r1=8550&r2=8551&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/Types.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/Types.h Fri Feb 8
00:54:37 2008
@@ -35,7 +35,7 @@
#include "zypp/PoolItem.h"

#define _DEBUG(x) DBG << x << std::endl;
-#define _XDEBUG(x) XXX << x << std::endl;
+#define _XDEBUG(x) do { if (base::logger::isExcessive()) XXX << x <<
std::endl;} while (0)
//#define _DEBUG(x)

/////////////////////////////////////////////////////////////////////////

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages