onstat -g cpu: Print runtime statistics

Use the onstat -g cpu command to display information about runtime statistics for each thread that is running in the server.

Figure 1: Syntax:

1  onstat   -g cpu

Example output

Figure 2: onstat -g cpu command output
onstat -g cpu

Thread CPU Info:
tid    name              vp       Last Run           CPU Time     #scheds    status
2      lio vp 0          3lio*   07/18 08:35:35        0.0000          1    IO Idle           
3      pio vp 0          4pio*   07/18 08:35:36        0.0102          2    IO Idle           
4      aio vp 0          5aio*   07/18 08:35:47        0.6876         68    IO Idle           
5      msc vp 0          6msc*   07/18 11:47:24        0.0935         14    IO Idle           
6      main_loop()       1cpu*   07/18 15:02:43        2.9365      23350    sleeping secs: 1  
7      soctcppoll        7soc*   07/18 08:35:40        0.1150          1    running           
8      soctcpio          8soc*   07/18 08:35:40        0.0037          1    running           
9      soctcplst         1cpu*   07/18 11:47:24        0.1106         10    sleeping forever  
10     soctcplst         1cpu*   07/18 08:35:40        0.0103          6    sleeping forever  
11     flush_sub(0)      1cpu*   07/18 15:02:43        0.0403      23252    sleeping secs: 1  
12     flush_sub(1)      1cpu*   07/18 15:02:43        0.0423      23169    sleeping secs: 1  
13     flush_sub(2)      1cpu*   07/18 15:02:43        0.0470      23169    sleeping secs: 1  
14     flush_sub(3)      1cpu*   07/18 15:02:43        0.0407      23169    sleeping secs: 1  
15     flush_sub(4)      1cpu*   07/18 15:02:43        0.0307      23169    sleeping secs: 1  
16     flush_sub(5)      1cpu*   07/18 15:02:43        0.0323      23169    sleeping secs: 1  
17     flush_sub(6)      1cpu*   07/18 15:02:43        0.0299      23169    sleeping secs: 1  
18     flush_sub(7)      1cpu*   07/18 15:02:43        0.0314      23169    sleeping secs: 1  
19     kaio              1cpu*   07/18 14:56:42        1.4560    2375587    IO Idle           
20     aslogflush        1cpu*   07/18 15:02:43        0.0657      23166    sleeping secs: 1  
21     btscanner_0       1cpu*   07/18 15:00:53        0.0484        784    sleeping secs: 61 
37     onmode_mon        1cpu*   07/18 15:02:43        0.3467      23165    sleeping secs: 1  
43     dbScheduler       1cpu*   07/18 14:58:14        1.6613        320    sleeping secs: 31 
44     dbWorker1         1cpu*   07/18 13:48:10        0.4264        399    sleeping forever  
45     dbWorker2         1cpu*   07/18 14:48:11        1.9346       2936    sleeping forever  
94     bf_priosweep()    1cpu*   07/18 15:01:42        0.0431         77    cond wait  bp_cond

Output description

tid
The ID of the thread
name
The name of the thread
vp
The ID of the virtual processor in which the thread is running
Last Run
The timestamp when the thread last ran
CPU Time
The time taken until now by the thread
#scheds
The number of times the thread was scheduled to run
status
The status of the thread. Possible status values are:
  • cond wait
  • IO Idle
  • join wait
  • mutex wait
  • ready
  • sleeping
  • terminated
  • running
  • yield