*this
home about contact feed
projects
vagra vaBlo
categories
C++(7) Solaris(4) tntnet(3) vi(3) Linux(2) DeleGate(2) Postgres(2) proxy(2) cxxtools(1) regex(1) readline(1) dtrace(1) gcc(1) MeeGo(1) ssh(1) firefox(1)

Solaris process tools

Solaris ptools

Solaris has some features, many other systems are missing. One of my favorites is the large number of process tools. While i could write the whole day about ptools, i like to concentrate on my favorites here. Some of them may also be are available on other plattforms.

pldd

pldd acts like ldd but on processes, thus you see which librarys are really loaded by the program. Yes there might are differences to the binaries on the filesystems.

$ pldd 1259
1259:   /home/jw/bin/ncmpc
/usr/lib/libglib-2.0.so.0.2501.0
/lib/libsocket.so.1
/lib/libnsl.so.1
/usr/gnu/lib/libncurses.so.5.7
/usr/lib/libc/libc_hwcap1.so.1

pargs

pargs shows arguments -a and environment variables -e of an running process.

$ pargs -ea 284
284:    /usr/lib/inet/ntpd -p /var/run/ntp.pid -g
argv[0]: /usr/lib/inet/ntpd
argv[1]: -p
argv[2]: /var/run/ntp.pid
argv[3]: -g

envp[0]: _=*213*/usr/lib/inet/ntpd
envp[1]: LANG=en_US.UTF-8
envp[2]: PATH=/usr/sbin:/usr/bin
envp[3]: PWD=/root
envp[4]: SHLVL=1
envp[5]: SMF_FMRI=svc:/network/ntp:default
envp[6]: SMF_METHOD=start
envp[7]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[8]: SMF_ZONENAME=global
envp[9]: TZ=Europe/Berlin
envp[10]: A__z="*SHLVL

pstack

pstack prints a strack trace from an running process.

$ pstack 11717
11717:  ksh
 ceb04875 waitid   (7, 0, 8046f70, f)
 ceaa00a5 waitpid  (ffffffff, 804703c, c, ce99076f) + 65
 ce9907c8 job_reap (0, ce9f7000, 80470a8, ce99287c) + c0
 ce992af7 job_wait (3c82, 806a8a8, 0, 8047130) + 4ab
 ce9c8ae3 sh_exec  (806755c, 4, 0, ce9a0f3d) + 43af
 ce9a10e6 exfile   (ce9f7bb0, ce8d0fa8) + 732
 ce9a0920 sh_main  (1, 8047964, 0, cea5ea42, 4, 0) + 830
 08050bd6 main     (1, 8047964, 804796c, 8050a9f) + 4a
 08050afd _start   (1, 8047a7c, 0, 8061210, 8061230, 8061248) + 7d

plimit

plimit works like ulimit on processes. Remarkable is, that it doesn't only print the limits of an running process, you can also modify the limits without restarting the process.

$ /usr/bin/plimit 11716
11716:  xterm
   resource              current         maximum
  time(seconds)         unlimited       unlimited
  file(blocks)          unlimited       unlimited
  data(kbytes)          unlimited       unlimited
  stack(kbytes)         8480            130336
  coredump(blocks)      unlimited       unlimited
  nofiles(descriptors)  256             65536
  vmemory(kbytes)       unlimited       unlimited

$ /usr/bin/plimit -n 1024 11716

$ /usr/bin/plimit 11716        
11716:  xterm
   resource              current         maximum
  time(seconds)         unlimited       unlimited
  file(blocks)          unlimited       unlimited
  data(kbytes)          unlimited       unlimited
  stack(kbytes)         8480            130336
  coredump(blocks)      unlimited       unlimited
  nofiles(descriptors)  1024            65536
  vmemory(kbytes)       unlimited       unlimited
Write comment