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.

380 lines
11 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
  7. rem CMD script file to test event tracing consumer.
  8. rem All the variations are very trivial and test for basic functionality.
  9. rem
  10. if exist evntrace.log del evntrace.log
  11. if exist provider.log del provider.log
  12. echo !
  13. echo ! The tests start now
  14. echo !
  15. :VARIATION1
  16. echo !
  17. echo ! Variation 1 - consumer processes logfile of 1000 events.
  18. echo !
  19. echo ! Starting provider 1 ...
  20. start "Variation 1 - provider 1" provider.exe 1000 d58c126f-b309-11d1-969e-0000f875a5bc
  21. echo ! Starting provider 1 finished
  22. echo !
  23. echo ! Sleeping for 1 second...
  24. sleep 1
  25. echo ! Starting Logger with corresponding Control GUID
  26. tracelog.exe -start dc1 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -f dc1.log
  27. echo ! Starting logger dc1 finished
  28. echo !
  29. echo ! Sleeping for 5 seconds...
  30. sleep 5
  31. echo ! Stopping logger dc1 (provider 1 should quit automatically) ...
  32. tracelog.exe -stop dc1 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -f dc1.log
  33. echo ! Stopping logger dc1 finished
  34. echo ! tracedmp dc1.log starts .....
  35. tracedmp -o dc1.csv dc1.log
  36. echo ! tracedmp dc1.log ends
  37. set /a TOTAL=0
  38. for /F "tokens=2" %%A in ('findstr Unknown dc1.txt') do set /a TOTAL=TOTAL+%%A
  39. if %TOTAL% == 1000 goto :VARIATION2
  40. echo !
  41. echo ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  42. echo ! !!!!!!!!! !!!!!!!!!
  43. echo ! !!!!!!!!! Variation 1 FAIL !!!!!!!!!
  44. echo ! !!!!!!!!! !!!!!!!!!
  45. echo ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  46. echo !
  47. :VARIATION2
  48. echo !
  49. echo ! Variation 2 - consumer processes real-time buffers.
  50. echo !
  51. echo ! Starting provider 1 ...
  52. start "Variation 2 - provider 1" provider.exe 1000 d58c126f-b309-11d1-969e-0000f875a5bc 1000
  53. echo ! Starting provider 1 finished
  54. echo !
  55. echo ! Sleeping for 1 second...
  56. sleep 1
  57. echo ! Starting real-time Logger with corresponding Control GUID
  58. tracelog.exe -start dc2 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -rt
  59. echo ! Starting real-time logger finished
  60. echo !
  61. echo ! tracedmp real-time buffer starts .....
  62. start "Variatuin 2 - consumer" tracedmp -rt dc2 -o dc2.csv
  63. echo ! tracedmp real-time buffer ends
  64. echo ! Sleeping for 20 seconds...
  65. sleep 20
  66. echo ! Stopping real-time logger (provider 1 should quit automatically) ...
  67. tracelog.exe -stop dc2 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -rt
  68. echo ! Stopping real-time logger finished
  69. set /a TOTAL=0
  70. for /F "tokens=2" %%A in ('findstr Unknown dc2.txt') do set /a TOTAL=TOTAL+%%A
  71. if %TOTAL% == 1000 goto :VARIATION3
  72. echo !
  73. echo ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  74. echo ! !!!!!!!!! !!!!!!!!!
  75. echo ! !!!!!!!!! Variation 2 FAIL !!!!!!!!!
  76. echo ! !!!!!!!!! !!!!!!!!!
  77. echo ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  78. echo !
  79. :VARIATION3
  80. echo !
  81. echo ! Variation 3 - Use MofPtr flag
  82. echo !
  83. echo ! Starting provider 1 ...
  84. start "Variation 3 - provider 1" provider.exe 1000 d58c126f-b309-11d1-969e-0000f875a5bc 0 TraceEvent MofPtr
  85. echo ! Starting provider 1 finished
  86. echo !
  87. echo ! Sleeping for 1 second...
  88. sleep 1
  89. echo ! Starting Logger with corresponding Control GUID
  90. tracelog.exe -start dc3 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -f dc3.log
  91. echo ! Starting logger dc3 finished
  92. echo !
  93. echo ! Sleeping for 5 seconds...
  94. sleep 5
  95. echo ! Stopping logger dc3 (provider 1 should quit automatically) ...
  96. tracelog.exe -stop dc3 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -f dc3.log
  97. echo ! Stopping logger dc3 finished
  98. echo ! tracedmp dc3.log starts .....
  99. tracedmp -o dc3.csv dc3.log
  100. echo ! tracedmp dc3.log ends
  101. set /a TOTAL=0
  102. for /F "tokens=2" %%A in ('findstr Unknown dc3.txt') do set /a TOTAL=TOTAL+%%A
  103. if %TOTAL% == 1000 goto :MOFPTRTEST3
  104. echo !
  105. echo ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  106. echo ! !!!!!!!!! !!!!!!!!!
  107. echo ! !!!!!!!!! Variation 3 FAIL !!!!!!!!!
  108. echo ! !!!!!!!!! !!!!!!!!!
  109. echo ! !!!!!!!!! Event Count is not 1000 !!!!!!!!!
  110. echo ! !!!!!!!!! !!!!!!!!!
  111. echo ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  112. echo !
  113. goto :VARIATION4
  114. :MOFPTRTEST3
  115. set /a TOTAL=0
  116. for /F "tokens=1" %%A in ('findstr d58c126f-b309-11d1-969e-0000f875a5bc dc3.csv ^| wc') do set /a TOTAL=TOTAL+%%A
  117. if %TOTAL% == 1000 goto :VARIATION4
  118. echo !
  119. echo ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  120. echo ! !!!!!!!!! !!!!!!!!!
  121. echo ! !!!!!!!!! Variation 3 FAIL !!!!!!!!!
  122. echo ! !!!!!!!!! !!!!!!!!!
  123. echo ! !!!!!!!!! MofPtr Incorrect !!!!!!!!!
  124. echo ! !!!!!!!!! !!!!!!!!!
  125. echo ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  126. echo !
  127. :VARIATION4
  128. echo !
  129. echo ! Variation 4 - Use MofPtr flag with larger MofData length
  130. echo !
  131. echo ! Starting provider 1 ...
  132. start "Variation 4 - provider 1" provider.exe 1000 d58c126f-b309-11d1-969e-0000f875a5bc 0 TraceEvent IncorrectMofPtr
  133. echo ! Starting provider 1 finished
  134. echo !
  135. echo ! Sleeping for 1 second...
  136. sleep 1
  137. echo ! Starting Logger with corresponding Control GUID
  138. tracelog.exe -start dc4 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -f dc4.log
  139. echo ! Starting logger dc4 finished
  140. echo !
  141. echo ! Sleeping for 5 seconds...
  142. sleep 5
  143. echo ! Stopping logger dc4 (provider 1 should quit automatically) ...
  144. tracelog.exe -stop dc4 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -f dc4.log
  145. echo ! Stopping logger dc4 finished
  146. echo ! tracedmp dc4.log starts .....
  147. tracedmp -o dc4.csv dc4.log
  148. echo ! tracedmp dc4.log ends
  149. :VARIATION5
  150. echo !
  151. echo ! Variation 5 - Use MofPtr flag with NULL MofPtr
  152. echo !
  153. echo ! Starting provider 1 ...
  154. start "Variation 5 - provider 1" provider.exe 1000 d58c126f-b309-11d1-969e-0000f875a5bc 0 TraceEvent NullMofPtr
  155. echo ! Starting provider 1 finished
  156. echo !
  157. echo ! Sleeping for 1 second...
  158. sleep 1
  159. echo ! Starting Logger with corresponding Control GUID
  160. tracelog.exe -start dc5 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -f dc5.log
  161. echo ! Starting logger dc5 finished
  162. echo !
  163. echo ! Sleeping for 5 seconds...
  164. sleep 5
  165. echo ! Stopping logger dc5 (provider 1 should quit automatically) ...
  166. tracelog.exe -stop dc5 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -f dc5.log
  167. echo ! Stopping logger dc5 finished
  168. echo ! tracedmp dc5.log starts .....
  169. tracedmp -o dc5.csv dc5.log
  170. echo ! tracedmp dc5.log ends
  171. :VARIATION6
  172. echo !
  173. echo ! Variation 6 - consumer processes UM logfile of 1000 events.
  174. echo !
  175. echo ! Starting provider 1 ...
  176. start "Variation 6 - provider 1" provider.exe 1000
  177. echo ! Starting provider 1 finished
  178. echo !
  179. echo ! Sleeping for 1 second...
  180. sleep 1
  181. echo ! Starting Logger with corresponding Control GUID
  182. tracelog.exe -start dc6 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -um -f dc6.log
  183. echo ! Starting logger dc6 finished
  184. echo !
  185. echo ! Sleeping for 5 seconds...
  186. sleep 5
  187. echo ! Stopping logger dc6 (provider 1 should quit automatically) ...
  188. tracelog.exe -stop dc6 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -um -f dc6.log
  189. echo ! Stopping logger dc6 finished
  190. echo ! tracedmp dc6.log starts .....
  191. tracedmp -o dc6.csv dc6.log
  192. echo ! tracedmp dc6.log ends
  193. set /a TOTAL=0
  194. for /F "tokens=2" %%A in ('findstr Unknown dc6.txt') do set /a TOTAL=TOTAL+%%A
  195. if %TOTAL% == 1000 goto :VARIATION7
  196. echo !
  197. echo ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  198. echo ! !!!!!!!!! !!!!!!!!!
  199. echo ! !!!!!!!!! Variation 6 FAIL !!!!!!!!!
  200. echo ! !!!!!!!!! !!!!!!!!!
  201. echo ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  202. echo !
  203. :VARIATION7
  204. echo !
  205. echo ! Variation 7 - Use MofPtr flag in UM logfile
  206. echo !
  207. echo ! Starting provider 1 ...
  208. start "Variation 7 - provider 1" provider.exe 1000 d58c126f-b309-11d1-969e-0000f875a5bc 0 TraceEvent MofPtr
  209. echo ! Starting provider 1 finished
  210. echo !
  211. echo ! Sleeping for 1 second...
  212. sleep 1
  213. echo ! Starting Logger with corresponding Control GUID
  214. tracelog.exe -start dc7 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -um -f dc7.log
  215. echo ! Starting logger dc7 finished
  216. echo !
  217. echo ! Sleeping for 5 seconds...
  218. sleep 5
  219. echo ! Stopping logger dc7 (provider 1 should quit automatically) ...
  220. tracelog.exe -stop dc7 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -um -f dc7.log
  221. echo ! Stopping logger dc7 finished
  222. echo ! tracedmp dc7.log starts .....
  223. tracedmp -o dc7.csv dc7.log
  224. echo ! tracedmp dc7.log ends
  225. set /a TOTAL=0
  226. for /F "tokens=2" %%A in ('findstr Unknown dc7.txt') do set /a TOTAL=TOTAL+%%A
  227. if %TOTAL% == 1000 goto :MOFPTRTEST7
  228. echo !
  229. echo ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  230. echo ! !!!!!!!!! !!!!!!!!!
  231. echo ! !!!!!!!!! Variation 7 FAIL !!!!!!!!!
  232. echo ! !!!!!!!!! !!!!!!!!!
  233. echo ! !!!!!!!!! Event Count is not 1000 !!!!!!!!!
  234. echo ! !!!!!!!!! !!!!!!!!!
  235. echo ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  236. echo !
  237. goto :VARIATION8
  238. :MOFPTRTEST7
  239. set /a TOTAL=0
  240. for /F "tokens=1" %%A in ('findstr d58c126f-b309-11d1-969e-0000f875a5bc dc7.csv ^| wc') do set /a TOTAL=TOTAL+%%A
  241. if %TOTAL% == 1000 goto :VARIATION8
  242. echo !
  243. echo ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  244. echo ! !!!!!!!!! !!!!!!!!!
  245. echo ! !!!!!!!!! Variation 7 FAIL !!!!!!!!!
  246. echo ! !!!!!!!!! !!!!!!!!!
  247. echo ! !!!!!!!!! MofPtr Incorrect !!!!!!!!!
  248. echo ! !!!!!!!!! !!!!!!!!!
  249. echo ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  250. echo !
  251. :VARIATION8
  252. echo !
  253. echo ! Variation 8 - Use MofPtr flag with larger MofData length in UM logger
  254. echo !
  255. echo ! Starting provider 1 ...
  256. start "Variation 8 - provider 1" provider.exe 1000 d58c126f-b309-11d1-969e-0000f875a5bc 0 TraceEvent IncorrectMofPtr
  257. echo ! Starting provider 1 finished
  258. echo !
  259. echo ! Sleeping for 1 second...
  260. sleep 1
  261. echo ! Starting Logger with corresponding Control GUID
  262. tracelog.exe -start dc8 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -um -f dc8.log
  263. echo ! Starting logger dc8 finished
  264. echo !
  265. echo ! Sleeping for 5 seconds...
  266. sleep 5
  267. echo ! Stopping logger dc8 (provider 1 should quit automatically) ...
  268. tracelog.exe -stop dc8 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -um -f dc8.log
  269. echo ! Stopping logger dc8 finished
  270. echo ! tracedmp dc8.log starts .....
  271. tracedmp -o dc8.csv dc8.log
  272. echo ! tracedmp dc8.log ends
  273. :VARIATION9
  274. echo !
  275. echo ! Variation 9 - Use MofPtr flag with NULL MofPtr in UM logfile
  276. echo !
  277. echo ! Starting provider 1 ...
  278. start "Variation 9 - provider 1" provider.exe 1000 d58c126f-b309-11d1-969e-0000f875a5bc 0 TraceEvent NullMofPtr
  279. echo ! Starting provider 1 finished
  280. echo !
  281. echo ! Sleeping for 1 second...
  282. sleep 1
  283. echo ! Starting Logger with corresponding Control GUID
  284. tracelog.exe -start dc9 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -um -f dc9.log
  285. echo ! Starting logger dc9 finished
  286. echo !
  287. echo ! Sleeping for 5 seconds...
  288. sleep 5
  289. echo ! Stopping logger dc9 (provider 1 should quit automatically) ...
  290. tracelog.exe -stop dc9 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -um -f dc9.log
  291. echo ! Stopping logger dc9 finished
  292. echo ! tracedmp dc9.log starts .....
  293. tracedmp -o dc9.csv dc9.log
  294. echo ! tracedmp dc9.log ends
  295. :CLEANUP
  296. del dc*.log
  297. del dc*.csv
  298. del dc*.txt