1 #
  2 # Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
  3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4 #
  5 # This code is free software; you can redistribute it and/or modify it
  6 # under the terms of the GNU General Public License version 2 only, as
  7 # published by the Free Software Foundation.
  8 #
  9 # This code is distributed in the hope that it will be useful, but WITHOUT
 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12 # version 2 for more details (a copy is included in the LICENSE file that
 13 # accompanied this code).
 14 #
 15 # You should have received a copy of the GNU General Public License version
 16 # 2 along with this work; if not, write to the Free Software Foundation,
 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18 #
 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20 # or visit www.oracle.com if you need additional information or have any
 21 # questions.
 22 #
 23 
 24 config.execSuffix=
 25 config.getChildren.pattern=%p
 26 config.getChildren.app=pgrep
 27 config.getChildren.args=-P %p
 28 ################################################################################
 29 # process info to gather
 30 ################################################################################
 31 onTimeout=\
 32   native.DevToolsSecurity \
 33   native.vmmap native.heap native.leaks native.spindump \
 34   native.stack native.core
 35 ################################################################################
 36 native.pattern=%p
 37 native.javaOnly=false
 38 native.args=%p
 39 
 40 native.DevToolsSecurity.app=DevToolsSecurity
 41 native.DevToolsSecurity.args=--status
 42 
 43 # spindump requires root privileges
 44 native.spindump.app=sudo
 45 native.spindump.args=spindump %p -stdout
 46 
 47 native.vmmap.app=bash
 48 native.vmmap.delimiter=\0
 49 native.vmmap.args=-c\0DevToolsSecurity --status | grep -q enabled && vmmap %p
 50 
 51 native.leaks.app=bash
 52 native.leaks.delimiter=\0
 53 native.leaks.args=-c\0DevToolsSecurity --status | grep -q enabled && leaks %p
 54 
 55 native.heap.app=bash
 56 native.heap.delimiter=\0
 57 native.heap.args=-c\0DevToolsSecurity --status | grep -q enabled && heap %p
 58 
 59 native.stack.app=bash
 60 native.stack.delimiter=\0
 61 native.stack.params.repeat=6
 62 native.stack.args=-c\0DevToolsSecurity --status | grep -q enabled && lldb -o 'attach %p' -o 'thread backtrace all' -o 'detach' -o 'quit'
 63 
 64 # has to be the last command
 65 native.core.app=bash
 66 # The below trick was found on https://stackoverflow.com/a/41613532
 67 native.core.args=-c\0kill -ABRT %p && lsof -p %p +r 1 &>/dev/null
 68 native.core.delimiter=\0
 69 native.core.timeout=600000
 70 
 71 cores=native.lldb
 72 native.lldb.app=lldb
 73 native.lldb.delimiter=\0
 74 # Assume that java standard laucher has been used
 75 native.lldb.args=--core\0%p\0%java\0-o\0thread backtrace all\0-o\0quit
 76 
 77 ################################################################################
 78 # environment info to gather
 79 ################################################################################
 80 environment=\
 81   users.current users.logged users.last \
 82   disk \
 83   env \
 84   ulimit \
 85   system.dmesg system.sysctl \
 86   process.ps process.top \
 87   memory.vmstat \
 88   files \
 89   net.netstat.anv net.netstat.av net.netstat.aL net.netstat.m net.netstat.s \
 90   net.ifconfig net.hostsfile \
 91   scutil.nwi scutil.proxy \
 92   screenshot
 93 ################################################################################
 94 users.current.app=id
 95 users.current.args=-a
 96 users.logged.app=who
 97 users.logged.args=-a
 98 users.last.app=last
 99 users.last.args=-10
100 
101 disk.app=df
102 disk.args=-h
103 
104 env.app=env
105 
106 ulimit.app=bash
107 ulimit.args=-c\0ulimit -a
108 ulimit.args.delimiter=\0
109 
110 system.dmesg.app=sudo
111 system.dmesg.args=dmesg
112 
113 system.sysctl.app=sysctl
114 system.sysctl.args=-a
115 
116 process.ps.app=ps
117 process.ps.args=-Meo pid,pcpu,cputime,start,pmem,vsz,rss,state,wchan,user,args
118 process.top.app=top
119 process.top.args=-l 1
120 
121 memory.vmstat.app=vm_stat
122 memory.vmstat.args=-c 3 3
123 
124 files.app=lsof
125 
126 net.netstat.app=netstat
127 net.netstat.av.args=-av
128 net.netstat.anv.args=-anv
129 net.netstat.aL.args=-aL
130 net.netstat.m.args=-mm
131 net.netstat.s.args=-s
132 net.ifconfig.app=ifconfig
133 net.ifconfig.args=-a
134 
135 net.hostsfile.app=cat
136 net.hostsfile.args=/etc/hosts
137 
138 scutil.app=scutil
139 scutil.nwi.args=--nwi
140 scutil.proxy.args=--proxy
141 
142 screenshot.app=screencapture
143 screenshot.args=-x screen1.png screen2.png screen3.png screen4.png screen5.png
144 ################################################################################