Changeset 836 for trunk/debugtools
- Timestamp:
- Sep 15, 2007, 3:07:14 AM (18 years ago)
- Location:
- trunk/debugtools
- Files:
-
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/debugtools/fm2dump.cmd
r577 r836 1 1 @echo off 2 :: fm2dump - Prepare for fm/2 process dump3 2 :: $Id$ 4 3 5 :: Search for "EDITME" markers to find lines that may need edits4 :: Prepare for fm/2 process dump 6 5 :: Run script as fm2dump ? for usage help 6 :: Cmd.exe compatible 7 :: Search for "Edit this" markers to find lines that may need site specific edits 7 8 8 :: Copyright (c) 2002, 200 5Steven Levine and Associates, Inc.9 :: Copyright (c) 2002, 2007 Steven Levine and Associates, Inc. 9 10 :: All rights reserved. 10 11 … … 19 20 :: 11 Aug 05 SHL Comments 20 21 :: 24 Mar 07 SHL Write dump file to %TMP% 22 :: 14 Jul 07 SHL Add options, sync with pdumpctl 23 :: 14 Sep 07 SHL Sync with current standards 24 25 :: Version 0.3 21 26 22 27 setlocal 23 28 24 :: E DITME to name dump directory - directory must exist and drive must havesufficient free space29 :: Edit this to point to existing directory on drive with sufficient free space 25 30 set D=%TMP% 26 31 27 :: Try to validate 32 :: Try to validate dump directory 28 33 dir %D%\nul >nul 2>&1 29 34 if not errorlevel 1 goto DirOK 30 echo Directory %D% does not exist - check set D= statement 35 echo Directory %D% does not exist - check set D= statement on line 26 31 36 goto end 32 : DirOK37 :dirok 33 38 34 :: E DITMEto name process to be dumped - .exe is optional39 :: Edit this to name process to be dumped - .exe is optional 35 40 set P=fm3 36 41 37 :: Warn if not visible just by name - OK if in PATH 38 if exist %P%.exe goto ExeOK 39 if exist %P% goto ExeOK 40 echo Warning: %P% not found 41 :ExeOK 42 if "%1" == "" goto Help 42 43 43 if not "%2" == "" goto Help 44 :next 45 46 if "%1" == "a" goto All 47 if "%1" == "A" goto All 48 if "%1" == "c" goto Configure 49 if "%1" == "C" goto Configure 50 if "%1" == "f" goto Force 51 if "%1" == "F" goto Force 52 if "%1" == "n" goto TurnOn 53 if "%1" == "N" goto TurnOn 54 if "%1" == "q" goto Query 55 if "%1" == "Q" goto Query 44 56 if "%1" == "o" goto TurnOff 45 57 if "%1" == "O" goto TurnOff 46 58 if "%1" == "r" goto Reset 47 59 if "%1" == "R" goto Reset 48 if "%1" == "" goto Configure 49 goto Help 60 61 if "%1" == "?" goto Help 62 63 goto Usage 64 65 :: Configure to dump all memory 66 67 :All 68 echo on 69 pdumpusr reset 70 @if errorlevel 1 pause 71 pdumpusr paddr(all) 72 @if errorlevel 1 pause 73 :: Check 74 procdump query 75 @if errorlevel 1 pause 76 @echo off 77 echo Dump facility configured to dump all memory 78 goto shift 79 80 :: Configure optimal dump settings for mr/2 ice 81 82 :Configure 83 :: Turn on dump facility - set dump directory 84 procdump on /l:%D% 85 @if errorlevel 1 pause 86 :: Configure settings 87 procdump set /proc:%P% /pd:instance,private,shared,sysfs,sysio,sysldr,syssem,syssumm,systk,sysvm /pc:0 88 @if errorlevel 1 pause 89 @echo off 90 echo. 91 echo Dump facility configured to dump %P% to %D% 92 goto shift 93 94 :: Force dump with current settings 95 96 :Force 97 echo on 98 procdump force /proc:%P% 99 @echo off 100 echo Forced dump for process %P% 101 goto shift 102 103 :: Query current settings 104 105 :Query 106 echo. 107 echo on 108 procdump query 109 @if errorlevel 1 pause 110 @echo off 111 goto shift 50 112 51 113 :: Reset to defaults 52 114 53 115 :Reset 54 echo on 55 :: Reset directory and freespace limits to defaults 56 procdump reset /f /l 57 @if errorlevel 1 pause 58 procdump reset /pid:all 59 @if errorlevel 1 pause 116 echo on 117 procdump reset /f /l 118 @if errorlevel 1 pause 119 @echo off 120 echo. 121 echo Dump facility reset to default settings 122 goto shift 60 123 61 :: Configure fm/2 specific dump settings 62 63 :Configure 124 :TurnOff 125 echo on 126 procdump reset /l 127 @if errorlevel 1 pause 128 procdump reset /pid:all 129 @if errorlevel 1 pause 130 procdump off 131 @if errorlevel 1 pause 132 @echo off 133 echo. 134 echo Dump facility turned off 135 goto shift 64 136 65 137 :: Turn on dump facility - set dump directory 66 procdump on /l:%D%67 @if errorlevel 1 pause68 :: Configure fm/2 dump69 procdump set /proc:%P% /pd:instance,private,shared,sysfs,sysio,sysldr,syssem,syssumm,systk,sysvm /pc:070 @if errorlevel 1 pause71 :: Check72 procdump query73 @if errorlevel 1 pause74 @echo off75 echo Dump facility configured to dump %P% to %D%76 138 77 goto end 139 :TurnOn 140 echo on 141 procdump on /l:%D% 142 @if errorlevel 1 pause 143 @echo off 144 echo. 145 echo Dump facility turned on 146 goto shift 78 147 79 : TurnOff148 :shift 80 149 81 echo on 82 :: Reset to defaults 83 procdump reset /f /l 84 @if errorlevel 1 pause 85 procdump reset /pid:all 86 @if errorlevel 1 pause 87 :: Turn off 88 procdump off 89 @if errorlevel 1 pause 90 procdump query 91 @if errorlevel 1 pause 92 @echo off 93 echo Dump facility turned off 94 goto end 150 shift 151 if not "%1" == "" goto next 152 goto end 153 154 ::=== Usese: Report usage error === 155 156 :Usage 157 echo. 158 echo Usage: fm2dump [a] [c] [f] [n] [o] [p] [q] [r] 159 echo Use ? to get detailed help 160 goto end 95 161 96 162 ::=== Help: Show usage help === … … 98 164 :Help 99 165 echo. 100 echo Usage: fm2dump [o] [r]166 echo Simple Dump Facility controller for mr/2 ice 101 167 echo. 168 echo Usage: fm2dump [a] [c] [f] [n] [o] [p] [q] [r] 169 echo. 170 echo a Configure to dump all memory 171 echo c Configure optimally for mr/2 dump 172 echo f Force dump using current settings 173 echo n Turn on dump facility 102 174 echo o Turn off dump facility 103 echo r Reset to defaults then configure 104 echo ? This message` 175 echo q Query current settings 176 echo r Reset to default settings 177 echo q Query current settings 178 echo ? Display this message 105 179 echo. 106 echo Only one arg alllowed 107 echo Default is retain current settings and configure fm/2 specfic settings 180 echo Requests are processed left to right 181 echo Errors will pause script 182 echo Edit line 26 to match your system 183 echo Do not forget to turn off dump facility when done 184 echo. Typical use cases 185 echo fm2dump c 186 echo fm2dump c f o 187 echo fm2dump r o 108 188 109 189 :end
Note:
See TracChangeset
for help on using the changeset viewer.