How to integrate TRACEPDB in build?

Hi everyone,
I am really wondering if there is any reasonable way to integrate the invocation of tracepdb as a post build step.
I tried adding the following line in SOURCES:

POST_BUILD_CMD=TracePDB -f $(OBJ_PATH)$O$(TARGETNAME).pdb -p $(OBJ_PATH)$(O)

Everything kind of works, meaning that the driver builds and all TMF files get generated, but the build utility reports warnings:
8 files compiled - 1 Warning
1 executable built - 6 Warnings

The results are the same regardless of whether I use the OSR DDKBUILD or HOLLISTECH DDKBUILD or the WDK build environment windows.
If I remove the POST_BUILD_CMD then the warnings go away.

It looks like these warnings originate from the tracepdb output messages which look like this:
tracepdb : warning info BNP0000: WPPFMT generating xxx.tmf

The funny thing however is that if I directly execute tracepdb on the command line I get messages that look like this:
tracepdb : info BNP0000: WPPFMT generating xxx.tmf

Now it’s just ‘info’, not ‘warning info’.
So I can’t help wondering where did “warning” come from in the first place.
Does anyone know a valid way to add tracepdb as a post build step? I tried appending “>nul” to the post build command and it kind of remedies the situation, but it makes me feel a little uncomfortable :slight_smile: There must be a better way…

Warm Regards
Dimitris

Are you sure you do not get TMFs by default. From makefile.new

!ifdef RUN_WPP
RUN_WPP=$(WPP_MAKEFILE_FLAGS) -cfgdir:$(WPP_CONFIG_PATH)$(WPP_REVISION) -odir:$(OBJ_PATH)$O $(RUN_WPP)

execute wpp now

! if [-$(WPP_NAME) $(RUN_WPP)]
! endif

! if exist(obj_tracewpp.mac)
! include obj_tracewpp.mac
WPP_TARGETS=$(WPP_EXTRA_TARGETS)
! endif
BINPLACE_FLAGS = $(BINPLACE_FLAGS) /:TMF
C_DEFINES=$(C_DEFINES) /DRUN_WPP
!else
WPP_TARGETS=
!endif

Note the use of the /:TMF flag

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@staikos.name
Sent: Sunday, September 20, 2009 6:57 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to integrate TRACEPDB in build?

Hi everyone,
I am really wondering if there is any reasonable way to integrate the invocation of tracepdb as a post build step.
I tried adding the following line in SOURCES:

POST_BUILD_CMD=TracePDB -f $(OBJ_PATH)$O$(TARGETNAME).pdb -p $(OBJ_PATH)$(O)

Everything kind of works, meaning that the driver builds and all TMF files get generated, but the build utility reports warnings:
8 files compiled - 1 Warning
1 executable built - 6 Warnings

The results are the same regardless of whether I use the OSR DDKBUILD or HOLLISTECH DDKBUILD or the WDK build environment windows.
If I remove the POST_BUILD_CMD then the warnings go away.

It looks like these warnings originate from the tracepdb output messages which look like this:
tracepdb : warning info BNP0000: WPPFMT generating xxx.tmf

The funny thing however is that if I directly execute tracepdb on the command line I get messages that look like this:
tracepdb : info BNP0000: WPPFMT generating xxx.tmf

Now it’s just ‘info’, not ‘warning info’.
So I can’t help wondering where did “warning” come from in the first place.
Does anyone know a valid way to add tracepdb as a post build step? I tried appending “>nul” to the post build command and it kind of remedies the situation, but it makes me feel a little uncomfortable :slight_smile: There must be a better way…

Warm Regards
Dimitris


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

No, I don’t get TMFs by default, unless something really creepy is going on.
I use Win7 WDK on Vista x64. My makefile.new is the same as you describe.
Just to be on the safe side I tried building WDK\7600.16385.0\src\usb\osrusbfx2\kmdf\sys\final using Win7 x86 Checked and Free Build environment windows and then also Windows Vista and Server 2008 Checked build environment.
I used command line: build -bcwz
I monitored the builds with Process Monitor of SysInternals suite and there is no indication of a call to tracepdb. I searched the WDK and development subtrees for *.tmf and only find the TMF files included with the WDK (things like wudf01009.tmf, wdtf.tmf, etc).
A strange thing I noticed is the following. In the build environment windows the following environment variable seems to come with an awkward default value.
TRACE_FORMAT_SEARCH_PATH=\winseqfe\release\Windows6.0\lh_sp2rtm\6002.18005.090410-1830\amd64fre\symbols.pri\TraceFormat
In the WDK docs I couldn’t see how this variable gets involved with the operation of tracepdb. Still I changed its value to an existing path, but it made no difference to the build process; no TMFs get generated.

Moreover the funny thing is that in all environment windows the build reports 1 warning, which is also nowhere to be found. It does not appear on screen (I use the -w parameter to build.exe) and it does not appear in the build log file. The only thing that the log file contains related to a warning is a line containing “1> /FIC:\DEV\WDK\7600.16385.0\inc\api\warning.h”. And on screen I sometimes get: “Invalidating OACR warning log for ‘WDKSamples:x86chk’”.
Moreover if I add MSC_WARNING_LEVEL=/W3 /WX in my SOURCES then I still get one warning but no error, so something is strange here.
I have seen in the past a #pragma message where the text contained the word ‘warning’ or ‘error’ trigger a warning/error in the compilation results. Is this something similar?

Warm Regards,
Dimitris

We don’t have any macro or anything in the WDK in order to generate TMF files. For Win7, you’d need to add this rule in makefile.inc. for building TMF files:

$(OBJ_PATH)$O$(TARGETNAME).tmf: $(OBJ_PATH)$O$(TARGETNAME).pdb
del /Q $(OBJ_PATH)$O*.tmf >nul 2>&1
tracepdb.exe -f $(OBJ_PATH)$O$(TARGETNAME).pdb -p $(OBJ_PATH)$O >nul 2>&1
copy $(OBJ_PATH)$O*.tmf $(OBJ_PATH)$O$(TARGETNAME).tmf

Thanks,
Sandeep

Would you have to add NTTARGETFILE to SOURCES as well?

mm

Yes.But you can use the NTTARGETFILE0, NTTARGETFILE1, and NTTARGETFILE2 macros which identify custom build steps for each of the three build passes.
You can refer to Page 17 (Section - Custom build steps ) of this white paper for detailed explanation.
http://www.microsoft.com/whdc/DevTools/WDK/WDK_Build.mspx