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.

537 lines
16 KiB

  1. @echo off
  2. rem
  3. rem Name : RunDump.cmd
  4. rem Author: Jen-Lung Chiu
  5. rem Date : August 1st, 1999
  6. rem Revisied by: Sabina Sutkovic
  7. rem Date : 8-31-00
  8. rem
  9. rem CMD script file tests event tracing consumer.
  10. rem All the variations are very trivial and test for basic functionality.
  11. rem
  12. if exist evntrace.log del evntrace.log
  13. if exist provider.log del provider.log
  14. if exist dump.txt del dump.txt
  15. if exist dumpST.log del dumpST.log
  16. if exist dumpFT.log del dumpFT.log
  17. if exist STD.txt del STD.txt
  18. if exist FTD.txt del FTD.txt
  19. rem In tracedmp we had to check for two things in order to know if the test is
  20. rem successfull or not. First we check if the number of lines in dumpfile.csv is
  21. rem greater then one. Second we need to check if the number of events proccessed
  22. rem is equal to the number of events sent from provider in Summery.txt file.
  23. set flag=0
  24. @echo ========================================================
  25. @echo Variation 1 - consumer processes logfile of 1000 events.
  26. @echo ========================================================
  27. start /b "Variation 1 - provider 1" tracedp.exe 1000 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -Sleep 10>dump.txt
  28. sleep 1
  29. tracelog.exe -start dc1 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -f dc1.log>dumpdrt.log
  30. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  31. set flag=1
  32. rem TEST1
  33. call :SUB2 %flag% %test%
  34. tracelog.exe -q dc1 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -f dc1.log>dumpdrt.log
  35. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  36. set /A flag=flag+1
  37. rem TEST2
  38. call :SUB2 %flag% %test%
  39. sleep 10
  40. tracelog.exe -stop dc1>dumpdrt.log
  41. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  42. set /A flag=flag+1
  43. rem TEST3
  44. call :SUB2 %flag% %test%
  45. tracedmp -o dc1.csv dc1.log>dumpdrt.log
  46. wc dc1.csv > lcount.txt
  47. for /F "tokens=1" %%I in (lcount.txt) do set line=%%I
  48. echo The number of lines in csv file: %line%
  49. set /A flag=flag+1
  50. rem TEST4
  51. if %line% GTR 1 (
  52. goto :Test2
  53. ) else (
  54. call :SUB2 %flag% F
  55. goto :Endtest
  56. )
  57. :Test2
  58. for /F "tokens=4" %%I in ('findstr /C:"Total Events Processed" dc1.txt') do set test=%%I
  59. echo Events processed: %test%
  60. if %test% == 1001 (
  61. call :SUB2 %flag% 0L
  62. ) else (
  63. call :SUB2 %flag% F
  64. )
  65. :Endtest
  66. @echo ===================================================
  67. @echo Variation 2 - consumer processes real-time buffers.
  68. @echo ===================================================
  69. start /b "Variation 2 - provider 1" tracedp.exe 1000 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -Sleep 10
  70. tracelog.exe -start dc2 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -rt>dumpdrt.log
  71. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  72. set /A flag=flag+1
  73. rem TEST5
  74. call :SUB2 %flag% %test%
  75. @echo tracedmp real-time buffer starts .....
  76. start /b "Variation 2 - consumer" tracedmp.exe -rt dc2 -o dc2.csv>drt.log
  77. sleep 25
  78. tracelog.exe -q dc2 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -rt>dumpdrt.log
  79. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  80. set /A flag=flag+1
  81. rem TEST6
  82. call :SUB2 %flag% %test%
  83. sleep 25
  84. tracelog.exe -stop dc2 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -rt>dumpdrt.log
  85. sleep 5
  86. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  87. set /A flag=flag+1
  88. rem TEST7
  89. call :SUB2 %flag% %test%
  90. wc dc2.csv >lcount.txt
  91. for /F "tokens=1" %%I in (lcount.txt) do set line=%%I
  92. echo The number of lines in csv file: %line%
  93. rem TEST8
  94. set /A flag=flag+1
  95. if %line% GTR 1 (
  96. goto :Test2
  97. ) else (
  98. call :SUB2 %flag% F
  99. goto :Endtest
  100. )
  101. :Test2
  102. for /F "tokens=4" %%I in ('findstr /C:"Total Events Processed" dc2.txt') do set test=%%I
  103. echo Events processed: %test%
  104. if %test% == 1000 (
  105. call :SUB2 %flag% 0L
  106. ) else (
  107. call :SUB2 %flag% F
  108. )
  109. :Endtest
  110. @echo =============================
  111. @echo Variation 3 - Use MofPtr flag
  112. @echo =============================
  113. start /b "Variation 3 - provider 1" tracedp.exe 1000 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -UseEventTraceHeader -GuidPtrMofPtr -Sleep 10>dump.txt
  114. sleep 1
  115. tracelog.exe -start dc3 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -f dc3.log>dumpdrt.log
  116. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  117. set /A flag=flag+1
  118. rem TEST9
  119. call :SUB2 %flag% %test%
  120. sleep 20
  121. tracelog.exe -stop dc3 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -f dc3.log>dumpdrt.log
  122. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  123. set /A flag=flag+1
  124. rem TEST10
  125. call :SUB2 %flag% %test%
  126. tracedmp -o dc3.csv dc3.log>dumpdrt.log
  127. wc dc1.csv > lcount.txt
  128. for /F "tokens=1" %%I in (lcount.txt) do set line=%%I
  129. echo The number of lines in csv file: %line%
  130. set /A flag=flag+1
  131. rem TEST11
  132. if %line% GTR 1 (
  133. goto :Test2
  134. ) else (
  135. call :SUB2 %flag% F
  136. goto :Endtest
  137. )
  138. :Test2
  139. for /F "tokens=4" %%I in ('findstr /C:"Total Events Processed" dc3.txt') do set test=%%I
  140. echo Events processed: %test%
  141. if %test% == 1001 (
  142. call :SUB2 %flag% 0L
  143. ) else (
  144. call :SUB2 %flag% F
  145. )
  146. :Endtest
  147. @echo ================================================================
  148. @echo Variation 4 - Use -GuidPtrMofPtr flag with larger MofData length
  149. @echo ================================================================
  150. start /b "Variation 4 - provider 1" tracedp.exe 1000 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -UseEventTraceHeader -InCorrectMofPtr -Sleep 10>dump.txt
  151. sleep 1
  152. tracelog.exe -start dc4 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -f dc4.log>dumpdrt.log
  153. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  154. set /A flag=flag+1
  155. rem TEST12
  156. call :SUB2 %flag% %test%
  157. sleep 25
  158. tracelog.exe -stop dc4 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -f dc4.log>dumpdrt.log
  159. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  160. set /A flag=flag+1
  161. rem TEST13
  162. call :SUB2 %flag% %test%
  163. tracedmp -o dc4.csv dc4.log>dumpdrt.log
  164. wc dc1.csv > lcount.txt
  165. for /F "tokens=1" %%I in (lcount.txt) do set line=%%I
  166. echo The number of lines in csv file: %line%
  167. set /A flag=flag+1
  168. rem TEST14
  169. if %line% GTR 1 (
  170. goto :Test2
  171. ) else (
  172. call :SUB2 %flag% F
  173. goto :Endtest
  174. )
  175. :Test2
  176. for /F "tokens=4" %%I in ('findstr /C:"Total Events Processed" dc4.txt') do set test=%%I
  177. echo Events processed: %test%
  178. if %test% == 1001 (
  179. call :SUB2 %flag% 0L
  180. ) else (
  181. call :SUB2 %flag% F
  182. )
  183. :Endtest
  184. @echo ======================================================
  185. @echo Variation 5 - Use -GuidPtrMofPtr flag with NULL MofPtr
  186. @echo ======================================================
  187. start /b "Variation 5 - provider 1" tracedp.exe 1000 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -UseEventTraceHeader -NullMofPtr -Sleep 10>dump.txt
  188. sleep 1
  189. tracelog.exe -start dc5 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -f dc5.log>dumpdrt.log
  190. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  191. set /A flag=flag+1
  192. rem TEST15
  193. call :SUB2 %flag% %test%
  194. sleep 25
  195. tracelog.exe -stop dc5 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -f dc5.log>dumpdrt.log
  196. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  197. set /A flag=flag+1
  198. rem TEST16
  199. call :SUB2 %flag% %test%
  200. tracedmp -o dc5.csv dc5.log>dumpdrt.log
  201. wc dc5.csv >lcount.txt
  202. for /F "tokens=1" %%I in (lcount.txt) do set line=%%I
  203. echo The number of lines in csv file: %line%
  204. set /A flag=flag+1
  205. rem TEST17
  206. if %line% GTR 1 (
  207. goto :Test2
  208. ) else (
  209. call :SUB2 %flag% F
  210. goto :Endtest
  211. )
  212. :Test2
  213. for /F "tokens=4" %%I in ('findstr /C:"Total Events Processed" dc5.txt') do set test=%%I
  214. echo Events processed: %test%
  215. if %test% == 1001 (
  216. call :SUB2 %flag% 0L
  217. ) else (
  218. call :SUB2 %flag% F
  219. )
  220. :Endtest
  221. @echo ===========================================================
  222. @echo Variation 6 - consumer processes UM logfile of 1000 events.
  223. @echo ==========================================================
  224. start /b "Variation 6 - provider 1" tracedp.exe 1000 -Sleep 15>dump.txt
  225. sleep 1
  226. tracelog.exe -start dc6 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -um -f dc6.log>dumpdrt.log
  227. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  228. set /A flag=flag+1
  229. rem TEST18
  230. call :SUB2 %flag% %test%
  231. sleep 20
  232. tracelog.exe -stop dc6 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -um -f dc6.log>dumpdrt.log
  233. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  234. set /A flag=flag+1
  235. rem TEST19
  236. call :SUB2 %flag% %test%
  237. tracedmp -o dc6.csv dc6.log_0>dumpdrt.log
  238. wc dc6.csv>lcount.txt
  239. for /F "tokens=1" %%I in (lcount.txt) do set line=%%I
  240. echo The number of lines in csv file: %line%
  241. set /A flag=flag+1
  242. rem TEST20
  243. if %line% GTR 1 (
  244. goto :Test2
  245. ) else (
  246. call :SUB2 %flag% F
  247. goto :Endtest
  248. )
  249. :Test2
  250. for /F "tokens=4" %%I in ('findstr /C:"Total Events Processed" dc6.txt') do set test=%%I
  251. echo Events processed: %test%
  252. if %test%==1001 (
  253. call :SUB2 %flag% 0L
  254. ) else (
  255. call :SUB2 %flag% F
  256. )
  257. :Endtest
  258. @echo ===========================================
  259. @echo Variation 7 - Use MofPtr flag in UM logfile
  260. @echo ===========================================
  261. start /b "Variation 7 - provider 1" tracedp.exe 1000 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -UseEventTraceHeader -GuidPtrMofPtr -Sleep 10
  262. sleep 1
  263. tracelog.exe -start dc7 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -um -f dc7.log>dumpdrt.log
  264. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  265. set /A flag=flag+1
  266. rem TEST21
  267. call :SUB2 %flag% %test%
  268. sleep 15
  269. tracelog.exe -stop dc7 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -um -f dc7.log>dumpdrt.log
  270. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  271. set /A flag=flag+1
  272. rem TEST22
  273. call :SUB2 %flag% %test%
  274. tracedmp -o dc7.csv dc7.log_0>dumpdrt.log
  275. wc dc7.csv >lcount.txt
  276. for /F "tokens=1" %%I in (lcount.txt) do set line=%%I
  277. echo The number of lines in csv file: %line%
  278. set /A flag=flag+1
  279. rem TEST23
  280. if %line% GTR 1 (
  281. goto :Test2
  282. ) else (
  283. call :SUB2 %flag% F
  284. goto :Endtest
  285. )
  286. :Test2
  287. for /F "tokens=4" %%I in ('findstr /C:"Total Events Processed" dc7.txt') do set test=%%I
  288. echo Events processed: %test%
  289. if %test% == 1001 (
  290. call :SUB2 %flag% 0L
  291. ) else (
  292. call :SUB2 %flag% F
  293. )
  294. :Endtest
  295. @echo =====================================================================
  296. @echo Variation 8 - Use MofPtr flag with larger MofData length in UM logger
  297. @echo =====================================================================
  298. start /b "Variation 8 - provider 1" tracedp.exe 1000 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -Sleep 10
  299. sleep 1
  300. tracelog.exe -start dc8 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -um -f dc8.log>dumpdrt.log
  301. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  302. set /A flag=flag+1
  303. rem TEST24
  304. call :SUB2 %flag% %test%
  305. sleep 20
  306. tracelog.exe -stop dc8 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -um -f dc8.log>dumpdrt.log
  307. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  308. set /A flag=flag+1
  309. rem TEST25
  310. call :SUB2 %flag% %test%
  311. tracedmp -o dc8.csv dc8.log_0>dumpdrt.log
  312. wc dc8.csv >lcount.txt
  313. for /F "tokens=1" %%I in (lcount.txt) do set line=%%I
  314. echo The number of lines in csv file: %line%
  315. set /A flag=flag+1
  316. rem TEST26
  317. if %line% GTR 1 (
  318. goto :Test2
  319. ) else (
  320. call :SUB2 %flag% F
  321. goto :Endtest
  322. )
  323. :Test2
  324. for /F "tokens=4" %%I in ('findstr /C:"Total Events Processed" dc8.txt') do set test=%%I
  325. echo Events processed: %test%
  326. if %test% == 1001 (
  327. call :SUB2 %flag% 0L
  328. ) else (
  329. call :SUB2 %flag% F
  330. )
  331. :Endtest
  332. @echo ============================================================
  333. @echo Variation 9 - Use MofPtr flag with NULL MofPtr in UM logfile
  334. @echo ============================================================
  335. start /b "Variation 9 - provider 1" tracedp.exe 1000 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -UseEventTraceHeader -NullMofPtr -Sleep 10
  336. sleep 1
  337. tracelog.exe -start dc9 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -um -f dc9.log>dumpdrt.log
  338. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  339. set /A flag=flag+1
  340. rem TEST27
  341. call :SUB2 %flag% %test%
  342. sleep 15
  343. tracelog.exe -stop dc9 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -um -f dc9.log>dumpdrt.log
  344. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  345. set /A flag=flag+1
  346. rem TEST28
  347. call :SUB2 %flag% %test%
  348. tracedmp -o dc9.csv dc9.log_0>dumpdrt.log
  349. wc dc9.csv >lcount.txt
  350. for /F "tokens=1" %%I in (lcount.txt) do set line=%%I
  351. echo The number of lines in csv file: %line%
  352. set /A flag=flag+1
  353. rem TEST29
  354. if %line% GTR 1 (
  355. goto :Test2
  356. ) else (
  357. call :SUB2 %flag% F
  358. goto :Endtest
  359. )
  360. :Test2
  361. for /F "tokens=4" %%I in ('findstr /C:"Total Events Processed" dc9.txt') do set test=%%I
  362. echo Events processed: %test%
  363. if %test% == 1001 (
  364. call :SUB2 %flag% 0L
  365. ) else (
  366. call :SUB2 %flag% F
  367. )
  368. :Endtest
  369. @echo ========================================================
  370. @echo Variation 10 - Kernal test in real time tracing registry,
  371. @echo fio and page fault events.
  372. @echo ========================================================
  373. sleep 1
  374. tracelog.exe -start -rt -cm -fio -pf>dumpdrt.log
  375. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  376. set /A flag=flag+1
  377. rem TEST30
  378. call :SUB2 %flag% %test%
  379. tracelog.exe -q >dumpdrt.log
  380. for /F "tokens=3" %%I in ('findstr Status: dumpdrt.log') do set test=%%I
  381. set /A flag=flag+1
  382. rem TEST31
  383. call :SUB2 %flag% %test%
  384. start /b tracedmp -rt
  385. sleep 20
  386. tracelog.exe -stop >drt.log
  387. for /F "tokens=3" %%I in ('findstr Status: drt.log') do set test=%%I
  388. set /A flag=flag+1
  389. rem TEST32
  390. call :SUB2 %flag% %test%
  391. sleep 20
  392. wc dumpfile.csv > lcount.txt
  393. for /F "tokens=1" %%I in (lcount.txt) do set line=%%I
  394. echo The number of lines in csv file: %line%
  395. set /A flag=flag+1
  396. rem TEST33
  397. if %line% GTR 1 (
  398. goto :Test2
  399. ) else (
  400. call :SUB2 %flag% F
  401. goto :Endtest
  402. )
  403. :Test2
  404. for /F "tokens=4" %%I in ('findstr /C:"Total Events Processed" Summary.txt') do set test=%%I
  405. echo Events processed: %test%
  406. if %test% GTR 0 (
  407. call :SUB2 %flag% 0L
  408. ) else (
  409. call :SUB2 %flag% F
  410. )
  411. :Endtest
  412. @echo ____________________________________________________
  413. @echo If you have any questions about this script contact:
  414. @echo Sabina Sutkovic alias:t-sabins
  415. @echo Melur Raghuraman alias:mraghu
  416. @echo ____________________________________________________
  417. @echo The list of the Successful tests are dumped in STD.txt file.
  418. @echo The list of the Failed tests are dumped in FTD.txt file.
  419. @echo The details of Successful tests are in dumpST.log.
  420. @echo The details of Failed tests are in dumpFT.log
  421. if not exist STD.txt (
  422. sline=0
  423. @echo ====================================
  424. @echo Sorry all of the tests have Failed.
  425. ) else (
  426. wc STD.txt>lcount.txt
  427. for /F "tokens=1" %%I in (lcount.txt) do set sline=%%I
  428. )
  429. if not exist FTD.txt (
  430. set fline=0
  431. @echo ================================================
  432. @echo Congratulation all of the tests are Successful.
  433. ) else (
  434. wc FTD.txt>lcount.txt
  435. for /F "tokens=1" %%I in (linecount.txt) do set fline=%%I
  436. )
  437. @echo ===========================
  438. @echo %sline% Successful tests.
  439. @echo %fline% Failed tests.
  440. @echo ===========================
  441. :CLEANUP
  442. del dc*.log
  443. del dc*.csv
  444. del dc*.txt
  445. del STD.txt
  446. del FTD.txt
  447. goto :EOF
  448. :SUB2
  449. if %2==0L (
  450. echo.
  451. @echo TEST %1 SUCCESS >> STD.txt
  452. echo. >>dumpST.log
  453. echo. >>dumpST.log
  454. @echo TEST %1 SUCCESS >> dumpST.log
  455. type dumpdrt.log >> dumpST.log
  456. @echo TEST %1 SUCCESS
  457. echo.
  458. ) else (
  459. echo.
  460. @echo TEST %1 FAILED >> FTD.txt
  461. echo. >>dumpFT.log
  462. echo. >>dumpFT.log
  463. @echo TEST %1 FAILED >> dumpFT.log
  464. type dumpdrt.log >>dumpFT.log
  465. @echo TEST %1 FAILED
  466. echo.
  467. )
  468. :EOF