< prev index next >

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

Print this page




  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(" <no option>\tdump performance counters");
  92         return commonHelp();
  93     }
  94 
  95     private static boolean toolHelp(String toolName) {
  96         if (toolName.equals("jstack")) {
  97             return jstackHelp();
  98         }
  99         if (toolName.equals("jinfo")) {
 100             return jinfoHelp();
 101         }
 102         if (toolName.equals("jmap")) {
 103             return jmapHelp();
 104         }
 105         if (toolName.equals("jsnap")) {
 106             return jsnapHelp();
 107         }
 108         if (toolName.equals("hsdb") || toolName.equals("clhsdb")) {
 109             return commonHelp();
 110         }
 111         return launcherHelp();


 314             if (s.equals("pid")) {
 315                 pid = sg.getOptarg();
 316                 continue;
 317             }
 318             if (s.equals("flags")) {
 319                 newArgs.add("-flags");
 320                 continue;
 321             }
 322             if (s.equals("sysprops")) {
 323                 newArgs.add("-sysprops");
 324                 continue;
 325             }
 326         }
 327 
 328         buildAttachArgs(newArgs, pid, exe, core);
 329         JInfo.main(newArgs.toArray(new String[newArgs.size()]));
 330     }
 331 
 332     private static void runJSNAP(String[] oldArgs) {
 333         SAGetopt sg = new SAGetopt(oldArgs);
 334         String[] longOpts = {"exe=", "core=", "pid="};
 335 
 336         ArrayList<String> newArgs = new ArrayList();
 337         String exe = null;
 338         String pid = null;
 339         String core = null;
 340         String s = null;
 341 
 342         while((s = sg.next(null, longOpts)) != null) {
 343             if (s.equals("exe")) {
 344                 exe = sg.getOptarg();
 345                 continue;
 346             }
 347             if (s.equals("core")) {
 348                 core = sg.getOptarg();
 349                 continue;
 350             }
 351             if (s.equals("pid")) {
 352                 pid = sg.getOptarg();




 353                 continue;
 354             }
 355         }
 356 
 357         buildAttachArgs(newArgs, pid, exe, core);
 358         JSnap.main(newArgs.toArray(new String[newArgs.size()]));
 359     }
 360 
 361     public static void main(String[] args) {
 362         // Provide a help
 363         if (args.length == 0) {
 364             launcherHelp();
 365             return;
 366         }
 367         // No arguments imply help for jstack, jmap, jinfo but launch clhsdb and hsdb
 368         if (args.length == 1 && !args[0].equals("clhsdb") && !args[0].equals("hsdb")) {
 369             toolHelp(args[0]);
 370             return;
 371         }
 372 




  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) {
  96         if (toolName.equals("jstack")) {
  97             return jstackHelp();
  98         }
  99         if (toolName.equals("jinfo")) {
 100             return jinfoHelp();
 101         }
 102         if (toolName.equals("jmap")) {
 103             return jmapHelp();
 104         }
 105         if (toolName.equals("jsnap")) {
 106             return jsnapHelp();
 107         }
 108         if (toolName.equals("hsdb") || toolName.equals("clhsdb")) {
 109             return commonHelp();
 110         }
 111         return launcherHelp();


 314             if (s.equals("pid")) {
 315                 pid = sg.getOptarg();
 316                 continue;
 317             }
 318             if (s.equals("flags")) {
 319                 newArgs.add("-flags");
 320                 continue;
 321             }
 322             if (s.equals("sysprops")) {
 323                 newArgs.add("-sysprops");
 324                 continue;
 325             }
 326         }
 327 
 328         buildAttachArgs(newArgs, pid, exe, core);
 329         JInfo.main(newArgs.toArray(new String[newArgs.size()]));
 330     }
 331 
 332     private static void runJSNAP(String[] oldArgs) {
 333         SAGetopt sg = new SAGetopt(oldArgs);
 334         String[] longOpts = {"exe=", "core=", "pid=", "all"};
 335 
 336         ArrayList<String> newArgs = new ArrayList();
 337         String exe = null;
 338         String pid = null;
 339         String core = null;
 340         String s = null;
 341 
 342         while((s = sg.next(null, longOpts)) != null) {
 343             if (s.equals("exe")) {
 344                 exe = sg.getOptarg();
 345                 continue;
 346             }
 347             if (s.equals("core")) {
 348                 core = sg.getOptarg();
 349                 continue;
 350             }
 351             if (s.equals("pid")) {
 352                 pid = sg.getOptarg();
 353                 continue;
 354             }
 355             if (s.equals("all")) {
 356                 newArgs.add("-a");
 357                 continue;
 358             }
 359         }
 360 
 361         buildAttachArgs(newArgs, pid, exe, core);
 362         JSnap.main(newArgs.toArray(new String[newArgs.size()]));
 363     }
 364 
 365     public static void main(String[] args) {
 366         // Provide a help
 367         if (args.length == 0) {
 368             launcherHelp();
 369             return;
 370         }
 371         // No arguments imply help for jstack, jmap, jinfo but launch clhsdb and hsdb
 372         if (args.length == 1 && !args[0].equals("clhsdb") && !args[0].equals("hsdb")) {
 373             toolHelp(args[0]);
 374             return;
 375         }
 376 


< prev index next >