< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SALauncher.java

Print this page




  56 
  57     private static boolean jinfoHelp() {
  58         // --flags -> -flags
  59         // --sysprops -> -sysprops
  60         System.out.println("    --flags\tto print VM flags");
  61         System.out.println("    --sysprops\tto print Java System properties");
  62         System.out.println("    <no option>\tto print both of the above");
  63         return commonHelp();
  64     }
  65 
  66     private static boolean jmapHelp() {
  67         // --heap -> -heap
  68         // --binaryheap -> -heap:format=b
  69         // --histo -> -histo
  70         // --clstats -> -clstats
  71         // --finalizerinfo -> -finalizerinfo
  72 
  73         System.out.println("    <no option>\tto print same info as Solaris pmap");
  74         System.out.println("    --heap\tto print java heap summary");
  75         System.out.println("    --binaryheap\tto dump java heap in hprof binary format");

  76         System.out.println("    --histo\tto print histogram of java object heap");
  77         System.out.println("    --clstats\tto print class loader statistics");
  78         System.out.println("    --finalizerinfo\tto print information on objects awaiting finalization");
  79         return commonHelp();
  80     }
  81 
  82     private static boolean jstackHelp() {
  83         // --locks -> -l
  84         // --mixed -> -m
  85         System.out.println("    --locks\tto print java.util.concurrent locks");
  86         System.out.println("    --mixed\tto print both java and native frames (mixed mode)");
  87         return commonHelp();
  88     }
  89 
  90     private static boolean jsnapHelp() {
  91         System.out.println("    --all\tto print all performance counters");
  92         return commonHelp();
  93     }
  94 
  95     private static boolean toolHelp(String toolName) {


 224                 pid = sg.getOptarg();
 225                 continue;
 226             }
 227             if (s.equals("mixed")) {
 228                 newArgs.add("-m");
 229                 continue;
 230             }
 231             if (s.equals("locks")) {
 232                 newArgs.add("-l");
 233                 continue;
 234             }
 235         }
 236 
 237         buildAttachArgs(newArgs, pid, exe, core, false);
 238         JStack.main(newArgs.toArray(new String[newArgs.size()]));
 239     }
 240 
 241     private static void runJMAP(String[] oldArgs) {
 242         SAGetopt sg = new SAGetopt(oldArgs);
 243         String[] longOpts = {"exe=", "core=", "pid=",
 244               "heap", "binaryheap", "histo", "clstats", "finalizerinfo"};
 245 
 246         ArrayList<String> newArgs = new ArrayList();
 247         String pid = null;
 248         String exe = null;
 249         String core = null;
 250         String s = null;


 251 
 252         while((s = sg.next(null, longOpts)) != null) {
 253             if (s.equals("exe")) {
 254                 exe = sg.getOptarg();
 255                 continue;
 256             }
 257             if (s.equals("core")) {
 258                 core = sg.getOptarg();
 259                 continue;
 260             }
 261             if (s.equals("pid")) {
 262                 pid = sg.getOptarg();
 263                 continue;
 264             }
 265             if (s.equals("heap")) {
 266                 newArgs.add("-heap");
 267                 continue;
 268             }
 269             if (s.equals("binaryheap")) {
 270                 newArgs.add("-heap:format=b");




 271                 continue;
 272             }
 273             if (s.equals("histo")) {
 274                 newArgs.add("-histo");
 275                 continue;
 276             }
 277             if (s.equals("clstats")) {
 278                 newArgs.add("-clstats");
 279                 continue;
 280             }
 281             if (s.equals("finalizerinfo")) {
 282                 newArgs.add("-finalizerinfo");
 283                 continue;
 284             }










 285         }
 286 
 287         buildAttachArgs(newArgs, pid, exe, core, false);
 288         JMap.main(newArgs.toArray(new String[newArgs.size()]));
 289     }
 290 
 291     private static void runJINFO(String[] oldArgs) {
 292         SAGetopt sg = new SAGetopt(oldArgs);
 293         String[] longOpts = {"exe=", "core=", "pid=",
 294                                      "flags", "sysprops"};
 295 
 296         ArrayList<String> newArgs = new ArrayList();
 297         String exe = null;
 298         String pid = null;
 299         String core = null;
 300         String s = null;
 301 
 302         while((s = sg.next(null, longOpts)) != null) {
 303             if (s.equals("exe")) {
 304                 exe = sg.getOptarg();




  56 
  57     private static boolean jinfoHelp() {
  58         // --flags -> -flags
  59         // --sysprops -> -sysprops
  60         System.out.println("    --flags\tto print VM flags");
  61         System.out.println("    --sysprops\tto print Java System properties");
  62         System.out.println("    <no option>\tto print both of the above");
  63         return commonHelp();
  64     }
  65 
  66     private static boolean jmapHelp() {
  67         // --heap -> -heap
  68         // --binaryheap -> -heap:format=b
  69         // --histo -> -histo
  70         // --clstats -> -clstats
  71         // --finalizerinfo -> -finalizerinfo
  72 
  73         System.out.println("    <no option>\tto print same info as Solaris pmap");
  74         System.out.println("    --heap\tto print java heap summary");
  75         System.out.println("    --binaryheap\tto dump java heap in hprof binary format");
  76         System.out.println("    --dumpfile\tname of the dump file");
  77         System.out.println("    --histo\tto print histogram of java object heap");
  78         System.out.println("    --clstats\tto print class loader statistics");
  79         System.out.println("    --finalizerinfo\tto print information on objects awaiting finalization");
  80         return commonHelp();
  81     }
  82 
  83     private static boolean jstackHelp() {
  84         // --locks -> -l
  85         // --mixed -> -m
  86         System.out.println("    --locks\tto print java.util.concurrent locks");
  87         System.out.println("    --mixed\tto print both java and native frames (mixed mode)");
  88         return commonHelp();
  89     }
  90 
  91     private static boolean jsnapHelp() {
  92         System.out.println("    --all\tto print all performance counters");
  93         return commonHelp();
  94     }
  95 
  96     private static boolean toolHelp(String toolName) {


 225                 pid = sg.getOptarg();
 226                 continue;
 227             }
 228             if (s.equals("mixed")) {
 229                 newArgs.add("-m");
 230                 continue;
 231             }
 232             if (s.equals("locks")) {
 233                 newArgs.add("-l");
 234                 continue;
 235             }
 236         }
 237 
 238         buildAttachArgs(newArgs, pid, exe, core, false);
 239         JStack.main(newArgs.toArray(new String[newArgs.size()]));
 240     }
 241 
 242     private static void runJMAP(String[] oldArgs) {
 243         SAGetopt sg = new SAGetopt(oldArgs);
 244         String[] longOpts = {"exe=", "core=", "pid=",
 245               "heap", "binaryheap", "dumpfile=", "histo", "clstats", "finalizerinfo"};
 246 
 247         ArrayList<String> newArgs = new ArrayList();
 248         String pid = null;
 249         String exe = null;
 250         String core = null;
 251         String s = null;
 252         String dumpfile = null;
 253         boolean requestHeapdump = false;
 254 
 255         while((s = sg.next(null, longOpts)) != null) {
 256             if (s.equals("exe")) {
 257                 exe = sg.getOptarg();
 258                 continue;
 259             }
 260             if (s.equals("core")) {
 261                 core = sg.getOptarg();
 262                 continue;
 263             }
 264             if (s.equals("pid")) {
 265                 pid = sg.getOptarg();
 266                 continue;
 267             }
 268             if (s.equals("heap")) {
 269                 newArgs.add("-heap");
 270                 continue;
 271             }
 272             if (s.equals("binaryheap")) {
 273                 requestHeapdump = true;
 274                 continue;
 275             }
 276             if (s.equals("dumpfile")) {
 277                 dumpfile = sg.getOptarg();
 278                 continue;
 279             }
 280             if (s.equals("histo")) {
 281                 newArgs.add("-histo");
 282                 continue;
 283             }
 284             if (s.equals("clstats")) {
 285                 newArgs.add("-clstats");
 286                 continue;
 287             }
 288             if (s.equals("finalizerinfo")) {
 289                 newArgs.add("-finalizerinfo");
 290                 continue;
 291             }
 292         }
 293 
 294         if (requestHeapdump) {
 295             if (dumpfile == null) {
 296                 newArgs.add("-heap:format=b");
 297             } else {
 298                 newArgs.add("-heap:format=b,file=" + dumpfile);
 299             }
 300         } else if (dumpfile != null) {
 301             throw new IllegalArgumentException("dumpfile does not need.");
 302         }
 303 
 304         buildAttachArgs(newArgs, pid, exe, core, false);
 305         JMap.main(newArgs.toArray(new String[newArgs.size()]));
 306     }
 307 
 308     private static void runJINFO(String[] oldArgs) {
 309         SAGetopt sg = new SAGetopt(oldArgs);
 310         String[] longOpts = {"exe=", "core=", "pid=",
 311                                      "flags", "sysprops"};
 312 
 313         ArrayList<String> newArgs = new ArrayList();
 314         String exe = null;
 315         String pid = null;
 316         String core = null;
 317         String s = null;
 318 
 319         while((s = sg.next(null, longOpts)) != null) {
 320             if (s.equals("exe")) {
 321                 exe = sg.getOptarg();


< prev index next >