Skip to content

Commit e72bb22

Browse files
committed
Add javathreaddumps.sh
Signed-off-by: Kevin Grigorenko <kevin.grigorenko@us.ibm.com>
1 parent 2db5537 commit e72bb22

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

scripts/javathreaddumps.sh

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/bin/sh
2+
# /*******************************************************************************
3+
# * (c) Copyright IBM Corporation 2022.
4+
# *
5+
# * Licensed under the Apache License, Version 2.0 (the "License");
6+
# * you may not use this file except in compliance with the License.
7+
# * You may obtain a copy of the License at
8+
# *
9+
# * https://www.apache.org/licenses/LICENSE-2.0
10+
# *
11+
# * Unless required by applicable law or agreed to in writing, software
12+
# * distributed under the License is distributed on an "AS IS" BASIS,
13+
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# * See the License for the specific language governing permissions and
15+
# * limitations under the License.
16+
# *******************************************************************************/
17+
#
18+
19+
usage() {
20+
printf "Usage: %s [OPTIONS] [PODNAME]...\n" "$(basename "${0}")"
21+
cat <<"EOF"
22+
-d: DELAY (for run.sh)
23+
-n: No download necessary (for run.sh)
24+
-v: verbose output to stderr
25+
-z: Skip statistics collection (for run.sh)
26+
EOF
27+
exit 2
28+
}
29+
30+
DELAY=""
31+
NODOWNLOAD=""
32+
SKIPSTATS=""
33+
VERBOSE=""
34+
35+
OPTIND=1
36+
while getopts "d:nvz?" opt; do
37+
case "$opt" in
38+
d)
39+
DELAY="-d ${OPTARG}"
40+
;;
41+
h|\?)
42+
usage
43+
;;
44+
n)
45+
NODOWNLOAD="-n"
46+
;;
47+
v)
48+
VERBOSE="-v"
49+
;;
50+
z)
51+
SKIPSTATS="-z"
52+
;;
53+
esac
54+
done
55+
56+
shift $((OPTIND-1))
57+
58+
if [ "${1:-}" = "--" ]; then
59+
shift
60+
fi
61+
62+
if [ "${#}" -eq 0 ]; then
63+
echo "ERROR: Missing PODNAMEs"
64+
usage
65+
fi
66+
67+
PODARGS=""
68+
for ARG in "${@}"; do
69+
PODARGS="${PODARGS} -p ${ARG}"
70+
done
71+
72+
run.sh ${DELAY} ${NODOWNLOAD} ${VERBOSE} ${SKIPSTATS} sh -c "kill -3 $(podinfo.sh ${VERBOSE} -j -p ${@}); podfscp.sh ${VERBOSE} -s ${PODARGS} /output/javacore* ; podfsrm.sh ${VERBOSE} ${PODARGS} /output/javacore*"

0 commit comments

Comments
 (0)