Closed Bug 457984 Opened 16 years ago Closed 16 years ago

Enable PKCS11 module logging in optimized builds

Categories

(NSS :: Build, enhancement, P2)

3.12
enhancement

Tracking

(Not tracked)

RESOLVED FIXED
3.12.2

People

(Reporter: nelson, Assigned: nelson)

Details

Attachments

(1 file, 1 obsolete file)

The most helpful tool for debugging problems with PKCS#11 modules is 
the PKCS#11 module logging facility in NSS.  Unfortunately, it is presently
only found in debug builds.  So, every time some user in the field has a 
problem, we have to find a way to get that user a debug build to log the 
problems.  This has recently become MUCH more difficult to do on Windows.

So, I propose that we enable the PKCS#11 module logger by default in 
Optimized builds.  This can be done by a very small change to the file
nss/lib/pk11wrap/pk11load.c near line 51, which reads

51 #ifdef DEBUG
52 #define DEBUG_MODULE 1
53 #endif

Simply removing lines 51 and 53 would do.  

Alternatively, changing line 51 to read 

#if defined(DEBUG) || defined(some other symbol)

and then defining that other symbol in the Makefile would also do.
Attached patch patch v1 (obsolete) — Splinter Review
Bob, please review this tiny patch
Attachment #341311 - Flags: review?(rrelyea)
Attachment #341311 - Flags: review?(rrelyea) → review+
Comment on attachment 341311 [details] [diff] [review]
patch v1

r+

I see no problem enabling this debugging even in optimized builds.
Attached patch patch v2Splinter Review
Sorry, that last patch was necessary but not sufficient.
This patch adds one more line, and really works! :)
Attachment #341311 - Attachment is obsolete: true
Attachment #341330 - Flags: review?(rrelyea)
Comment on attachment 341330 [details] [diff] [review]
patch v2

Is this needed for PR_Log if debug isn't defined?

bob
Bob asked,
> Is this needed for PR_Log if debug isn't defined?

Yes.  Without it, all the debug_module code for PR_Logging is a no-op.
It still computes the statistics, which are output to stdout, but does 
none of the logging.
Comment on attachment 341330 [details] [diff] [review]
patch v2

r+
Attachment #341330 - Flags: review?(rrelyea) → review+
Thanks, Bob,

Checking in pk11load.c; new revision: 1.25; previous revision: 1.24
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Priority: -- → P2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: