Last Comment Bug 457984 - Enable PKCS11 module logging in optimized builds
: Enable PKCS11 module logging in optimized builds
Status: RESOLVED FIXED
:
Product: NSS
Classification: Components
Component: Build (show other bugs)
: 3.12
: All All
: P2 enhancement (vote)
: 3.12.2
Assigned To: Nelson Bolyard (seldom reads bugmail)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-30 20:18 PDT by Nelson Bolyard (seldom reads bugmail)
Modified: 2008-10-01 17:57 PDT (History)
0 users
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch v1 (522 bytes, patch)
2008-10-01 11:30 PDT, Nelson Bolyard (seldom reads bugmail)
rrelyea: review+
Details | Diff | Splinter Review
patch v2 (862 bytes, patch)
2008-10-01 13:16 PDT, Nelson Bolyard (seldom reads bugmail)
rrelyea: review+
Details | Diff | Splinter Review

Description Nelson Bolyard (seldom reads bugmail) 2008-09-30 20:18:40 PDT
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.
Comment 1 Nelson Bolyard (seldom reads bugmail) 2008-10-01 11:30:33 PDT
Created attachment 341311 [details] [diff] [review]
patch v1

Bob, please review this tiny patch
Comment 2 Robert Relyea 2008-10-01 11:48:05 PDT
Comment on attachment 341311 [details] [diff] [review]
patch v1

r+

I see no problem enabling this debugging even in optimized builds.
Comment 3 Nelson Bolyard (seldom reads bugmail) 2008-10-01 13:16:52 PDT
Created attachment 341330 [details] [diff] [review]
patch v2

Sorry, that last patch was necessary but not sufficient.
This patch adds one more line, and really works! :)
Comment 4 Robert Relyea 2008-10-01 14:15:11 PDT
Comment on attachment 341330 [details] [diff] [review]
patch v2

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

bob
Comment 5 Nelson Bolyard (seldom reads bugmail) 2008-10-01 15:28:42 PDT
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 6 Robert Relyea 2008-10-01 16:27:06 PDT
Comment on attachment 341330 [details] [diff] [review]
patch v2

r+
Comment 7 Nelson Bolyard (seldom reads bugmail) 2008-10-01 17:56:56 PDT
Thanks, Bob,

Checking in pk11load.c; new revision: 1.25; previous revision: 1.24

Note You need to log in before you can comment on or make changes to this bug.