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.

122 lines
3.3 KiB

  1. @rem = '
  2. @goto endofperl
  3. ';
  4. $USAGE = "
  5. Usage: $0 NTFRS_log_file
  6. search the logfile(s) for the strings marking the start of each of the main FRS
  7. threads. These can be header lines for known threads or startup threads.
  8. Extract the thread ID and output a findstr command that will search
  9. the log file for all records associated with the given thread.
  10. The thread output file names are:
  11. First : First thread at process create
  12. Shutdown : Shutdown thread
  13. FrsDs : Directory service polling
  14. SndCs : Packet send command server
  15. DelCs : Delay command server
  16. OutLog : Outbound log processor
  17. ReplicaCs : Replica command server
  18. JRNL : NTFS Journal record processor
  19. DBCs : Database command server
  20. JrnlRead : NTFS Journal read thread
  21. COAccept : Change Order Accept processor
  22. ChgOrdRetryCS : Change order retry command server
  23. Wait : Wait command server
  24. FetchCs : Stage file fetch command server
  25. StageCs : Stage file generation command server
  26. ";
  27. die $USAGE unless @ARGV;
  28. $InFile = "";
  29. while (<>) {
  30. if ($InFile ne $ARGV) {
  31. $InFile = $ARGV;
  32. #printf("- - - - - %s - - - - -\n\n", $InFile);
  33. }
  34. $ThId = "";
  35. chop;
  36. s/ //g;
  37. ($func, $thrd, $line, $sev, $hr, $min, $sec, $H, $ThName, $ThId) = split(/:/, $_);
  38. #
  39. # capture config parameters
  40. #
  41. if (m/<DbgPrintThreadIds/ && ($ThId ne "")) {
  42. if ($Thhash{$ThName} eq "") {
  43. $Thhash{$ThName} = $ThId;
  44. # printf("%s\n", $_);
  45. }
  46. }
  47. if (m/<ThSupCreateThread/) {
  48. ($ThName) = $ThName =~ m{Startingthread(.*)};
  49. if ($ThName ne "") {
  50. ($ThId) = $ThId =~ m{Id(.*)\(};
  51. if ($ThId ne "") {
  52. $StartThr{$ThName} .= "$ThId: ";
  53. # printf("%s\n", $_); printf("%s\n", $StartThr{$ThName});
  54. }
  55. }
  56. }
  57. }
  58. foreach $param (sort keys(%Thhash)) {
  59. printf("findstr -c:\"%s:\" %%\* \> %s.thr\n", $Thhash{$param}, $param);
  60. $flist .= "$param.thr ";
  61. }
  62. foreach $param (sort keys(%StartThr)) {
  63. printf("findstr \"%s\" %%\* \> %s-2.thr\n", $StartThr{$param}, $param);
  64. $flist .= "$param-2.thr ";
  65. }
  66. print STDERR "start list $flist\n";
  67. #:H: Known thread IDs -
  68. #:H: First : 2812
  69. #:H: Shutdown : 1300
  70. #:H: FrsDs : 2936
  71. #:H: SndCs : 1592
  72. #:H: DelCs : 820
  73. #:H: OutLog : 2812
  74. #:H: ReplicaCs : 2216
  75. #:H: JRNL : 2852
  76. #:H: DBCs : 2892
  77. #:H: JrnlRead : 1436
  78. #:H: COAccept : 2800
  79. #:H: ChgOrdRetryCS : 3016
  80. #:H: ThCs: Wait on threads. : 704
  81. #:H: Wait : 2580
  82. #:H: StageCs : 2308
  83. #:H: FetchCs : 692
  84. #Thread start messages look like
  85. #:S: Starting thread ReplicaCs: Id 3036 (00000bdc)
  86. #:S: Starting thread SndCs: Id 2992 (00000bb0)
  87. #:S: Starting thread SndCs: Id 1212 (000004bc)
  88. __END__
  89. :endofperl
  90. @perl %0.cmd %*
  91. @goto QUIT
  92. :QUIT