Fwd: Generate etl file programmatically

HI,

I am starting the session through StartTrace and EnableTrace which are both
successfully getting executed.

After that I am logging the messages through wpp to an etl file.

Then I am stopping the session through CloseSession.

Now etl file is genrated , but it doesn’t contain any logs.

Is it because I have not registered the provider through EventRegister or
the concept is not possible (i.e auto generation of etl file is not
possible). I am trying to implement ETW concept to WPP.

EventRegister is not available in Win2k/Xp that’s why I am not using it…
(anyhow I was able to successfully log ETW events using ETW to etl file
without using EventRegister in 2k and XP)

Thanks
Anshul Makkar

---------- Forwarded message ----------
From: anshul makkar
Date: Thu, Jul 30, 2009 at 8:38 PM
Subject: Generate etl file programmatically
To: xxxxx@lists.osr.com

Hi,

In ETW architecture we can start a session programmatically using StartTrace
etc and then write event using eventwrite that will auto generate an etl
file … SO there is no need to manually start a tracing session from command
prompt like xperf or tracerpt etc.

Can the similar feat be achieved through wpp. Actually I want that error log
etl files should be automatically generated on end user’s system when my
application runs without anyone’s intervention.
Please if anyone has any idea on this, then please let me know.

Thanks
Anshul Makkar

Hi,
I think it was already mentioned that WPP is a pre-processor build on top of ETW (it just uses a slightly different logging api - TraceMessage, but everething else is the same). So the answer to your question is yes, it is certainly possible and quite easily doable.
Thanks,
Alex

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of anshul makkar
Sent: Thursday, July 30, 2009 8:08 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Generate etl file programmatically

Hi,

In ETW architecture we can start a session programmatically using StartTrace
etc and then write event using eventwrite that will auto generate an etl
file … SO there is no need to manually start a tracing session from command
prompt like xperf or tracerpt etc.

Can the similar feat be achieved through wpp. Actually I want that error log
etl files should be automatically generated on end user’s system when my
application runs without anyone’s intervention.
Please if anyone has any idea on this, then please let me know.

Thanks
Anshul Makkar
— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Are logs getting generated when you use command line tools (tracelog, etc) to control tracing. Most likely you are not using correct level/flags to enable your provider. In the debugger you can put a break-point on:

YourExe!WppControlCallback

To check if your provider is getting enabled. You should also step through the tracing call to see if TraceMessage is getting called (with correct logger id) and returns success. Note that if you enable your provider after it registers there might be a short delay due to the asynchronous nature of enable notification. You can work around this by having the following sequence of operations:

StartTrace
EnableProvider
WPP_INIT_TRACING()

Note that the behavior I just described is not WPP specific.
Thanks,
Alex

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of anshul makkar
Sent: Thursday, July 30, 2009 8:09 AM
To: Windows System Software Devs Interest List
Cc: anshul makkar
Subject: [ntdev] Fwd: Generate etl file programmatically

HI,

I am starting the session through StartTrace and EnableTrace which are both
successfully getting executed.

After that I am logging the messages through wpp to an etl file.

Then I am stopping the session through CloseSession.

Now etl file is genrated , but it doesn’t contain any logs.

Is it because I have not registered the provider through EventRegister or
the concept is not possible (i.e auto generation of etl file is not
possible). I am trying to implement ETW concept to WPP.

EventRegister is not available in Win2k/Xp that’s why I am not using it…
(anyhow I was able to successfully log ETW events using ETW to etl file
without using EventRegister in 2k and XP)

Thanks
Anshul Makkar
---------- Forwarded message ----------
From: anshul makkar >
Date: Thu, Jul 30, 2009 at 8:38 PM
Subject: Generate etl file programmatically
To: xxxxx@lists.osr.commailto:xxxxx

Hi,

In ETW architecture we can start a session programmatically using StartTrace
etc and then write event using eventwrite that will auto generate an etl
file … SO there is no need to manually start a tracing session from command
prompt like xperf or tracerpt etc.

Can the similar feat be achieved through wpp. Actually I want that error log
etl files should be automatically generated on end user’s system when my
application runs without anyone’s intervention.
Please if anyone has any idea on this, then please let me know.

Thanks
Anshul Makkar

— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx>

Yes, logs are gettting logged when I am using command line tool.

But programmatically when I am trying to log, they are not getting logged.
Etl file is created but it doesn’t contain any log messages.

Here are the steps I am performing

  1. RegisterTraceGUIDS(to register the Provider and events - event
    registration should not be required)

  2. StartTrace – succeeding

  3. EnableTrace – succeeding

  4. WPP_INIT_TRACING

  5. DoTraceMessage.

You wrote about EnableProvider, I am doing it through RegisterTraceGUIDS and
not through EventRegister as its not available in 2k/XP.

Please confirm the order or I am missing something.,

Thanks
Anshul Makkar
On Thu, Jul 30, 2009 at 8:56 PM, Alex Bendetov wrote:

> Are logs getting generated when you use command line tools (tracelog,
> etc) to control tracing. Most likely you are not using correct level/flags
> to enable your provider. In the debugger you can put a break-point on:
>
>
>
> YourExe!WppControlCallback
>
>
>
> To check if your provider is getting enabled. You should also step through
> the tracing call to see if TraceMessage is getting called (with correct
> logger id) and returns success. Note that if you enable your provider after
> it registers there might be a short delay due to the asynchronous nature of
> enable notification. You can work around this by having the following
> sequence of operations:
>
>
>
> StartTrace
>
> EnableProvider
>
> WPP_INIT_TRACING()
>
>
>
> Note that the behavior I just described is not WPP specific.
>
> Thanks,
> Alex
>
>
>
>
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *anshul makkar
> Sent: Thursday, July 30, 2009 8:09 AM
> To: Windows System Software Devs Interest List
> Cc: anshul makkar
> Subject: [ntdev] Fwd: Generate etl file programmatically
>
>
>
> HI,
>
> I am starting the session through StartTrace and EnableTrace which are both
> successfully getting executed.
>
> After that I am logging the messages through wpp to an etl file.
>
> Then I am stopping the session through CloseSession.
>
> Now etl file is genrated , but it doesn’t contain any logs.
>
> Is it because I have not registered the provider through EventRegister or
> the concept is not possible (i.e auto generation of etl file is not
> possible). I am trying to implement ETW concept to WPP.
>
> EventRegister is not available in Win2k/Xp that’s why I am not using it…
> (anyhow I was able to successfully log ETW events using ETW to etl file
> without using EventRegister in 2k and XP)
>
> Thanks
> Anshul Makkar
>
> ---------- Forwarded message ----------
> From: anshul makkar
> Date: Thu, Jul 30, 2009 at 8:38 PM
> Subject: Generate etl file programmatically
> To: xxxxx@lists.osr.com
>
> Hi,
>
> In ETW architecture we can start a session programmatically using
> StartTrace
> etc and then write event using eventwrite that will auto generate an etl
> file … SO there is no need to manually start a tracing session from
> command
> prompt like xperf or tracerpt etc.
>
> Can the similar feat be achieved through wpp. Actually I want that error
> log
> etl files should be automatically generated on end user’s system when my
> application runs without anyone’s intervention.
>
> Please if anyone has any idea on this, then please let me know.
>
>
>
> Thanks
>
> Anshul Makkar
>
>
> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
> the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

If you are using WPP_INIT_TRACING why are you calling RegisterTraceGuids (that doesn’t make sence). I think I outlined general debugging steps in my previous e-mail. Verify that enable callback is getting called. Verify that TraceMessage is getting called. Let me know if you still can’t get this to work.
Thanks,
Alex

From: anshul makkar [mailto:xxxxx@gmail.com]
Sent: Thursday, July 30, 2009 8:59 AM
To: Windows System Software Devs Interest List
Cc: Alex Bendetov
Subject: Re: [ntdev] Fwd: Generate etl file programmatically

Yes, logs are gettting logged when I am using command line tool.

But programmatically when I am trying to log, they are not getting logged. Etl file is created but it doesn’t contain any log messages.

Here are the steps I am performing

  1. RegisterTraceGUIDS(to register the Provider and events - event registration should not be required)

  2. StartTrace – succeeding

  3. EnableTrace – succeeding

  4. WPP_INIT_TRACING

  5. DoTraceMessage.

You wrote about EnableProvider, I am doing it through RegisterTraceGUIDS and not through EventRegister as its not available in 2k/XP.

Please confirm the order or I am missing something.,

Thanks
Anshul Makkar
On Thu, Jul 30, 2009 at 8:56 PM, Alex Bendetov > wrote:

Are logs getting generated when you use command line tools (tracelog, etc) to control tracing. Most likely you are not using correct level/flags to enable your provider. In the debugger you can put a break-point on:

YourExe!WppControlCallback

To check if your provider is getting enabled. You should also step through the tracing call to see if TraceMessage is getting called (with correct logger id) and returns success. Note that if you enable your provider after it registers there might be a short delay due to the asynchronous nature of enable notification. You can work around this by having the following sequence of operations:

StartTrace

EnableProvider

WPP_INIT_TRACING()

Note that the behavior I just described is not WPP specific.

Thanks,
Alex

From: xxxxx@lists.osr.commailto:xxxxx [mailto:xxxxx@lists.osr.commailto:xxxxx] On Behalf Of anshul makkar
Sent: Thursday, July 30, 2009 8:09 AM

To: Windows System Software Devs Interest List
Cc: anshul makkar
Subject: [ntdev] Fwd: Generate etl file programmatically

HI,

I am starting the session through StartTrace and EnableTrace which are both
successfully getting executed.

After that I am logging the messages through wpp to an etl file.

Then I am stopping the session through CloseSession.

Now etl file is genrated , but it doesn’t contain any logs.

Is it because I have not registered the provider through EventRegister or
the concept is not possible (i.e auto generation of etl file is not
possible). I am trying to implement ETW concept to WPP.

EventRegister is not available in Win2k/Xp that’s why I am not using it…
(anyhow I was able to successfully log ETW events using ETW to etl file
without using EventRegister in 2k and XP)

Thanks
Anshul Makkar

---------- Forwarded message ----------
From: anshul makkar >
Date: Thu, Jul 30, 2009 at 8:38 PM
Subject: Generate etl file programmatically
To: xxxxx@lists.osr.commailto:xxxxx

Hi,

In ETW architecture we can start a session programmatically using StartTrace
etc and then write event using eventwrite that will auto generate an etl
file … SO there is no need to manually start a tracing session from command
prompt like xperf or tracerpt etc.

Can the similar feat be achieved through wpp. Actually I want that error log
etl files should be automatically generated on end user’s system when my
application runs without anyone’s intervention.

Please if anyone has any idea on this, then please let me know.

Thanks

Anshul Makkar

— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx></mailto:xxxxx>

What you have described is a provider and a controller, to receive events in your log file I think you will also need to implement a consumer using OpenTrace and ProcessTrace functions. However I have no idea how WPP comes into play or how this exactly related, all this stuff is not exactly what I would call straightforward.

//Daniel

“anshul makkar” wrote in message news:xxxxx@ntdev…
Yes, logs are gettting logged when I am using command line tool.

But programmatically when I am trying to log, they are not getting logged. Etl file is created but it doesn’t contain any log messages.

Here are the steps I am performing

1) RegisterTraceGUIDS(to register the Provider and events - event registration should not be required)

2) StartTrace – succeeding

3) EnableTrace – succeeding

4) WPP_INIT_TRACING

5) DoTraceMessage.

You wrote about EnableProvider, I am doing it through RegisterTraceGUIDS and not through EventRegister as its not available in 2k/XP.

Please confirm the order or I am missing something.,

Thanks
Anshul Makkar

On Thu, Jul 30, 2009 at 8:56 PM, Alex Bendetov wrote:

Are logs getting generated when you use command line tools (tracelog, etc) to control tracing. Most likely you are not using correct level/flags to enable your provider. In the debugger you can put a break-point on:

YourExe!WppControlCallback

To check if your provider is getting enabled. You should also step through the tracing call to see if TraceMessage is getting called (with correct logger id) and returns success. Note that if you enable your provider after it registers there might be a short delay due to the asynchronous nature of enable notification. You can work around this by having the following sequence of operations:

StartTrace

EnableProvider

WPP_INIT_TRACING()

Note that the behavior I just described is not WPP specific.

Thanks,
Alex

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of anshul makkar
Sent: Thursday, July 30, 2009 8:09 AM

To: Windows System Software Devs Interest List

Cc: anshul makkar
Subject: [ntdev] Fwd: Generate etl file programmatically

HI,

I am starting the session through StartTrace and EnableTrace which are both
successfully getting executed.

After that I am logging the messages through wpp to an etl file.

Then I am stopping the session through CloseSession.

Now etl file is genrated , but it doesn’t contain any logs.

Is it because I have not registered the provider through EventRegister or
the concept is not possible (i.e auto generation of etl file is not
possible). I am trying to implement ETW concept to WPP.

EventRegister is not available in Win2k/Xp that’s why I am not using it…
(anyhow I was able to successfully log ETW events using ETW to etl file
without using EventRegister in 2k and XP)

Thanks
Anshul Makkar

---------- Forwarded message ----------
From: anshul makkar
Date: Thu, Jul 30, 2009 at 8:38 PM
Subject: Generate etl file programmatically
To: xxxxx@lists.osr.com

Hi,

In ETW architecture we can start a session programmatically using StartTrace
etc and then write event using eventwrite that will auto generate an etl
file … SO there is no need to manually start a tracing session from command
prompt like xperf or tracerpt etc.

Can the similar feat be achieved through wpp. Actually I want that error log
etl files should be automatically generated on end user’s system when my
application runs without anyone’s intervention.

Please if anyone has any idea on this, then please let me know.

Thanks

Anshul Makkar

— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

wrote in message news:xxxxx@ntdev…
> What you have described is a provider and a controller, to receive events
> in your log file I think you will also need to implement a consumer using
> OpenTrace and ProcessTrace functions. However I have no idea how WPP comes
> into play or how this exactly related, all this stuff is not exactly what
> I would call straightforward.
>
> //Daniel

The OP wants the trace just to go to some etl file.
My guess is, he does not pass the right level & flags.

In the example code, the level and flags are interchanged in some strange
way:
the wpp trace function is specified as
FUNC TestWPPLog(LEVEL,MSG,…); ( posted by Ivan B. )
but in the code that calls this macro, in place of the LEVEL arg actually
are flags.

Example of Alex B. uses the default macro name
DoTraceMessage(Info, “Hello World”);
- and here “Info” is a flag bit , not a level.
Hope the OP could get this straight by looking at and debugging the code
generated in .tmh files.

Also, I’ve sent a complaint to the MSDN docum feedback address about lack
of WPP documentation outside of WDK - but won’t hold my breath.

Regards,
–pa

> “anshul makkar” wrote in message
> news:xxxxx@ntdev…
> Yes, logs are gettting logged when I am using command line tool.
>
> But programmatically when I am trying to log, they are not getting
> logged. Etl file is created but it doesn’t contain any log messages.
>
> Here are the steps I am performing
>
> 1) RegisterTraceGUIDS(to register the Provider and events - event
> registration should not be required)
>
> 2) StartTrace – succeeding
>
> 3) EnableTrace – succeeding
>
> 4) WPP_INIT_TRACING
>
> 5) DoTraceMessage.
>
> You wrote about EnableProvider, I am doing it through RegisterTraceGUIDS
> and not through EventRegister as its not available in 2k/XP.
>
> Please confirm the order or I am missing something.,
>
> Thanks
> Anshul Makkar
>
> On Thu, Jul 30, 2009 at 8:56 PM, Alex Bendetov
> wrote:
>
> Are logs getting generated when you use command line tools (tracelog,
> etc) to control tracing. Most likely you are not using correct level/flags
> to enable your provider. In the debugger you can put a break-point on:
>
>
>
> YourExe!WppControlCallback
>
>
>
> To check if your provider is getting enabled. You should also step
> through the tracing call to see if TraceMessage is getting called (with
> correct logger id) and returns success. Note that if you enable your
> provider after it registers there might be a short delay due to the
> asynchronous nature of enable notification. You can work around this by
> having the following sequence of operations:
>
>
>
> StartTrace
>
> EnableProvider
>
> WPP_INIT_TRACING()
>
>
>
> Note that the behavior I just described is not WPP specific.
>
> Thanks,
> Alex
>
>
>
>
>
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of anshul makkar
> Sent: Thursday, July 30, 2009 8:09 AM
>
>
> To: Windows System Software Devs Interest List
>
> Cc: anshul makkar
> Subject: [ntdev] Fwd: Generate etl file programmatically
>
>
>
>
> HI,
>
> I am starting the session through StartTrace and EnableTrace which are
> both
> successfully getting executed.
>
> After that I am logging the messages through wpp to an etl file.
>
> Then I am stopping the session through CloseSession.
>
> Now etl file is genrated , but it doesn’t contain any logs.
>
> Is it because I have not registered the provider through EventRegister
> or
> the concept is not possible (i.e auto generation of etl file is not
> possible). I am trying to implement ETW concept to WPP.
>
> EventRegister is not available in Win2k/Xp that’s why I am not using
> it…
> (anyhow I was able to successfully log ETW events using ETW to etl file
> without using EventRegister in 2k and XP)
>
> Thanks
> Anshul Makkar
>
> ---------- Forwarded message ----------
> From: anshul makkar
> Date: Thu, Jul 30, 2009 at 8:38 PM
> Subject: Generate etl file programmatically
> To: xxxxx@lists.osr.com
>
>
>
> Hi,
>
> In ETW architecture we can start a session programmatically using
> StartTrace
> etc and then write event using eventwrite that will auto generate an
> etl
> file … SO there is no need to manually start a tracing session from
> command
> prompt like xperf or tracerpt etc.
>
> Can the similar feat be achieved through wpp. Actually I want that
> error log
> etl files should be automatically generated on end user’s system when
> my
> application runs without anyone’s intervention.
>
> Please if anyone has any idea on this, then please let me know.
>
>
>
> Thanks
>
> Anshul Makkar
>
>
>
>
> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging
> and other seminars visit: http://www.osr.com/seminars To unsubscribe,
> visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>

“Pavel A.” wrote in message news:xxxxx@ntdev…
> The OP wants the trace just to go to some etl file.
> My guess is, he does not pass the right level & flags.
>

There is another thing I remember, if StartTrace is called by the controller
with an EVENT_TRACE_PROPERTIES with a real-time LogFileMode, events will not
be delivered to the ETL file until the trace is stopped.

//Daniel

You can start/stop/control WPP trace sessions with WMI calls. Look at the
WMI class TraceLogger.

VBScript code to start a new trace session would look something like:

GUIDs = Array(“{12345678-123456789-1234-123456789001}”, _
“{12345678-123456789-1234-123456789002”)

Dim flags(2)
im levels(2)

For i = 0 to UBound(flags)
flags(i) = CLng(&HFFFFFFFF)
levels(i) = 2
ext

Set objWbemLocator = CreateObject(“WbemScripting.SWbemLocator”)
Set objWbemServicesWMI = objWbemLocator.ConnectServer(“”, “root\wmi”)


Set objTraceLogger = objWbemServicesWMI.Get(“TraceLogger”).SpawnInstance_()
objTraceLogger.Name = “MyTrace”

With objTraceLogger
'.LogFileMode = “RealTime”
.LogFileMode = “Sequential”
.LogFileName = “log.etl”
.Guid = GUIDs
.EnableFlags = flags
.Level = levels
End With

call objWbemServicesWMI.Put(objTraceLogger, 2)

Jan

In ETW architecture we can start a session programmatically using StartTrace
etc and then write event using eventwrite that will auto generate an etl
file … SO there is no need to manually start a tracing session from command
prompt like xperf or tracerpt etc.

Can the similar feat be achieved through wpp. Actually I want that error log
etl files should be automatically generated on end user’s system when my
application runs without anyone’s intervention.

Right , very true… What I want is to combine provider and controller. My
consumer application will be seperate…

Anshul Makkar

On Thu, Jul 30, 2009 at 9:59 PM, wrote:

> What you have described is a provider and a controller, to receive events
> in your log file I think you will also need to implement a consumer using
> OpenTrace and ProcessTrace functions. However I have no idea how WPP comes
> into play or how this exactly related, all this stuff is not exactly what I
> would call straightforward.
>
> //Daniel
>
>
>
> “anshul makkar” wrote in message
> news:xxxxx@ntdev…
> Yes, logs are gettting logged when I am using command line tool.
>
> But programmatically when I am trying to log, they are not getting logged.
> Etl file is created but it doesn’t contain any log messages.
>
> Here are the steps I am performing
>
> 1) RegisterTraceGUIDS(to register the Provider and events - event
> registration should not be required)
>
> 2) StartTrace – succeeding
>
> 3) EnableTrace – succeeding
>
> 4) WPP_INIT_TRACING
>
> 5) DoTraceMessage.
>
> You wrote about EnableProvider, I am doing it through RegisterTraceGUIDS
> and not through EventRegister as its not available in 2k/XP.
>
> Please confirm the order or I am missing something.,
>
> Thanks
> Anshul Makkar
> On Thu, Jul 30, 2009 at 8:56 PM, Alex Bendetov wrote:
>
>> Are logs getting generated when you use command line tools (tracelog,
>> etc) to control tracing. Most likely you are not using correct level/flags
>> to enable your provider. In the debugger you can put a break-point on:
>>
>>
>>
>> YourExe!WppControlCallback
>>
>>
>>
>> To check if your provider is getting enabled. You should also step through
>> the tracing call to see if TraceMessage is getting called (with correct
>> logger id) and returns success. Note that if you enable your provider after
>> it registers there might be a short delay due to the asynchronous nature of
>> enable notification. You can work around this by having the following
>> sequence of operations:
>>
>>
>>
>> StartTrace
>>
>> EnableProvider
>>
>> WPP_INIT_TRACING()
>>
>>
>>
>> Note that the behavior I just described is not WPP specific.
>>
>> Thanks,
>> Alex
>>
>>
>>
>>
>>
>> From: xxxxx@lists.osr.com [mailto:
>> xxxxx@lists.osr.com] *On Behalf Of *anshul makkar
>> Sent: Thursday, July 30, 2009 8:09 AM
>> To: Windows System Software Devs Interest List
>> Cc: anshul makkar
>> Subject: [ntdev] Fwd: Generate etl file programmatically
>>
>>
>>
>> HI,
>>
>> I am starting the session through StartTrace and EnableTrace which are
>> both
>> successfully getting executed.
>>
>> After that I am logging the messages through wpp to an etl file.
>>
>> Then I am stopping the session through CloseSession.
>>
>> Now etl file is genrated , but it doesn’t contain any logs.
>>
>> Is it because I have not registered the provider through EventRegister or
>> the concept is not possible (i.e auto generation of etl file is not
>> possible). I am trying to implement ETW concept to WPP.
>>
>> EventRegister is not available in Win2k/Xp that’s why I am not using it…
>> (anyhow I was able to successfully log ETW events using ETW to etl file
>> without using EventRegister in 2k and XP)
>>
>> Thanks
>> Anshul Makkar
>>
>> ---------- Forwarded message ----------
>> From: anshul makkar
>> Date: Thu, Jul 30, 2009 at 8:38 PM
>> Subject: Generate etl file programmatically
>> To: xxxxx@lists.osr.com
>>
>> Hi,
>>
>> In ETW architecture we can start a session programmatically using
>> StartTrace
>> etc and then write event using eventwrite that will auto generate an etl
>> file … SO there is no need to manually start a tracing session from
>> command
>> prompt like xperf or tracerpt etc.
>>
>> Can the similar feat be achieved through wpp. Actually I want that error
>> log
>> etl files should be automatically generated on end user’s system when my
>> application runs without anyone’s intervention.
>>
>> Please if anyone has any idea on this, then please let me know.
>>
>>
>>
>> Thanks
>>
>> Anshul Makkar
>>
>>
>> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
>> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
>> the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

The LogFileMode property in EVENT_TRACE_PROPERTIES has been set correctly to
log to file and not to a real time session.

I will verify the logs and level.

Thanks
Anshul Makkar
On Thu, Jul 30, 2009 at 11:26 PM, wrote:

> “Pavel A.” wrote in message news:xxxxx@ntdev…
>
>> The OP wants the trace just to go to some etl file.
>> My guess is, he does not pass the right level & flags.
>>
>>
> There is another thing I remember, if StartTrace is called by the
> controller with an EVENT_TRACE_PROPERTIES with a real-time LogFileMode,
> events will not be delivered to the ETL file until the trace is stopped.
>
> //Daniel
>
> —
>
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Hi,

You talked about

YourExe!WppControlCallback …

This is the point I may be missing. I have not defined any callback… Can
you please tell any macro or functin where it has to be defined or where it
is included.

Thanks
Anshul Makkar

On Thu, Jul 30, 2009 at 8:56 PM, Alex Bendetov wrote:

> Are logs getting generated when you use command line tools (tracelog,
> etc) to control tracing. Most likely you are not using correct level/flags
> to enable your provider. In the debugger you can put a break-point on:
>
>
>
> YourExe!WppControlCallback
>
>
>
> To check if your provider is getting enabled. You should also step through
> the tracing call to see if TraceMessage is getting called (with correct
> logger id) and returns success. Note that if you enable your provider after
> it registers there might be a short delay due to the asynchronous nature of
> enable notification. You can work around this by having the following
> sequence of operations:
>
>
>
> StartTrace
>
> EnableProvider
>
> WPP_INIT_TRACING()
>
>
>
> Note that the behavior I just described is not WPP specific.
>
> Thanks,
> Alex
>
>
>
>
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *anshul makkar
> Sent: Thursday, July 30, 2009 8:09 AM
> To: Windows System Software Devs Interest List
> Cc: anshul makkar
> Subject: [ntdev] Fwd: Generate etl file programmatically
>
>
>
> HI,
>
> I am starting the session through StartTrace and EnableTrace which are both
> successfully getting executed.
>
> After that I am logging the messages through wpp to an etl file.
>
> Then I am stopping the session through CloseSession.
>
> Now etl file is genrated , but it doesn’t contain any logs.
>
> Is it because I have not registered the provider through EventRegister or
> the concept is not possible (i.e auto generation of etl file is not
> possible). I am trying to implement ETW concept to WPP.
>
> EventRegister is not available in Win2k/Xp that’s why I am not using it…
> (anyhow I was able to successfully log ETW events using ETW to etl file
> without using EventRegister in 2k and XP)
>
> Thanks
> Anshul Makkar
>
> ---------- Forwarded message ----------
> From: anshul makkar
> Date: Thu, Jul 30, 2009 at 8:38 PM
> Subject: Generate etl file programmatically
> To: xxxxx@lists.osr.com
>
> Hi,
>
> In ETW architecture we can start a session programmatically using
> StartTrace
> etc and then write event using eventwrite that will auto generate an etl
> file … SO there is no need to manually start a tracing session from
> command
> prompt like xperf or tracerpt etc.
>
> Can the similar feat be achieved through wpp. Actually I want that error
> log
> etl files should be automatically generated on end user’s system when my
> application runs without anyone’s intervention.
>
> Please if anyone has any idea on this, then please let me know.
>
>
>
> Thanks
>
> Anshul Makkar
>
>
> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
> the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>