Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317380 - add '#define xdc_runtime_Log_ENABLE' symbol (default 1) to allow compile out Log
Summary: add '#define xdc_runtime_Log_ENABLE' symbol (default 1) to allow compile out Log
Status: CLOSED FIXED
Alias: None
Product: RTSC
Classification: Technology
Component: Runtime (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Chris McCormick CLA
QA Contact:
URL:
Whiteboard: target:3.20.02
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-20 12:40 EDT by Karl Wechsler CLA
Modified: 2011-06-20 14:42 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Wechsler CLA 2010-06-20 12:40:01 EDT
We need to enable users to build libraries without any Log overhead.

I think we should add something like this:

#ifndef xdc_runtime_Log'
#define xdc_runtime_Log_ENABLE 1
#endif

And then update all of Log macros to have this as conditional first check.  I think this will cause most compilers to remove the Log call.  We need to check.  If not, then we'd have to have separate versions of each API.

change this:

#define xdc_runtime_Log_write0(evt) \
    ((Module__LOGDEF && xdc_runtime_Diags_query(evt)) ? \
        (xdc_runtime_Log_put0((evt), Module__MID)) : (void)0 \
    )

to this:

#define xdc_runtime_Log_write0(evt) \
    ((xdc_runtime_Log_ENABLE && Module__LOGDEF && xdc_runtime_Diags_query(evt)) ? \
        (xdc_runtime_Log_put0((evt), Module__MID)) : (void)0 \
    )


This also needs to be added to the cdoc documentation.
Comment 1 Chris McCormick CLA 2010-07-23 14:23:46 EDT
Implemented this enhancement in xdc-v44. The relevant symbols are documented in the Log module header CDOC.
Comment 2 Dave Russo CLA 2010-08-23 14:19:42 EDT
Verified by Karl per email shown below:


________________________________________
From: Wechsler, Karl 
Sent: Thursday, August 05, 2010 4:50 PM
To: Mookerjee, Amit; Rowlands, Jon; Harris, Ramsey; Ring, Chris; Degraw, Yvonne; Ramdas, Nitya; McCormick, Chris
Cc: Blake, Jon
Subject: RE: Fix verify assignments for XDCtools 3.20.02

I verified all the bugs below but did not change state to verify pass.  

I changed state to “VERIFIED” for those that I could.  Others don’t give me that option.

I updated title of 318256 to say:

update all C6x/ELF targets to use 7.1.0B2 compiler

I found minor issue with the Log disable fix.  I fixed it and will give Sasa a tdiff.

317380	add '#define xdc_runtime_Log_ENABLE' symbol (default 1) to allow compile out Log	KarlW


-Karl-
Comment 3 Dave Russo CLA 2011-06-20 14:42:19 EDT
Shipped in XDCtools 3.20.02