Linux gcore Timestamp
kgibm 0600027VAP Visits (3056)
Update (May 30, 2013): Note that it is preferable to use IBM Java's capabilities to produce system dumps instead of gcore. See why.
The Linux gcore command (also part of gdb) is a very useful command to create a coredump of a running process without killing the process. This is particularly useful starting with WAS 188.8.131.52 and 184.108.40.206 as a core dump can be read directly by the Memory Analyzer Tool, without running jextract, so that core dumps become as easy to use as PHD heapdumps, while providing much more information.
However, MAT was reporting a null creation time of the dump when I loaded it. Based on a quick investigation of the Linux kernel (see linu
Therefore, I recommend that the timestamp is put in the file name in the IBM system dump file name format. MAT is able to pick up the timestamp from the filename. Here's a quick little shell script that can be used.
#!/bin/sh # This script automates taking a core dump using gcore. # It also updates coredump_filter to maximize core dump contents. # Usage: ./ibmgcore.sh PID [SEQ] [PREFIX] # PID - The process ID. You must have permissions (owner or sudo/root). # SEQ - Optional sequence number. Defaults to 1. # PREFIX - Optional prefix (e.g. directory and file name). Defaults to ./ PID=$1 SEQ=$2 PREFIX=$3 if [ -z "$PREFIX" ]; then PREFIX="./" fi if [ -z "$SEQ" ]; then SEQ=1 fi DT=`date +%Y%m%d.%H%M%S` LOG=
Update (May 30, 2013): Added echo 0x7f to coredump_filter for addi