HTCondor Project List Archives



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Condor-devel] dprintf changes in master



On 5/31/2012 10:53 AM, John (TJ) Knoeller wrote:
This morning I pushed to the master branch a combination of Z's changes
to allow for multiple output destinations from dprintf,

Hmmm, dprintf output to multiple destinations functionality has existed for almost 10 years. Behold from the v7.4.x manual:

<SUBSYS>_<LEVEL>_LOG
The name of a log file for messages at a specific debug level for a specific subsystem. <LEVEL> is defined by any debug level, but without the D_ prefix. See section 3.3.4 for the list of debug levels. If the debug level is included in $(<SUBSYS>_DEBUG), then all messages of this debug level will be written both to the log file defined by <SUBSYS>_LOG and the the log file defined by <SUBSYS>_<LEVEL>_LOG. As examples, SHADOW_SYSCALLS_LOG specifies a log file for all remote system call debug messages, and NEGOTIATOR_MATCH_LOG specifies a log file that only captures condor_negotiator debug events occurring with matches.

So what/why did Z change with respect to allowing multiple output destinations?

Also, this plus all the other below wisdom should live on the condor-wiki as well, not just in a ephemeral email. Ideally the below wisdom should go into a post-mortem design document that ticket #2933 points towards.

Currently it is difficult to look at ticket #2933 and quickly understand what is going on. Seems like you changed dprintf so there 1) can be more than 32 defined subsystems, and 2) can be both a subsystem and a verbosity level defined, right? Please edit the ticket description so it just says that straight-up, with a pithy up-front example of how the interface to dprintf() changed such that both the severity and subsystem can be stated.

thanks
Todd

and my changes to convert most of the dprintf 'flags' into an enumerated
set of categories.
see https://condor-wiki.cs.wisc.edu/index.cgi/tktview?tn=2933 for more
information.

These patches change many of the internal global variables that dprintf
uses and that a lot of code used to party on directly. In
particular, you can no longer change the DebugFlags global variable and
expect dprintf to react.

The good news is that there is now more room to add new output
formatting flags (like D_PID), and also more room for new categories.
Current implementation allows for 32 categories and 32 flags. we
currently have 26 categories and 10 flags. I expect Zs future changes
to increase the the limit on the number of categories substantially.

The bad news is that any given message can be assigned to only 1 category.

dprintf (D_SECURITY | D_COMMAND, ... )

Is no longer allowed. since these are both categories. We don't do this
in any current code, but it used to be OK if you did. now
you get unexpected results. D_SECURITY is 1011 binary, D_COMMAND = 1100
binary so this is effectively the same thing as sending 1111 binary
which is dprintf (D_KEYBOARD,

For backward compatibility D_FULLDEBUG gets a lot of special case
behavior, both in the code, were it is defined as a verbosity flag. so
dprintf(D_SECURITY | D_FULLDEBUG, is still allowed. and

dprintf(D_FULLDEBUG

is interpreted as

dprintf(D_ALWAYS | D_VERBOSE.

It is now possible to configure the verbosity output level of each of
the categories individually. so in condor_config you can say

SCHEDD_DEBUG = D_FULLDEBUG D_SECURITY:2 D_COMMAND

This will give you verbose D_SECURITY and D_ALWAYS, but non-verbose
D_COMMAND output. This was combination was
impossible to express before. In parsing condor_config D_FULLDEBUG it is
used as a _global_ verbosity modifier unless
the new syntax is used, so

SCHEDD_DEBUG = D_FULLDEBUG D_SECURITY D_COMMAND

gives verbose output for D_ALWAYS, D_SECURITY and D_COMMAND, just like
always because the new syntax is NOT used.

-tj





_______________________________________________
Condor-devel mailing list
Condor-devel@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/condor-devel


--
Todd Tannenbaum <tannenba@xxxxxxxxxxx> University of Wisconsin-Madison
Center for High Throughput Computing   Department of Computer Sciences
Condor Project Technical Lead          1210 W. Dayton St. Rm #4257
Phone: (608) 263-7132                  Madison, WI 53706-1685