WPP - Trace Msg Func: dbgwrt(LEVEL,(FLAGS,MSG,...))

Discussion in 'Windows Vista Drivers' started by Dieter Pfeuffer, Feb 25, 2008.

  1. Hi,

    is it possible to define a trace message function that supports the
    following parameter list: dbgwrt(TRACE_LEVEL_ERROR,(DBG_KRNL,"test")) ?

    I have to convert in a lot of C projects with some OS independent code debug
    print messages with the following fix layout 'DbgFunc(dbgFlag,
    (dbgLev,"test\n"))' to WPP trace messages.
    It seems that additional '( )' brackets within the parameter list of a trace
    message function are only allowed as follows:

    #1 (OK)
    sources file: RUN_WPP= $(SOURCES) -km -func:dbgwrt1((LEVEL,FLAGS,MSG,...))
    C file: dbgwrt1((TRACE_LEVEL_ERROR,DBG_KRNL,"test %d",123));

    #2 (OK)
    sources file: RUN_WPP= $(SOURCES) -km -func:dbgwrt2(LEVEL,FLAGS,(MSG,...))
    C file: dbgwrt2(TRACE_LEVEL_ERROR,DBG_KRNL,("test %d",123));

    but NOT:
    #3 (ERROR)
    sources file: RUN_WPP= $(SOURCES) -km -func:dbgwrt3(LEVEL,(FLAGS,MSG,...))
    C file: dbgwrt3(TRACE_LEVEL_ERROR,(DBG_KRNL,"test %d",123));

    I get the following errors during compilation for #3:
    ...\bk.tmh(685) : error C2010: '(' : unexpected in macro formal parameter list
    ...\bk.c(121) : error C2059: syntax error : ')'
    ...\bk.c(121) : error C4013: '_POST' undefined; assuming extern returning int
    ...\bk.c(121) : error C2065: 'LEVEL' : undeclared identifier
    ...\bk.c(121) : error C2065: 'DBG_KRNL' : undeclared identifier
    ....and more

    My WPP defines:

    #define WPP_CONTROL_GUIDS \
    WPP_DEFINE_CONTROL_GUID(MDIS5,(0C3EE0F3,B98F,4a28,90ED,457E2344A9A4), \
    WPP_DEFINE_BIT(DBG_KRNL) \
    WPP_DEFINE_BIT(DBG_KRNL_IRQ) \
    )

    #define WPP_LEVEL_FLAGS_LOGGER(lvl,flags) WPP_LEVEL_LOGGER(flags)
    #define WPP_LEVEL_FLAGS_ENABLED(lvl, flags) (WPP_LEVEL_ENABLED(flags) &&
    WPP_CONTROL(WPP_BIT_ ## flags).Level >= lvl)

    Is there any solution for my problem?
    Thanks for your time!

    Best regards,
    Dieter
     
    Dieter Pfeuffer, Feb 25, 2008
    #1
    1. Advertisements

  2. One of our engineers from tracing team tried this and concluded that
    preprocessor cannot handle this.

    -Eliyas
     
    Eliyas Yakub [MSFT], Mar 8, 2008
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.