# TLjvm.cfg: Oracle Java Virtual Machine Input # $Id: TLjvm.cfg,v 1.3 2015/09/25 00:35:35 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/OFM/TLjvm.cfg,v 1.3 2015/09/25 00:35:35 RDA Exp $ # # Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. # # Change history # 20150924 MSC Eliminate trailing spaces. ############################################################################### # Collect Oracle Java Virtual Machine setup information ############################################################################### #------------------------------------------------------------------------------ # Module definition #------------------------------------------------------------------------------ dsc='Collects Oracle Java Virtual Machine input' var=D_JDK exe=sdcl { "macro check_jdk "{if loadCommand(\ " concat(catCommand($arg[0],'bin',${AS.EXE:'java'}),' -version 2>&1')) " {var @lin = getLines() " if match($lin[-1],'^Java\sHotSpot') " {var ${RUN.REQUEST.T_TYPE} = 'hotspot' " var ($ver) = match($lin[1],'build\s(\d+\.\d+)\.') " if compare('VALID',$ver,'1.6') " return 1 " } " elsif match($lin[-1],'^(BEA|Oracle)\sJRockit') " {var ${RUN.REQUEST.T_TYPE} = 'jrockit' " var ($ver) = match($lin[-1],'build\sR(\d+)\.') " if compare('VALID',$ver,'27') " return 1 " } " } " return 0 "} " "macro is_valid_jdk "{var ($nam,$dir) = @arg " require testDir('d',$dir),\ " 'The specified JDK directory does not exist.' " require isAbsolute($dir),\ " 'The specified JDK directory is not an absolute path.' " require check_jdk($dir),\ " 'The specified JDK directory does not contain either HotSpot 1.6 or \ " later / JRockit R27 or later. Without a valid directory, the collection \ " will be disabled.' " var ${AUX.nam} = $nam " return true "} } #------------------------------------------------------------------------------ # Setting definitions #------------------------------------------------------------------------------ [D_JDK] typ=D dft=${ENV.JAVA_HOME} dsc='Java Virtual Machine JDK location' inp='Enter the location of the JDK used for Oracle Java Virtual Machine' nam=- ref=is_valid_jdk('D_JDK',last) val=W var=exists:N_PID [N_PID] typ=M bef="Oracle Java Virtual Machine process identifier to analyze (listing \ from ${F_TMP_SRC}):" dsc='Process identifier of the Oracle Java Virtual Machine process' err="Enter a number from 1 to ${AUX.N_ITEMS}" inp='Enter the item number' itm=[@{T_TMP_ITM}] val=E var=W_MENU,chk_td,chk_fr exe=sdcl { "var @itm = () "var $fil = nvl(testFile('f',catFile(${D_JDK},'bin',${AS.EXE:'jcmd'})),\ " testFile('f',catFile(${D_JDK},'bin',${AS.EXE:'jps'}))) "loop $lin (grepCommand(quote($fil),'^\d+\s')) "{next match($lin,'^\d+\s+(Jps|.*?\.JCmd)') " if match($lin,'^(\d+)\s+(.*)$') " call push(@itm,first,concat(first,' (',second,')')) "} "var ${F_TMP_SRC/T} = $fil "var @{T_TMP_ITM/T} = @itm } [W_MENU] typ=M bef='Diagnostic information:' dsc='Diagnostic information to collect' itm=[TD => 'Thread Dumps Information',\ FR => 'Java Flight Recording Information',\ HD => 'Heap Dumps Information'] pck=true val=E [chk_td] typ=B dft=grep(@{W_MENU},'TD','f') dsc='Check if thread dump is requested' nam=- var=true:N_THREAD_DUMP,N_THREAD_INTERVAL [N_THREAD_DUMP] typ=N dft=2 dsc='Number of thread dumps to capture' err='The number must be a positive integer' inp='Enter the maximum number of thread dumps to capture' ref='I[0,[' val=F [N_THREAD_INTERVAL] typ=N dft=5 dsc='Thread dump interval in seconds' err='The number must be a positive integer' inp='Enter the interval (in seconds) between the thread dumps' ref='I[0,[' val=F [chk_fr] typ=B dft=grep(@{W_MENU},'FR','f') dsc='Check if Java flight recording is requested' nam=- var=true:N_JFR_DURATION [N_JFR_DURATION] typ=N dft=1 dsc='Number of minutes for JFR diagnostics' err='The number of minutes must be a positive integer' inp='Enter the duration time (in minutes) for collecting JFR diagnostics' ref='I[0,[' val=F