Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WMI / ETW event tracing for DirectShow - Is it real?

137 views
Skip to first unread message

Jamie Faye Fenton

unread,
Dec 28, 2006, 9:07:13 PM12/28/06
to
I am developing a flexible DirectShow program in the
"VJ" (or realtime performance) genre. Most VJ programs
allow the users to reconfigure the media processing
pipelines in arbitrary ways. In their drive to "stand
out", VJs invariably push the limits of performance. As
a programmer, I also need to understand what the code is
doing when.

One potential source of information is the Windows
Management Instrumentation (WMI) system, which includes
a facility called "Event Tracing for Windows" (ETW). A
quick search on the later brought up a reference to a
MSDN web page which illustrates using ETW to grab
performance data on DirectShow. This URL is at:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/eventtracingindirectshow.asp

This article includes an example which uses an %include
file that I can't find anywhere:

#include <Perfstruct.h>

The example also uses several GUID values that are also
obscure.

GUID_DSHOW_CTL
GUID_STREAMTRACE
GUID_VIDEOREND
GUID_AUDIOBREAK

The internal formats of the events are described in that
documentation associated with the example, but nowhere
else. It makes you wonder if more of this stuff is
logged somewhere deep within.

After spending some time turning over all the stones
using the WMI tools, I don't see any clues as to what
the GUID values should be, or even if this functionality
actually exists anywhere beyond that one MSDN article.
(I am aware of the wxdebug stuff, which may do in a
pinch).

Since this WMI stuff is complicated, I see the potential
for a "wild goose chase", and wonder if anyone has gone
before me here.

The questions I have are thus:

Is there a way to get WMI/ETW to report useful
information about DirectShow activities and timings?

Does anyone know what the GUIDs are for the list above?

Whats with the MSDN article? Is it about something long
gone, never done, or maybe someday?

The March Hare [MVP]

unread,
Dec 28, 2006, 11:58:17 PM12/28/06
to
On 28 Dec 2006 18:07:13 -0800, Jamie Faye Fenton wrote:

> Is there a way to get WMI/ETW to report useful
> information about DirectShow activities and timings?

Never tried it. I hadn't heard of this article until you brought it up.



> Does anyone know what the GUIDs are for the list above?

Do you have the latest Windows SDK installed? [ I don't because my Vista
machine which had it is was resintalled with RTM and I haven't gotten
around to putting a dev env on it) ]

The file definitely exists in the Windows source (I see it in MSDN Code
Center Premium). I will need to check with the Windows guys to see if I
can paste the GUIDs here. I will report back when I hear something but the
guys responsible may be on holidays.

> Whats with the MSDN article? Is it about something long
> gone, never done, or maybe someday?

FWIW, the MSDN CCP header file is dated 1999.

--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution

The March Hare [MVP]

unread,
Dec 29, 2006, 3:50:46 PM12/29/06
to
On Thu, 28 Dec 2006 21:58:17 -0700, The March Hare [MVP] wrote:

> On 28 Dec 2006 18:07:13 -0800, Jamie Faye Fenton wrote:
>
>> Is there a way to get WMI/ETW to report useful
>> information about DirectShow activities and timings?
>
> Never tried it. I hadn't heard of this article until you brought it up.

According to my source at MS, the article is valid. I don't know what
you'll see by using WMI. I and others here, I suspect, would appreciate it
if you post back what you find out.

>> Does anyone know what the GUIDs are for the list above?
>
> Do you have the latest Windows SDK installed?

According to my source, the latest Vista SDK has perfstruct.h in the
baseclasses folder.

Here are the particular GUIDs you asked about:

DEFINE_GUID(GUID_DSHOW_CTL,
0x28cf047a, 0x2437, 0x4b24, 0xb6, 0x53, 0xb9, 0x44, 0x6a, 0x41, 0x9a,
0x69);

DEFINE_GUID(GUID_VIDEOREND,
0xd0da7ad6, 0xae80, 0x4de5, 0xaa, 0xfc, 0xc1, 0x26, 0x71, 0x1e, 0x75,
0x93);

DEFINE_GUID(GUID_AUDIOBREAK,
0x56d29065, 0xefbe, 0x42dc, 0x8c, 0x29, 0xe3, 0x25, 0xdc, 0x9c, 0x27,
0xd5);

DEFINE_GUID(GUID_STREAMTRACE,
0x3d7e7d93, 0x2fc8, 0x4a07, 0xa7, 0x19, 0xe0, 0x92, 0x2f, 0xf2, 0x89,
0x9e);

Jamie Faye Fenton

unread,
Jan 7, 2007, 2:02:19 AM1/7/07
to
An interim reply regarding WMI event tracing.

> According to my source, the latest Vista SDK has perfstruct.h in the
> baseclasses folder.

I was able to download the files from the Vista SDK and locate the
headers involved. I was also able to get the trace process to start
and stop, and for it to write the captured data to the disk. (On my
XP-SP2). I then became distracted by other issues and am now returning
to the trace/tuning side of things.

The March Hare [MVP] wrote:
> On Thu, 28 Dec 2006 21:58:17 -0700, The March Hare [MVP] wrote:

> ccording to my source at MS, the article is valid. I don't know what
> you'll see by using WMI. I and others here, I suspect, would appreciate it
> if you post back what you find out.

I will let everyone know how useful the data is. One of the event-types
reports timing data related to the stages of Filtergraph execution,
although it seems to only say "when" and not "how long". (I assume that
the start time of event N is the same as the end time of event N-1, but
won''t know until I try it out).

My current plan is to code up a source filter that generates an
animated GANTT chart, with bar widths proportional to the time a
particular phase of execution takes. Y would represent filtergraph
identity (with phases as color-codes, something like capture green,
render red, de-interlace yellow and so on). The graphic would be synced
to the tNow on the RHS and would trail backward. (I wish I could just
stick a picture in here from a videogame I did recently where this
format really helped:-) ).

Thanks again,

Jamie Fenton

The March Hare [MVP]

unread,
Jan 7, 2007, 10:54:55 AM1/7/07
to
On 6 Jan 2007 23:02:19 -0800, Jamie Faye Fenton wrote:


> I was able to download the files from the Vista SDK and locate the
> headers involved. I was also able to get the trace process to start
> and stop, and for it to write the captured data to the disk. (On my
> XP-SP2).

Great! BTW, did you find the headers in the baseclasses folder? I saw a
post from another MVP that said he didn't see them in his Vista SDK
install. Perhaps you have to install an optional component such as WMI to
see them?



> I will let everyone know how useful the data is. One of the event-types
> reports timing data related to the stages of Filtergraph execution,
> although it seems to only say "when" and not "how long". (I assume that
> the start time of event N is the same as the end time of event N-1, but
> won''t know until I try it out).

Thanks. I look forward to your follow up :)

Jamie Faye Fenton

unread,
Jan 15, 2007, 5:39:37 PM1/15/07
to
> Great! BTW, did you find the headers in the baseclasses folder? I saw a
> post from another MVP that said he didn't see them in his Vista SDK
> install. Perhaps you have to install an optional component such as WMI to
> see them?

I did install WMI before I installed the Vista SDK - but that should
not cause the headers
to appear after the fact, I would think.

The relevent headers, etc., appear in
<VISTA_SDK_DIR>\Samples\Multimedia\DirectShow\BaseClasses
(for me).

> > I will let everyone know how useful the data is. One of the event-types
> > reports timing data related to the stages of Filtergraph execution,
> > although it seems to only say "when" and not "how long". (I assume that
> > the start time of event N is the same as the end time of event N-1, but
> > won''t know until I try it out).

This is less of a problem than I thought - there is a lot of general
header information about the
involvements in each event, a standard hi-res timestamp, uniform
designations of who, what, etc.

The problem with the Microsoft example (for someone like me, who is
just getting started), is that
it illustrates the DirectShow specifics while really going into the WMI
generalities that add context.
In other words, you can get other info about IO, mem use, process
switching, etc., as well as the DS info.

I had one other problem, which is again a novice gotcha - I was getting
unresolved external symbols
for the GUIDs, even with the Microsoft official headers. Turns out you
need an include file:

#include <initguid.h>

which I put near the top of my example source file. (Mentioned in THM's
FAQ, BTW).

Since I am doing this first project in the dsj Java framework, I rigged
the example up to do JNI callbacks
into my Java-side, where I can mate it up with an existing execution
animator. I also have an existing grapher
that uses DHTML to plot Gannt charts vertically (time zero at the top
of the page).

I also have been wondering things like: "If I was to "roll my own"
GraphEdit, how would it be different?" Has this been attempted?

The March Hare [MVP]

unread,
Jan 15, 2007, 8:08:50 PM1/15/07
to
On 15 Jan 2007 14:39:37 -0800, Jamie Faye Fenton wrote:

> The relevent headers, etc., appear in
> <VISTA_SDK_DIR>\Samples\Multimedia\DirectShow\BaseClasses
> (for me).

Thanks. It turns out the other person that said he couldn't find them had a
beta of the Vista SDK installed. Installing the RTM version fixed the
missing headers problem.

> This is less of a problem than I thought - there is a lot of general
> header information about the
> involvements in each event, a standard hi-res timestamp, uniform
> designations of who, what, etc.

...

Thanks for the summary of your findings.

> I also have been wondering things like: "If I was to "roll my own"
> GraphEdit, how would it be different?" Has this been attempted?

Not that I am aware of. Vivek has contributed a Filter Graph Library to my
downloads site but it is not a GE replacement.

0 new messages