Customising Data Logging using TraceEvents RRS feed

  • Question

  • Hi,

    In my driver for printing the messages i am using TraceEvents with Levels Error,Warning and Information.

    But what my concern now is that the filtering of messages is done by tracelog ,which i do not want as it overloads the performance of driver when there are many messages.

    From my application i set a Level and only logs belonging to that level should be printed.

    For now I put an if condition to check the level each and everytime before the trace message.

    When i tried to define TraceEvents it did not work. Also I tried to create a function and pass the parameters which did not work. 

    I am sharing that function below where i see an error:

    if (TracingFlag >= 3)                           //TracingFlag is the level passed from Application.

    TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_DEVICE, "%!FUNC! Exit ");    \\Message prints successfully.

       \\After the string is passed from here it throws an error.

    char ch[100];
    strcpy(ch, "! FUNC! Exit  ---- Trial");
    DataLogging(TRACE_LEVEL_INFORMATION, ch[0]);


    NTSTATUS DataLogging(int Level, LPCSTR* cstring)
    if (TracingFlag >=3)
    TraceEvents(Level, TRACE_DEVICE, cstring);


    This is the piece of code which does not work and throws an error "error: (parseMsg)parsing cstring. Cannot find format string"

    I have a few functions with this regard which are:

    1.Can I use this method.

    2.Can i Use TraceEvents this way by passing parameters from another method.

    I understand that passing the arguement from another method into TraceEvents has caused this error.

    3.Can you suggest any way that strings can be passed into TraceEvents as arguments.

    Please help me with this.


    Thursday, February 19, 2015 7:28 AM


  • wpp already has these types of pre checks, just use it as is

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, February 19, 2015 3:32 PM

All replies