Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

895 lines
28 KiB

  1. @echo off
  2. rem Name : Runtrace.cmd
  3. rem Author: Shiwei Sun
  4. rem Date : January 29th 1999
  5. rem Revisied by: Sabina Sutkovic
  6. rem Name of revision: Runtracecall.cmd
  7. rem Date : 8-31-00
  8. rem
  9. rem CMD script file to test event tracing. All the variations are very trivial
  10. rem and test for basic functionality.
  11. rem
  12. if "%1"=="?" goto help
  13. if "%1"=="/?" goto help
  14. if "%1"=="-?" goto help
  15. if "%1"=="/h" goto help
  16. if "%1"=="-h" goto help
  17. if "%1"=="help" goto help
  18. del *.log *.csv *.txt
  19. if exist SuccessTests.log del SuccessTests.log
  20. if exist FailedTests.log del FailedTests.log
  21. if exist ST.txt del ST.txt
  22. if exist FT.txt del FT.txt
  23. if exist startvar.txt del startvar.txt
  24. @set Guid1=d58c126f-b309-11d1-969e-0000f875a5bc
  25. @set Guid2=dcb8c570-2c70-11d2-90ba-00805f8a4d63
  26. @set Guid3=f5b6d380-2c70-11d2-90ba-00805f8a4d63
  27. @set Guid4=f5b6d381-2c70-11d1-90ba-00805f8a4d63
  28. @set Guid5=f5b6d382-2c70-11d1-90ba-00805f8a4d63
  29. @set Guid6=f5b6d383-2c70-11d1-90ba-00805f8a4d63
  30. set flag=1
  31. rem TEST 1 KERNEL LOGGER START/STOP
  32. tracelog.exe -start -f krnl.log>rundrt.log
  33. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  34. set flag="KERNEL LOGGER START"
  35. call :SUB1 %flag% %test%
  36. sleep 5
  37. tracelog.exe -stop>rundrt.log
  38. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  39. set flag="KERNEL LOGGER STOP"
  40. rem TEST2
  41. call :SUB1 %flag% %test%
  42. tracerpt -df -o krnl.csv -summary krnl.txt krnl.log -y>dump.txt
  43. set flag="KERNEL LOGGER DUMP"
  44. set /a TOTAL=0
  45. for /F "tokens=2" %%A in ('findstr -i Thread krnl.txt') do set /a TOTAL=TOTAL+%%A
  46. if %TOTAL% == 0 (set test=1L) else (set test=0L)
  47. call :SUB1 %flag% %test%
  48. :Test2
  49. rem TEST 2 UMProvider, Kernel Logger Start/Stop
  50. start "UMProvider, Kernel Logger Start/Stop" tracedp.exe 150 -sleep 5 -guid #%Guid1% >startvar.txt
  51. sleep 1
  52. tracelog.exe -start dp1 -guid #%Guid1% -f dp1.log >rundrt.log
  53. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  54. set flag="Logger DP1 start and enable"
  55. call :SUB1 %flag% %test%
  56. sleep 5
  57. tracelog -q dp1 -guid #%Guid1% >rundrt.log
  58. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  59. set flag="Trace Query DP1"
  60. call :SUB1 %flag% %test%
  61. tracelog -flush dp1 -guid #%Guid1% >rundrt.log
  62. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  63. set flag="Flush Trace DP1"
  64. call :SUB1 %flag% %test%
  65. tracelog -update dp1 -max 30 >rundrt.log
  66. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  67. set flag="Update Trace DP1"
  68. call :SUB1 %flag% %test%
  69. tracelog -disable dp1 -guid #%Guid1% >rundrt.log
  70. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  71. set flag="DISABLE TRACE DP1"
  72. call :SUB1 %flag% %test%
  73. tracelog -stop dp1 >rundrt.log
  74. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  75. set flag="STOP TRACE DP1"
  76. call :SUB1 %flag% %test%
  77. sleep 5
  78. tracerpt dp1.log -o dp1.csv -summary dp1.txt -y -df >dump.txt
  79. set /a TOTAL=0
  80. for /F "tokens=2" %%A in ('findstr -i TraceDp dp1.txt') do set /a TOTAL=TOTAL+%%A
  81. set flag="TRACE dump DP1.log"
  82. rem
  83. rem This Test really should test for 150 events after making
  84. rem sure we make the script fire all 150 events before shutting
  85. rem logger down.
  86. rem
  87. if %TOTAL% == 0 (set test=1L) else (set test=0L)
  88. call :SUB1 %flag% %test%
  89. rem TEST 3 UMProvider, Private Logger Start/Stop
  90. :TEST3
  91. start "UMProvider, Private Logger Start/Stop" tracedp.exe 150 -guid #%Guid1% -sleep 15>startvar.txt
  92. sleep 5
  93. tlist|(findstr -i UMProvider)>pid.txt
  94. for /F "tokens=1" %%I in (pid.txt) do set pid=%%I
  95. echo %pid%
  96. tracelog -start Priv1 -um -guid #%Guid1% -f priv1.log >rundrt.log
  97. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  98. set flag="Private Logger Priv1 start and enable"
  99. call :SUB1 %flag% %test%
  100. sleep 1
  101. tracelog -stop Priv1 -um -guid #%Guid1% >rundrt.log
  102. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  103. set flag="STOP TRACE PRIVATE LOGGER1"
  104. call :SUB1 %flag% %test%
  105. sleep 5
  106. tracerpt priv1.log_%pid% -o priv.csv -summary priv.txt -df -y>dump.txt
  107. set /a TOTAL=0
  108. for /F "tokens=2" %%A in ('findstr -i TraceDp priv.txt') do set /a TOTAL=TOTAL+%%A
  109. set flag="TRACE dump priv1.log"
  110. if not %TOTAL% == 0 (set test=0L) else (set test=1L)
  111. call :SUB1 %flag% %test%
  112. rem TEST 4 KERNEL LOGGER REALTIME START/STOP
  113. tracelog.exe -start -rt -pf -fio -ft 1 -b 1>rundrt.log
  114. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  115. set flag="KERNEL LOGGER REALTIME START"
  116. call :SUB1 %flag% %test%
  117. sleep 1
  118. start "KERNEL LOGGER REALTIME DUMP" tracerpt -df -rt "NT Kernel Logger" -o rt.csv -summary rt.txt -y >dump.txt
  119. sleep 10
  120. tracelog.exe -stop -rt>rundrt.log
  121. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  122. set flag="KERNEL LOGGER REALTIME STOP"
  123. call :SUB1 %flag% %test%
  124. sleep 15
  125. set /a TOTAL=0
  126. for /F "tokens=2" %%A in ('findstr -i PageFault rt.txt') do set /a TOTAL=TOTAL+%%A
  127. set flag="TRACE dump RealTime"
  128. if not %TOTAL% == 0 (set test=0L) else (set test=1L)
  129. call :SUB1 %flag% %test%
  130. @echo Starting Realtime Kernel Logger with large Buffers
  131. tracelog.exe -start -rt -pf -fio -ft 1 -b 512>rundrt.log
  132. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  133. set flag ="KERNEL RT LARGE BUFFERS START"
  134. call :SUB1 %flag% %test%
  135. sleep 5
  136. tracelog.exe -stop -rt>rundrt.log
  137. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  138. set flag="KERNEL RT LARGE BUFFERS STOP"
  139. call :SUB1 %flag% %test%
  140. rem UMProvider logging in RealTime
  141. start "UMProvider 1 Logging in RealTime" tracedp.exe 25000 -guid #b39d2858-2c79-11d2-90ba-00805f8a4d63
  142. start "UMProvider 2 Logging in RealTime" tracedp.exe 1000 -guid #d0ca64d8-2c79-11d2-90ba-00805f8a4d63
  143. tracelog.exe -start dp5 -guid #b39d2858-2c79-11d2-90ba-00805f8a4d63 -rt -b 20 -min 50 -max 100>rundrt.log
  144. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  145. set flag="UMProvider 1 logging in RT Start"
  146. call :SUB1 %flag% %test%
  147. tracelog.exe -start dp6 -guid #d0ca64d8-2c79-11d2-90ba-00805f8a4d63 -rt -b 20 -min 50 -max 100>rundrt.log
  148. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  149. set flag="UMProvider 2 Logging in RT START"
  150. call :SUB1 %flag% %test%
  151. sleep 2
  152. start "Consumer for UMProvider5 in RT" tracerpt -df -rt dp5 -o dp5rt.csv -summary dp5rt.txt -y >dump.txt
  153. sleep 5
  154. tracelog.exe -stop dp5>rundrt.log
  155. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  156. set flag="RealTime Logger 1 Stop"
  157. call :SUB1 %flag% %test%
  158. sleep 5
  159. tracelog.exe -stop dp6>rundrt.log
  160. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  161. set flag="RealTime Logger 2 STOP"
  162. call :SUB1 %flag% %test%
  163. sleep 10
  164. set /a TOTAL=0
  165. for /F "tokens=2" %%A in ('findstr -i TraceDp dp5rt.txt') do set /a TOTAL=TOTAL+%%A
  166. set flag="RT Dump from UMProvider5"
  167. if not %TOTAL% == 0 (set test=0L) else (set test=1L)
  168. call :SUB1 %flag% %test%
  169. @echo Logfile Type Variations
  170. rem KERNEL LOGGER CIRCULAR
  171. tracelog.exe -start -f krnlcirc.log -cir 1 -pf -cm -fio -img >rundrt.log
  172. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  173. set flag="KERNEL LOGGER CIRCULAR START"
  174. call :SUB1 %flag% %test%
  175. sleep 5
  176. rem To generate events for this logger make a few tracelog -q
  177. tracelog.exe -q>rundrt.log
  178. dir %windir% >rundrt.log
  179. tracerpt -df krnl.log -o krnl.csv -summary krnl.txt -y>dump.txt
  180. sleep 5
  181. tracelog.exe -stop >rundrt.log
  182. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  183. set flag="KERNEL LOGGER CIRCULAR STOP"
  184. rem TEST2
  185. call :SUB1 %flag% %test%
  186. rem Check to see that the file size if 1 MB
  187. tracerpt -df -o krnlcirc.csv krnlcirc.log -summary krnlcirc.txt -y>dump.txt
  188. set flag="KERNEL LOGGER CIRCULAR DUMP"
  189. set /a TOTAL=0
  190. for /F "tokens=2" %%A in ('findstr -i PageFault krnlcirc.txt') do set /a TOTAL=TOTAL+%%A
  191. if %TOTAL% == 0 (set test=1L) else (set test=0L)
  192. call :SUB1 %flag% %test%
  193. rem Kernel Circular 20MB Large BufferSize with FlushTimer 1
  194. tracelog.exe -start -f cirft.log -cir 20 -ft 1 -b 128 -fio -pf>rundrt.log
  195. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  196. set flag="CIRC FT Large Buffer Logger Start"
  197. rem TEST50 Circular 20 MB With FlusshTimer with Large Buffer Size
  198. call :SUB1 %flag% %test%
  199. sleep 50
  200. tracelog.exe -stop>rundrt.log
  201. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  202. set flag="CIRC FT Logger Stop"
  203. rem TEST51
  204. call :SUB1 %flag% %test%
  205. tracerpt -df -o cirft.csv cirft.log -summary cirft.txt -y>dump.txt
  206. set flag="KERNEL LOGGER CIRCULAR DUMP"
  207. set /a TOTAL=0
  208. for /F "tokens=2" %%A in ('findstr -i PageFault cirft.txt') do set /a TOTAL=TOTAL+%%A
  209. if %TOTAL% == 0 (set test=1L) else (set test=0L)
  210. call :SUB1 %flag% %test%
  211. rem UM PROVIDER CIRCULAR
  212. start "UMProvider, Kernel Logger Start/Stop" tracedp.exe -thread 10 -guid #%Guid1% >startvar.txt
  213. sleep 1
  214. tracelog.exe -start UMPcirc -b 4 -guid #%Guid1% -f UmpCirc.log >rundrt.log
  215. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  216. set flag="Logger UMPcirc start"
  217. call :SUB1 %flag% %test%
  218. sleep 20
  219. rem
  220. rem This time may not be enough. The ideal
  221. rem way is to calculate the number of events needed to get the
  222. rem desired effect and wait for tracedp to go away.
  223. rem
  224. tracelog -stop UMPcirc >rundrt.log
  225. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  226. set flag="Logger UMPCic STOP"
  227. rem TEST2
  228. call :SUB1 %flag% %test%
  229. rem Check to see if the FileSize is 1 MB
  230. tracerpt -df -o UmpCirc.csv UmpCirc.log -summary UmpCirc.txt -y>dump.txt
  231. set flag="UM Provider CIRCULAR Log DUMP"
  232. set /a TOTAL=0
  233. for /F "tokens=2" %%A in ('findstr -i TraceDp UmpCirc.txt') do set /a TOTAL=TOTAL+%%A
  234. if %TOTAL% == 0 (set test=1L) else (set test=0L)
  235. call :SUB1 %flag% %test%
  236. rem NEWFILE Test
  237. start "UMProvider, NewFile, Start/Stop" tracedp.exe -thread 10 -guid #%Guid1% >startvar.txt
  238. sleep 1
  239. tracelog.exe -start UMPnewfile -b 4 -guid #%Guid1% -newfile 1 -f Umpnewfile%%d.log >rundrt.log
  240. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  241. set flag="Logger UMPnewfile start"
  242. call :SUB1 %flag% %test%
  243. sleep 20
  244. rem
  245. rem This time may not be enough. The ideal
  246. rem way is to calculate the number of events needed to get the
  247. rem desired effect and wait for tracedp to go away.
  248. rem
  249. tracelog -stop UMPnewfile > rundrt.log
  250. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  251. set flag="Logger UMPnewfile STOP"
  252. rem TEST2
  253. call :SUB1 %flag% %test%
  254. rem Check to see if the FileSize is 1 MB
  255. tracerpt -df -o Umpnf1.csv Umpnewfile1.log -summary Umpnf1.txt -y>dump.txt
  256. set flag="UM Provider NEWFILE 1 Log DUMP"
  257. set /a TOTAL=0
  258. for /F "tokens=2" %%A in ('findstr -i TraceDp Umpnf1.txt') do set /a TOTAL=TOTAL+%%A
  259. if %TOTAL% == 0 (set test=1L) else (set test=0L)
  260. call :SUB1 %flag% %test%
  261. rem We need to dump the second File and Make sure it works.
  262. rem Check to see if the FileSize is 1 MB
  263. tracerpt -df -o Umpnf2.csv Umpnewfile2.log -summary Umpnf2.txt -y>dump.txt
  264. set flag="UM Provider NEWFILE 2 Log DUMP"
  265. set /a TOTAL=0
  266. for /F "tokens=2" %%A in ('findstr -i TraceDp Umpnf2.txt') do set /a TOTAL=TOTAL+%%A
  267. if %TOTAL% == 0 (set test=1L) else (set test=0L)
  268. call :SUB1 %flag% %test%
  269. rem KERNEL APPEND
  270. tracelog -start -append -f krnl.log >startvar.txt
  271. sleep 1
  272. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  273. set flag="Kernel Logger APPEND start"
  274. call :SUB1 %flag% %test%
  275. sleep 5
  276. tracelog -stop >rundrt.log
  277. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  278. set flag="Kernel Logger Append STOP"
  279. call :SUB1 %flag% %test%
  280. sleep 1
  281. tracerpt -df -o append.csv krnl.log -summary append.txt -y>dump.txt
  282. set flag="KERNEL APPEND DUMP"
  283. set /a TOTAL=0
  284. for /F "tokens=2" %%A in ('findstr -i CPU append.txt') do set /a TOTAL=TOTAL+%%A
  285. if %TOTAL% == 2 (set test=0L) else (set test=1L)
  286. call :SUB1 %flag% %test%
  287. rem UMPROVIDER APPEND
  288. start "UMProvider, Kernel Logger Start/Stop" tracedp.exe 150 -sleep 5 -guid #%Guid1% >startvar.txt
  289. sleep 1
  290. tracelog.exe -start dpappend -guid #%Guid1% -append -f dp1.log >rundrt.log
  291. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  292. set flag="Logger dpappend start"
  293. call :SUB1 %flag% %test%
  294. sleep 1
  295. tracelog -stop dpappend >rundrt.log
  296. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  297. set flag="STOP TRACE DPAPPEND"
  298. call :SUB1 %flag% %test%
  299. sleep 5
  300. tracerpt -df -o dp1.csv dp1.log -summary dp1.txt -y>dump.txt
  301. set /a TOTAL=0
  302. for /F "tokens=2" %%A in ('findstr -i TraceDp dp1.txt') do set /a TOTAL=TOTAL+%%A
  303. set flag="TRACE dump DP1.log"
  304. rem
  305. rem This Test really should test for 300 events
  306. rem
  307. if %TOTAL% == 0 (set test=1L) else (set test=0L)
  308. call :SUB1 %flag% %test%
  309. rem MOFPTR test
  310. start "UMProvider, Kernel Logger Start/Stop" tracedp.exe 150 -sleep 5 -guid #%Guid1% -UseMofPtrFlag >startvar.txt
  311. sleep 1
  312. tracelog.exe -start mofptr -guid #%Guid1% -f mofptr.log >rundrt.log
  313. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  314. set flag="Logger mofptr start"
  315. call :SUB1 %flag% %test%
  316. sleep 5
  317. tracelog -stop mofptr >rundrt.log
  318. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  319. set flag="STOP TRACE MofPtr"
  320. call :SUB1 %flag% %test%
  321. sleep 5
  322. tracerpt -df -o mofptr.csv mofptr.log -summary mofptr.txt -y>dump.txt
  323. set /a TOTAL=0
  324. for /F "tokens=2" %%A in ('findstr -i TraceDp mofptr.txt') do set /a TOTAL=TOTAL+%%A
  325. set flag="TRACE dump mofptr.log"
  326. rem
  327. rem Check to see if the MOFPTR fields are there.
  328. rem
  329. if %TOTAL% == 0 (set test=1L) else (set test=0L)
  330. call :SUB1 %flag% %test%
  331. rem Insert test for PERSIST CIRCULAR
  332. rem Insert test for Instance Header
  333. rem Insert test for TIMED Header
  334. rem EnumGuid API; Enable Level Flags test
  335. start "UMProvider, Enable Level Flags" tracedp.exe 500 -sleep 5 -guid #%Guid1% >startvar.txt
  336. sleep 1
  337. tracelog.exe -start enabFlag -guid #%Guid1% -level 3 -f enabFlag.log >rundrt.log
  338. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  339. set flag="Logger EnabFlag start"
  340. call :SUB1 %flag% %test%
  341. tracelog -enumguid >rundrt1.log
  342. set /a TOTAL=0
  343. for /F "tokens=4" %%A in ('findstr -i d58c126f-b309-11d1-969e-0000f875a5bc rundrt1.log') do set /a TOTAL=TOTAL+%%A
  344. set flag="EnumGuid EnableLevel"
  345. rem
  346. if %TOTAL% == 0 (set test=1L) else (set test=0L)
  347. call :SUB1 %flag% %test%
  348. sleep 5
  349. call :WaitForProcessExit tracedp.exe
  350. tracelog -stop EnabFlag >rundrt.log
  351. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  352. set flag="STOP Trace EnabFlag"
  353. call :SUB1 %flag% %test%
  354. rem Test for GlobalLogger
  355. rem First Test to see if the Global Logger is Running
  356. tracelog -q GlobalLogger > rundrt.log
  357. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  358. if %test%==0L (
  359. start "GlobalLogger Provider" tracedp.exe -thread 10 -guid #%Guid1% >startvar.txt
  360. sleep 5
  361. tracelog -enable GlobalLogger -guid #%Guid1% >rundrt.log
  362. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  363. set flag="Enable Global Logger"
  364. call :SUB1 %flag% %test%
  365. sleep 20
  366. tracelog -disable GlobalLogger -guid #%Guid1% >rundrt.log
  367. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  368. set flag="Disable GlobalLogger"
  369. call :SUB1 %flag% %test%
  370. ) else (
  371. echo !
  372. echo ! Global Logger is NOT RUNNING!
  373. echo !
  374. )
  375. @echo ===================================================
  376. @echo provider variations - 3 intermingled start and stop
  377. @echo ===================================================
  378. start "Variation 2 - provider 2" tracedp.exe 10000 -guid #dcb8c570-2c70-11d2-90ba-00805f8a4d63 -UseEventInstanceHeader -UseMofPtrFlag>startvar.txt
  379. tracelog.exe -start dp2 -guid #%Guid2% -f dp2.log -ft 2 -b 1>rundrt.log
  380. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  381. set flag="Dp2 Start"
  382. rem TEST7
  383. call :SUB1 %flag% %test%
  384. sleep 1
  385. start "Variation 2 - provider 4" tracedp.exe 7000 -guid #054b1ae0-2c71-11d2-90ba-00805f8a4d63 -UseEventTraceHeader -UseMofPtrFlag
  386. sleep 20
  387. tracelog.exe -start dp4 -guid #054b1ae0-2c71-11d2-90ba-00805f8a4d63 -f dp4.log -b 128 -max 100>rundrt.log
  388. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  389. set flag="dp4 start"
  390. rem TEST8
  391. call :SUB1 %flag% %test%
  392. tracelog.exe -flush dp2 -guid #%Guid2% -rt>rundrt.log
  393. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  394. set flag="dp2 flush"
  395. rem TEST9
  396. call :SUB1 %flag% %test%
  397. tracelog.exe -update dp2 -guid #%Guid2% -rt>rundrt.log
  398. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  399. set flag="update dp2"
  400. rem TEST10
  401. call :SUB1 %flag% %test%
  402. sleep 20
  403. tracelog.exe -disable dp4 -guid #054b1ae0-2c71-11d2-90ba-00805f8a4d63 >rundrt.log
  404. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  405. set flag="disable dp4"
  406. rem TEST11
  407. call :SUB1 %flag% %test%
  408. sleep 2
  409. tracelog.exe -stop dp2 -guid #%Guid2% >rundrt.log
  410. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  411. set flag="Stop dp2"
  412. rem TEST12
  413. call :SUB1 %flag% %test%
  414. sleep 20
  415. tracelog.exe -disable dp4 -guid #054b1ae0-2c71-11d2-90ba-00805f8a4d63 >rundrt.log
  416. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  417. set flag="disable dp4"
  418. rem TEST13
  419. call :SUB1 %flag% %test%
  420. sleep 2
  421. tracelog.exe -stop dp4 -guid #054b1ae0-2c71-11d2-90ba-00805f8a4d63 >rundrt.log
  422. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  423. set flag="Stop dp4"
  424. rem TEST14
  425. call :SUB1 %flag% %test%
  426. rem
  427. rem LOGGER PROPERTIES VARIATIONS
  428. rem
  429. @echo Kernel Logger with Flush Timer and Aging Decay with buffer variation
  430. tracelog.exe -start -f krnl11.log -fio -pf -b 1 -min 2 -max 1000 -ft 1 -age 1>rundrt.log
  431. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  432. set flag="Krnl Start FT 1 Age 1 max 1000"
  433. rem TEST55
  434. call :SUB1 %flag% %test%
  435. sleep 100
  436. tracelog.exe -q>rundrt.log
  437. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  438. set flag="tracelog -q"
  439. rem TEST57
  440. call :SUB1 %flag% %test%
  441. tracelog.exe -stop>rundrt.log
  442. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  443. set flag="Krnl Stop"
  444. rem TEST58
  445. call :SUB1 %flag% %test%
  446. @set Guid7=b39d2858-2c79-11d2-90ba-00805f8a4d63
  447. @set Guid8=d0ca64d8-2c79-11d2-90ba-00805f8a4d63
  448. start "Variation 3 - provider 5" tracedp.exe 25000 -guid #%Guid7%
  449. start "Variation 3 - provider 6" tracedp.exe 1000 -guid #%Guid8%
  450. tracelog.exe -start dp5 -guid #%Guid7% -f dp5.log -b 20 -min 50 -max 100>rundrt.log
  451. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  452. set flag="DP5 start"
  453. rem TEST15
  454. call :SUB1 %flag% %test%
  455. sleep 1
  456. tracelog.exe -start dp6 -guid #%Guid8% -f dp6.log -b 1024 -min 1024 -max 8192>rundrt.log
  457. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  458. set flag="Start dp6"
  459. rem TEST16
  460. call :SUB1 %flag% %test%
  461. sleep 20
  462. tracelog.exe -disable dp5 -guid #%Guid7%>rundrt.log
  463. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  464. set flag="disable dp5"
  465. rem TEST17
  466. call :SUB1 %flag% %test%
  467. sleep 2
  468. tracelog.exe -stop dp5 -guid #%Guid7%>rundrt.log
  469. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  470. set flag="stop dp5"
  471. rem TEST18
  472. call :SUB1 %flag% %test%
  473. tracelog.exe -q dp6 -guid #%Guid8% -f dp6.log>rundrt.log
  474. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  475. set flag="query dp6"
  476. rem TEST19
  477. call :SUB1 %flag% %test%
  478. sleep 10
  479. tracelog.exe -stop dp6 -guid #%Guid8%>rundrt.log
  480. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  481. set flag="Stop dp6"
  482. rem TEST20
  483. call :SUB1 %flag% %test%
  484. rem
  485. rem RealTime Logger withh Large Buffers
  486. rem
  487. @echo Starting Realtime Kernel Logger with large Buffers
  488. tracelog.exe -start -rt -pf -fio -ft 1 -b 512>rundrt.log
  489. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  490. set flag="RT with 512KB buffersize"
  491. rem TEST40
  492. call :SUB1 %flag% %test%
  493. sleep 5
  494. tracelog.exe -stop -rt>rundrt.log
  495. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  496. set flag="RT largebuffersize Stop"
  497. rem TEST41
  498. call :SUB1 %flag% %test%
  499. start "Variation 6 - provider 5" tracedp.exe 25000 -guid #b39d2858-2c79-11d2-90ba-00805f8a4d63
  500. start "Variation 6 - provider 6" tracedp.exe 1000 -guid #d0ca64d8-2c79-11d2-90ba-00805f8a4d63
  501. tracelog.exe -start dp5 -guid #b39d2858-2c79-11d2-90ba-00805f8a4d63 -rt -b 20 -min 50 -max 100>rundrt.log
  502. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  503. set flag="Start dp5"
  504. rem TEST42
  505. call :SUB1 %flag% %test%
  506. tracelog.exe -start dp6 -guid #d0ca64d8-2c79-11d2-90ba-00805f8a4d63 -rt -b 20 -min 50 -max 100>rundrt.log
  507. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  508. set flag="Start dp6"
  509. rem TEST43
  510. call :SUB1 %flag% %test%
  511. sleep 2
  512. tracelog.exe -stop dp5>rundrt.log
  513. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  514. set flag="stop dp5"
  515. rem TEST44
  516. call :SUB1 %flag% %test%
  517. sleep 10
  518. tracelog.exe -stop dp6>rundrt.log
  519. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  520. set flag="Stop dp6"
  521. rem TEST45
  522. call :SUB1 %flag% %test%
  523. rem
  524. rem Additional User Mode Logger Variations
  525. rem
  526. echo ==================================================================
  527. echo Variation 2 - three providers - intermingled start and stop tested
  528. echo ==================================================================
  529. start "Variation 2 - provider 2" tracedp.exe 50000 -guid #dcb8c570-2c70-11d2-90ba-00805f8a4d63 -sleep 1 >dump1.txt
  530. sleep 1
  531. start "Variation 2 - provider 3" tracedp.exe 50000 -guid #f5b6d380-2c70-11d2-90ba-00805f8a4d63 -sleep 1 >dump2.txt
  532. tracelog.exe -start du2 -guid #dcb8c570-2c70-11d2-90ba-00805f8a4d63 -um -ft 2 -f du2.log >rundrt.log
  533. sleep 1
  534. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  535. rem Test4
  536. set flag="Du2 Start"
  537. call :SUB1 %flag% %test%
  538. sleep 1
  539. start "Variation 2 - provider 4" tracedp.exe 50000 -guid #054b1ae0-2c71-11d2-90ba-00805f8a4d63 -sleep 1
  540. sleep 1
  541. tracelog.exe -start du3 -guid #f5b6d380-2c70-11d2-90ba-00805f8a4d63 -um -f du3.log >rundrt.log
  542. sleep 1
  543. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  544. rem Test5
  545. set flag="du3 Start"
  546. call :SUB1 %flag% %test%
  547. sleep 3
  548. echo List all logger sessions, should contain du2 and du3
  549. tracelog.exe -l >rundrt.log
  550. sleep 1
  551. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  552. set flag="QueryAll Um"
  553. rem tracelog.exe does not print the Operation Status for tracelog -l
  554. rem Once that is fixed, take out the following line.
  555. set test=0L
  556. call :SUB1 %flag% %test%
  557. sleep 3
  558. rem Starting Logger du4 for provider 4
  559. tracelog.exe -start du4 -guid #054b1ae0-2c71-11d2-90ba-00805f8a4d63 -um -cir 1 -f du4.log>rundrt.log
  560. sleep 1
  561. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  562. set flag="Start du4 um"
  563. call :SUB1 %flag% %test%
  564. sleep 1
  565. echo List all logger sessions, should contain du2, du3, and du4
  566. tracelog.exe -l>rundrt.log
  567. sleep 1
  568. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  569. set flag="List All"
  570. set test=0L
  571. call :SUB1 %flag% %test%
  572. sleep 3
  573. tracelog.exe -disable du2 -guid #dcb8c570-2c70-11d2-90ba-00805f8a4d63 -um >rundrt.log
  574. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  575. set flag="Disable UM du2"
  576. call :SUB1 %flag% %test%
  577. sleep 3
  578. tracelog.exe -l>rundrt.log
  579. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test10=%%I
  580. set flag="QueryAll"
  581. set test=0L
  582. call :SUB1 %flag% %test%
  583. sleep 3
  584. tracelog.exe -disable du4 -guid #054b1ae0-2c71-11d2-90ba-00805f8a4d63 -um>rundrt.log
  585. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  586. set flag="Stop du4"
  587. call :SUB1 %flag% %test%
  588. sleep 1
  589. tracelog.exe -disable du3 -guid #f5b6d380-2c70-11d2-90ba-00805f8a4d63 -um>rundrt.log
  590. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  591. rem Test12
  592. set flag="Stop du3"
  593. call :SUB1 %flag% %test%
  594. :VARIATION3
  595. echo ====================================================
  596. echo Variation 3 - tests UM circular buffer modifications
  597. echo ====================================================
  598. start "Variation 3 - provider 5" tracedp.exe 100000 -guid #68799948-2c7f-11d2-90bb-00805f8a4d63 -thread 10 >dump.txt
  599. sleep 1
  600. tracelog.exe -start du5 -guid #68799948-2c7f-11d2-90bb-00805f8a4d63 -um -cir 1 -f du5.log>rundrt.log
  601. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  602. rem Test13
  603. set flag="UM LOgger CIRCULAR Start"
  604. call :SUB1 %flag% %test%
  605. sleep 5
  606. echo Querying logger du5...
  607. tracelog.exe -q du5 -guid #68799948-2c7f-11d2-90bb-00805f8a4d63 -um -cir 1 -f du5.log>rundrrt.log
  608. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  609. rem Test14
  610. set flag="UM Log Query"
  611. call :SUB1 %flag% %test%
  612. sleep 10
  613. tracelog.exe -disable du5 -guid #68799948-2c7f-11d2-90bb-00805f8a4d63 -um -cir 1 -f du5.log>rundrt.log
  614. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  615. rem Test15
  616. set flag="UmLog Stop"
  617. call :SUB1 %flag% %test%
  618. @echo ========================================================
  619. @echo consumer Variations: processes logfile of 1000 events.
  620. @echo ========================================================
  621. start "Variation 1 - provider 1" tracedp.exe 1000 -guid #d58c126f-b309-11d1-969e-0000f875a5bc >dump.txt
  622. sleep 1
  623. tracelog.exe -start dc1 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -f dc10.log >rundrt.log
  624. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  625. rem TEST1
  626. set flag="DC1 1000 Event Start"
  627. call :SUB1 %flag% %test%
  628. tracelog.exe -q dc1 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -f dc10.log >rundrt.log
  629. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  630. set flag="q dc1"
  631. rem TEST2
  632. call :SUB1 %flag% %test%
  633. call :WaitForProcessExit tracedp.exe
  634. sleep 10
  635. tracelog.exe -stop dc1 >rundrt.log
  636. for /F "tokens=3" %%I in ('findstr -i Status: rundrt.log') do set test=%%I
  637. set flag="Stop DC1"
  638. rem TEST3
  639. call :SUB1 %flag% %test%
  640. tracerpt dc10.log -o dc1.csv -summary dc1.txt -y -df>dumpdrt.log
  641. set /a TOTAL=0
  642. for /F "tokens=2" %%A in ('findstr -i TraceDp dc1.txt') do set /a TOTAL=TOTAL+%%A
  643. set flag="tracerpt -df 1000 events"
  644. rem TEST4 Check for 1000 events
  645. if %TOTAL% == 1000 (set test=0L) else (set test=1L)
  646. call :SUB1 %flag% %test%
  647. sleep 1
  648. :EOL
  649. @echo ____________________________________________________
  650. @echo If you have any questions about this script contact:
  651. @echo Melur Raghuraman alias:mraghu
  652. @echo ____________________________________________________
  653. @echo The list of the Successful tests are dumped in ST.txt file.
  654. @echo The list of the Failed tests are dumped in FT.txt file.
  655. @echo The details of Successful test are in SuccessTests.log.
  656. @echo The details of Failed tests are in FailedTests.log.
  657. echo.
  658. if not exist st.txt (
  659. sline=0
  660. @echo ====================================
  661. @echo Sorry all of the tests have Failed.
  662. ) else (
  663. wc st.txt>linecount.txt
  664. for /F "tokens=1" %%I in (linecount.txt) do set sline=%%I
  665. )
  666. if not exist ft.txt (
  667. set fline=0
  668. @echo ================================================
  669. @echo Congratulation all of the tests are Successful.
  670. ) else (
  671. wc ft.txt>linecount.txt
  672. for /F "tokens=1" %%I in (linecount.txt) do set fline=%%I
  673. )
  674. @echo ===========================
  675. @echo %sline% Successful tests.
  676. @echo %fline% Failed tests.
  677. @echo ===========================
  678. del dp*
  679. goto :EOF
  680. :help
  681. echo !
  682. echo There is no help!
  683. echo !
  684. :SUB1
  685. if %2==0L (
  686. echo.
  687. @echo %1 SUCCESS >> ST.txt
  688. echo. >>SuccessTests.log
  689. echo. >>SuccessTests.log
  690. @echo TEST %1 SUCCESS >> SuccessTests.log
  691. type rundrt.log >> SuccessTests.log
  692. @echo TEST %1 SUCCESS
  693. echo.
  694. ) else (
  695. echo.
  696. @echo %1 FAILED >> FT.txt
  697. echo. >>FailedTests.log
  698. echo. >>FailedTests.log
  699. @echo TEST %1 FAILED >> FailedTests.log
  700. type rundrt.log >> FailedTests.log
  701. @echo TEST %1 FAILED ErrorCode %2
  702. echo.
  703. )
  704. goto :EOF
  705. :WaitForProcessExit
  706. rem Iterate 10 times.
  707. set /a Iter=0
  708. :ReTry
  709. sleep 2
  710. tlist > tlist.out
  711. set /a TOTAL=0
  712. for /F "tokens=2" %%A in ('findstr -i %1 tlist.out') do set /a TOTAL=TOTAL+%%A
  713. set /a Iter=Iter+1
  714. if %Iter% == 10 (goto :EOF) else (goto :Retry)
  715. :EOF