The SCATRC File
When the tool starts, it checks your home directory for a file named .scatrc. If it finds one, it runs all the commands listed. For example, here’s the author’s .scatrc:
export HISTFILE=.scathist$USER
alias less=more
set -o vi
scatenv human_readable on
alias ibase="base -i"
alias obase="base -o"
scatenv minsize 0x1000000
scatenv dis_synth_only on
scatenv dis_synth_cc on
scatenv dis_br_label on
scatenv stk_switch on
scatenv str_syncq on
scatenv str_data on
scatenv sym_size_full on
scatenv thr_stkdata off
scatenv thr_pri on
scatenv thr_lwp off
scatenv thr_cpu off
scatenv thr_age on
scatenv thr_syscall off
scatenv thr_flags off
scatenv table_whitespace off
scatenv scroll 0
color background light
alias cpuc=cpu | grep "cpu id"
As you can see, the purpose is to initialize Oracle Solaris Crash Analysis Tool with the settings I’m accustomed to using. Given that the tool based on ksh, you can also set ksh environment settings, such as the editing mode, set ksh environment variables for later use, or create command aliases.
SCATENV
In the .scatrc, you see many settings made using the scatenv command which is used to query and change the settings of the environment settings used by the tool. To see the complete list of settings available, simply issue the scatenv command with no options. Since the scatenv settings can be either boolean, a number value, or a
string, the variable type is provided in the command output. Luckily, one can search for applicable settings using the -? option. For example, to find all settings that involve threads, one would use:
CAT(vmcore.0)> scatenv -? threadsFlag Name Current Type Description
Settingdispq_empty on on When displaying dispatch queues, also show
CPUs that have no threads in their dispatch
queues.thr_age on on Show age information when dumping threadsthr_cpu off on Show CPU information when dumping threadsthr_flags off on Show flag information when dumping threadsthr_idle on on Show idle time when dumping threadsthr_lwp off on Show lwp information when dumping threadsthr_pri on on Show priority information when dumping threadsthr_proc on on Show process information when dumping threadsthr_stime off on Show t_stime when dumping threads.thr_stkdata off on Show stack related information when dumpingthr_syscall off on Show syscall information when dumping threadsthr_wchan on on Show wchan information when dumping threads
To set an environment flag, simply enter:
scatenv flag_name setting
where:
- flag_name – the name of the flag in question.
- setting – the value to assign to the flag.