• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

03-设备管理命令参考

目录

04-进程监控和维护命令

本章节下载04-进程监控和维护命令(567.60 KB)

04-进程监控和维护命令


1进程监控和维护

1.1 进程监控和维护命令

display memorydisplay processdisplay process cpumonitor processmonitor thread命令既可显示用户态进程的相关信息,又可显示内核线程的相关信息,为简便起见,在这些命令中,统一使用“进程”一词来指代。

1.1.1 display exception context

display exception context命令用来显示用户态进程异常时的上下文信息。

【命令】

displayexception context[countvalue][slotslot-number[cpucpu-number]]

【视图】

任意视图

【缺省用户角色】

network-admin

【参数】

countvalue:表示上下文信息的显示个数,取值范围为1~20,缺省值为1。

slotslot-number:表示主控板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【使用指导】

当用户态进程发生一次异常,系统会生成一个core文件,还会生成一条上下文信息,用于记录异常用户态进程的ID、生成core文件的时间、core文件存放的位置、栈信息和寄存器信息。一个core文件对应一条上下文信息,最多可记录的上下文信息数和可记录的core文件数目相同。

【举例】

# 显示设备上的异常上下文信息。

display exception context

Max coredump files limited in system: 30

Max coredump files limited for one server: 5

Total number of core dump files in system: 1

Index 1 of 1

------------------------------

Crashed slot: 1

Crashed PID: 2916 (macd)

Crash signal: SIGBUS

Crash time: Mon Mar 25 16:31:17 2019

Core file path:

flash:/core/node6144_macd_2916_7_-163117_1553531477.core.xz

Exception Information:

rax 0xfffffffffffffffc -4

rbx 0xffffffff 4294967295

rcx 0x7f2d955c0963 139833756092771

rdx 0x1 1

rsi 0x7ffe19a9c660 140729328977504

rdi 0x9 9

rbp 0x7ffe19a9c660 0x7ffe19a9c660

rsp 0x7ffe19a9c640 0x7ffe19a9c640

r8 0x0 0

r9 0x0 0

r10 0xffffffff 4294967295

r11 0x293 659

r12 0x687140 6844736

r13 0x7ffe19a9c7f8 140729328977912

Traceback (most recent call last):

File "/bin/core_translator", line 318, in

controller.translate()

File "/bin/core_translator", line 274, in translate

self.update()

File "/bin/core_translator", line 249, in update

run_cmd(gdb_cmd)

File "/bin/core_translator", line 77, in run_cmd

data = proc.stdout.readline()

KeyboardInterrupt

表1-1 display exception context命令输出信息描述表

字段

描述

Max coredump files limited in system

设备上可以保存的Core文件总数上限

取值为Unlimit时,表示无限制

Max coredump files limited for one server

(不受SCMD进程管控的)服务可生成的CORE文件上限(受SCMD进程管控的服务可生成的CORE文件上限由porcess core maxcore命令配置决定)

取值为Unlimit时,表示无限制

Total number of core dump files in system

当前设备上的Core文件的总个数

Crashed PID

发生异常的用户态进程ID

Crash signal

导致异常的信号:

·SIGABRT:异常终止(abort)

·SIGBUS:总线错误

·SIGFPE:浮点异常

·SIGILL:程序执行了非法指令,导致异常

·SIGQUIT:终端退出符

·SIGSEGV:无效存储访问

·SIGSYS:无效系统调用

·SIGTRAP:跟踪断点时发生了异常

·SIGXCPU:超过CPU限制(setrlimit)

·SIGXFSZ:超过文件长度限制(setrlimit)

·SIGUNKNOW:未知原因

Crash time

异常发生的时间

Core file path

core文件存放的位置

Backtrace stopped

表示栈信息已经显示完毕

Registers’ content

寄存器的内容

【相关命令】

·reset exception context

1.1.2 display exception filepath

display exception filepath命令用来显示core文件的保存路径。

【命令】

display exception filepath[slotslot-number[cpucpu-number]]

【视图】

任意视图

【缺省用户角色】

network-admin

【参数】

slotslot-number:表示主控板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【举例】

# 显示指定slot上core文件的保存路径。

display exception filepath slot 1

The exception filepath on slot 1 is flash:.

1.1.3 display kernel deadloop

display kernel deadloop命令用来显示内核线程死循环信息。

【命令】

display kernel deadloopshow-number[offset][verbose][slotslot-number[cpucpu-number]]

【视图】

任意视图

【缺省用户角色】

network-admin

【参数】

show-number:需要显示的死循环信息的数目,取值范围为1~10。

offset:需要显示的起始条目距最近条目的偏移,取值范围为0~9。缺省值为0。

verbose:表示显示详细信息。不指定该参数时,显示概要信息。

slotslot-number:表示主控板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【举例】

# 显示最近一条内核线程死循环的概要信息。

display kernel deadloop 1

----------------- Deadloop record 1 -----------------

Description : BUG: soft lockup - CPU#0 stuck for 61! [comsh: 16306]

Recorded at : 2019-05-01 11:16:00.823018

Occurred at : 2019-05-01 11:16:00.823018

Instruction address : 0x4004158c

Thread : comsh (TID: 16306)

Context : thread context

Slot : 1

Cpu : 0

VCPU ID : 0

Kernel module info : module name (mrpnc) module address (0xe332a000)

# 显示最近一条内核线程死循环的详细信息。

display kernel deadloop 1 verbose

----------------- Deadloop record 1 -----------------

Description : BUG: soft lockup - CPU#0 stuck for 61! [comsh: 16306]

Recorded at : 2019-05-01 11:16:00.823018

Occurred at : 2019-05-01 11:16:00.823018

Instruction address : 0x4004158c

Thread : comsh (TID: 16306)

Context : thread context

Slot : 1

Cpu : 0

VCPU ID : 0

Kernel module info : module name (mrpnc) module address (0xe332a000)

Last 5 thread switches : migration/0 (11:16:00.823018)-->

swapper (11:16:00.833018)-->

kthreadd (11:16:00.833518)-->

swapper (11:16:00.833550)-->

disk (11:16:00.833560)

Register content:

Reg: r0, Val = 0x00000000 ; Reg: r1, Val = 0xe2be5ea0 ;

Reg: r2, Val = 0x00000000 ; Reg: r3, Val = 0x77777777 ;

Reg: r4, Val = 0x00000000 ; Reg: r5, Val = 0x00001492 ;

Reg: r6, Val = 0x00000000 ; Reg: r7, Val = 0x0000ffff ;

Reg: r8, Val = 0x77777777 ; Reg: r9, Val = 0x00000000 ;

Reg: r10, Val = 0x00000001 ; Reg: r11, Val = 0x0000002c ;

Reg: r12, Val = 0x057d9484 ; Reg: r13, Val = 0x00000000 ;

Reg: r14, Val = 0x00000000 ; Reg: r15, Val = 0x02000000 ;

Reg: r16, Val = 0xe2be5f00 ; Reg: r17, Val = 0x00000000 ;

Reg: r18, Val = 0x00000000 ; Reg: r19, Val = 0x00000000 ;

Reg: r20, Val = 0x024c10f8 ; Reg: r21, Val = 0x057d9244 ;

Reg: r22, Val = 0x00002000 ; Reg: r23, Val = 0x0000002c ;

Reg: r24, Val = 0x00000002 ; Reg: r25, Val = 0x24000024 ;

Reg: r26, Val = 0x00000000 ; Reg: r27, Val = 0x057d9484 ;

Reg: r28, Val = 0x0000002c ; Reg: r29, Val = 0x00000000 ;

Reg: r30, Val = 0x0000002c ; Reg: r31, Val = 0x00000000 ;

Reg: cr, Val = 0x84000028 ; Reg: nip, Val = 0x057d9550 ;

Reg: xer, Val = 0x00000000 ; Reg: lr, Val = 0x0186eff0 ;

Reg: ctr, Val = 0x682f7344 ; Reg: msr, Val = 0x00784b5c ;

Reg: trap, Val = 0x0000b030 ; Reg: dar, Val = 0x77777777 ;

Reg: dsisr, Val = 0x40000000 ; Reg: result, Val = 0x00020300 ;

Dump stack (total 1024 bytes, 16 bytes/line):

0xe2be5ea0: 02 be 5e c0 24 00 00 24 00 00 00 00 05 7d 94 84

0xe2be5eb0: 00 00 00 04 00 00 00 00 00 00 00 28 05 8d 34 c4

0xe2be5ec0: 02 be 60 a0 01 86 ef f0 00 00 00 00 00 00 00 00

0xe2be5ed0: 02 04 05 b4 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be5ee0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be5ef0: 95 47 73 35 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be5f00: a0 e1 64 21 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be5f10: 00 00 00 00 00 00 00 00 00 00 00 00 01 e9 00 00

0xe2be5f20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be5f30: 00 00 00 00 00 00 00 00 02 be 66 c0 02 be 66 d0

0xe2be5f40: 02 be 61 e0 00 00 00 02 00 00 00 00 02 44 b3 a4

0xe2be5f50: 02 be 5f 90 00 00 00 08 02 be 5f e0 00 00 00 08

0xe2be5f60: 02 be 5f 80 00 ac 1b 14 00 00 00 00 00 00 00 00

0xe2be5f70: 05 b4 5f 90 02 be 5f e0 00 00 00 30 02 be 5f e0

0xe2be5f80: 02 be 5f c0 00 ac 1b f4 00 00 00 00 02 45 00 00

0xe2be5f90: 00 03 00 00 00 00 00 00 02 be 5f e0 00 00 00 30

0xe2be5fa0: 02 be 5f c0 00 ac 1b 14 61 f1 2e ae 02 45 00 00

0xe2be5fb0: 02 44 b3 74 02 be 5f d0 00 00 00 30 02 be 5f e0

0xe2be5fc0: 02 be 60 60 01 74 ff f8 00 00 00 00 00 00 08 00

0xe2be5fd0: 02 be 5f f0 00 e8 93 7e 02 be 5f f8 02 be 5f fc

0xe2be5fe0: 00 00 00 00 00 00 00 00 00 00 00 00 02 be 60 18

0xe2be5ff0: 02 be 60 10 00 e9 65 98 00 00 00 58 00 00 2a 4f

0xe2be6000: 02 be 60 10 00 00 00 00 00 00 00 00 02 be 60 68

0xe2be6010: 02 be 60 40 00 e8 c6 a0 00 00 11 17 00 00 00 00

0xe2be6020: 02 be 60 40 00 00 00 00 00 00 00 00 02 be 60 98

0xe2be6030: 02 27 00 00 00 00 00 00 00 00 00 00 02 be 60 68

0xe2be6040: 02 be 60 60 00 00 00 01 00 00 b0 30 02 be 60 98

0xe2be6050: 00 00 00 04 02 21 00 00 00 00 00 00 01 e9 00 00

0xe2be6060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be6070: 00 00 00 00 00 00 00 00 02 be 66 c0 02 be 66 d0

0xe2be6080: 02 be 61 e0 00 00 00 02 00 00 00 00 02 be 61 70

0xe2be6090: 00 00 00 00 02 21 00 00 05 8d 34 c4 05 7d 92 44

Call trace:

Function Address = 0x8012a4b4

Function Address = 0x8017989c

Function Address = 0x80179b30

Function Address = 0x80127438

Function Address = 0x8012d734

Function Address = 0x80100a00

Function Address = 0xe0071004

Function Address = 0x8016ce0c

Function Address = 0x801223a0

Instruction dump:

41a2fe9c 812300ec 800200ec 7f890000 409efe8c 80010014 540b07b9 40a2fe80

4bfffe6c 80780290 7f64db78 4804ea35 <807f002c> 38800000 38a00080 3863000c

表1-2 display kernel deadloop命令显示信息描述表

字段

描述

Description

发生死循环的内核线程的描述信息,包括死循环内核线程所在的CPU的编号、内核线程连续运行的时间、内核线程的名称和编号

Recorded at

内核线程死循环被记录的时间点,精确到微秒

Occurred at

内核线程发生死循环的时间,精确到微秒

Instruction address

内核线程被检测到发生死循环时对应的指令信息

Thread

发生死循环的内核线程的名称和编号

Context

内核线程被检测到发生死循环时所在的上下文环境

Cpu

运行该内核线程的CPU的编号

VCPU ID

运行该内核线程的CPU核的编号

Kernel module info

内核线程被检测到发生死循环时,系统中已加载的内核模块信息。包括:

·module name表示内核模块名称

·module address内核模块加载的内存地址

Last 5 thread switches

内核线程被检测到发生死循环时,记录死循环发生的CPU上、最近五次的内核线程切换轨迹。包括内核线程的名称和内核线程切换时间点,时间精确到微秒

Register content

内核线程被检测到发生死循环时现场的寄存器信息。Reg表示寄存器名称,Val表示寄存器中保存的值

Dump stack

内核线程被检测到发生死循环时现场的堆栈信息

Call trace

内核线程被检测到发生死循环时现场的函数调用栈信息,即每级调用函数的指令地址

Instruction dump

内核线程被检测到发生死循环时对应的指令码。非法指令用ffffffff表示

No information to display

表示系统中没有内核线程死循环记录

【相关命令】

·reset kernel deadloop

1.1.4 display kernel deadloop configuration

display kernel deadloop configuration命令用来显示内核线程死循环监控参数配置。

【命令】

display kernel deadloop configuration[slotslot-number[cpucpu-number]]

【视图】

任意视图

【缺省用户角色】

network-admin

【参数】

slotslot-number:表示主控板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【举例】

# 显示内核线程死循环监控参数配置。

display kernel deadloop configuration

Thread dead loop detection: Enabled

Dead loop timer (in seconds): 20

Threads excluded from monitoring: 1

TID: 15 Name: co0

表1-3 display kernel deadloop configuration命令显示信息描述表

字段

描述

Thread dead loop detection:

内核线程死循环检测功能处于开启状态,取值为:

·Enabled:表示开启状态

·Disabled:表示关闭状态

Dead loop timer (in seconds):n

内核线程死循环判定周期(单位为秒),即内核线程连续运行时间大于n秒时,则判定为死循环

Threads excluded from monitoring

不进行死循环检测的内核线程列表,配置monitor kernel deadloop exclude-thread命令后才会显示该信息

Name

不进行死循环检测的内核线程的名称

TID

不进行死循环检测的内核线程的编号

No thread is excluded from monitoring

对所有内核线程都进行死循环检查

1.1.5 display kernel exception

display kernel exception命令用来显示内核线程的异常信息。

【命令】

display kernel exceptionshow-number[offset][verbose][slotslot-number[cpucpu-number]]

【视图】

任意视图

【缺省用户角色】

network-admin

【参数】

show-number:需要显示的异常信息的数目,取值范围为1~60。

offset:开始显示的条目距最近条目的偏移,取值范围为0~9。缺省值为0。

verbose:显示详细信息。不指定该参数时,显示概要信息。

slotslot-number:表示主控板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【使用指导】

当内核线程在运行过程中发生异常时,系统会自动记录异常信息,以便设备维护人员定位问题。

【举例】

# 显示最近一条内核线程异常的概要信息。

display kernel exception 1

----------------- Exception record 1 -----------------

Description : Oops[#0]

Recorded at : 2019-05-01 11:16:00.823018

Occurred at : 2019-05-01 11:16:00.823018

Instruction address : 0x4004158c

Thread : comsh (TID: 16306)

Context : thread context

Slot : 1

Cpu : 0

VCPU ID : 0

Kernel module info : module name (mrpnc) module address (0xe332a000)

module name (disk) module address (0xe00bd000)

# 显示最近一条内核线程异常的详细信息。

display kernel exception 1 verbose

----------------- Exception record 1 -----------------

Description : Oops[#0]

Recorded at : 2019-05-01 11:16:00.823018

Occurred at : 2019-05-01 11:16:00.823018

Instruction address : 0x4004158c

Thread : comsh (TID: 16306)

Context : thread context

Slot : 1

Cpu : 0

VCPU ID : 0

Kernel module info : module name (mrpnc) module address (0xe332a000)

module name (12500) module address (0xe00bd000)

Last 5 thread switches : migration/0 (11:16:00.823018)-->

swapper (11:16:00.833018)-->

kthreadd (11:16:00.833518)-->

swapper (11:16:00.833550)-->

disk (11:16:00.833560)

Register content:

Reg: r0, Val = 0x00000000 ; Reg: r1, Val = 0xe2be5ea0 ;

Reg: r2, Val = 0x00000000 ; Reg: r3, Val = 0x77777777 ;

Reg: r4, Val = 0x00000000 ; Reg: r5, Val = 0x00001492 ;

Reg: r6, Val = 0x00000000 ; Reg: r7, Val = 0x0000ffff ;

Reg: r8, Val = 0x77777777 ; Reg: r9, Val = 0x00000000 ;

Reg: r10, Val = 0x00000001 ; Reg: r11, Val = 0x0000002c ;

Reg: r12, Val = 0x057d9484 ; Reg: r13, Val = 0x00000000 ;

Reg: r14, Val = 0x00000000 ; Reg: r15, Val = 0x02000000 ;

Reg: r16, Val = 0xe2be5f00 ; Reg: r17, Val = 0x00000000 ;

Reg: r18, Val = 0x00000000 ; Reg: r19, Val = 0x00000000 ;

Reg: r20, Val = 0x024c10f8 ; Reg: r21, Val = 0x057d9244 ;

Reg: r22, Val = 0x00002000 ; Reg: r23, Val = 0x0000002c ;

Reg: r24, Val = 0x00000002 ; Reg: r25, Val = 0x24000024 ;

Reg: r26, Val = 0x00000000 ; Reg: r27, Val = 0x057d9484 ;

Reg: r28, Val = 0x0000002c ; Reg: r29, Val = 0x00000000 ;

Reg: r30, Val = 0x0000002c ; Reg: r31, Val = 0x00000000 ;

Reg: cr, Val = 0x84000028 ; Reg: nip, Val = 0x057d9550 ;

Reg: xer, Val = 0x00000000 ; Reg: lr, Val = 0x0186eff0 ;

Reg: ctr, Val = 0x682f7344 ; Reg: msr, Val = 0x00784b5c ;

Reg: trap, Val = 0x0000b030 ; Reg: dar, Val = 0x77777777 ;

Reg: dsisr, Val = 0x40000000 ; Reg: result, Val = 0x00020300 ;

Dump stack (total 1024 bytes, 16 bytes/line):

0xe2be5ea0: 02 be 5e c0 24 00 00 24 00 00 00 00 05 7d 94 84

0xe2be5eb0: 00 00 00 04 00 00 00 00 00 00 00 28 05 8d 34 c4

0xe2be5ec0: 02 be 60 a0 01 86 ef f0 00 00 00 00 00 00 00 00

0xe2be5ed0: 02 04 05 b4 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be5ee0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be5ef0: 95 47 73 35 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be5f00: a0 e1 64 21 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be5f10: 00 00 00 00 00 00 00 00 00 00 00 00 01 e9 00 00

0xe2be5f20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be5f30: 00 00 00 00 00 00 00 00 02 be 66 c0 02 be 66 d0

0xe2be5f40: 02 be 61 e0 00 00 00 02 00 00 00 00 02 44 b3 a4

0xe2be5f50: 02 be 5f 90 00 00 00 08 02 be 5f e0 00 00 00 08

0xe2be5f60: 02 be 5f 80 00 ac 1b 14 00 00 00 00 00 00 00 00

0xe2be5f70: 05 b4 5f 90 02 be 5f e0 00 00 00 30 02 be 5f e0

0xe2be5f80: 02 be 5f c0 00 ac 1b f4 00 00 00 00 02 45 00 00

0xe2be5f90: 00 03 00 00 00 00 00 00 02 be 5f e0 00 00 00 30

0xe2be5fa0: 02 be 5f c0 00 ac 1b 14 61 f1 2e ae 02 45 00 00

0xe2be5fb0: 02 44 b3 74 02 be 5f d0 00 00 00 30 02 be 5f e0

0xe2be5fc0: 02 be 60 60 01 74 ff f8 00 00 00 00 00 00 08 00

0xe2be5fd0: 02 be 5f f0 00 e8 93 7e 02 be 5f f8 02 be 5f fc

0xe2be5fe0: 00 00 00 00 00 00 00 00 00 00 00 00 02 be 60 18

0xe2be5ff0: 02 be 60 10 00 e9 65 98 00 00 00 58 00 00 2a 4f

0xe2be6000: 02 be 60 10 00 00 00 00 00 00 00 00 02 be 60 68

0xe2be6010: 02 be 60 40 00 e8 c6 a0 00 00 11 17 00 00 00 00

0xe2be6020: 02 be 60 40 00 00 00 00 00 00 00 00 02 be 60 98

0xe2be6030: 02 27 00 00 00 00 00 00 00 00 00 00 02 be 60 68

0xe2be6040: 02 be 60 60 00 00 00 01 00 00 b0 30 02 be 60 98

0xe2be6050: 00 00 00 04 02 21 00 00 00 00 00 00 01 e9 00 00

0xe2be6060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be6070: 00 00 00 00 00 00 00 00 02 be 66 c0 02 be 66 d0

0xe2be6080: 02 be 61 e0 00 00 00 02 00 00 00 00 02 be 61 70

0xe2be6090: 00 00 00 00 02 21 00 00 05 8d 34 c4 05 7d 92 44

Call trace:

Function Address = 0x8012a4b4

Function Address = 0x8017989c

Function Address = 0x80179b30

Function Address = 0x80127438

Function Address = 0x8012d734

Function Address = 0x80100a00

Function Address = 0xe0071004

Function Address = 0x8016ce0c

Function Address = 0x801223a0

Instruction dump:

41a2fe9c 812300ec 800200ec 7f890000 409efe8c 80010014 540b07b9 40a2fe80

4bfffe6c 80780290 7f64db78 4804ea35 <807f002c> 38800000 38a00080 3863000c

本命令显示信息的详细描述请参见表1-4

【相关命令】

·reset kernel exception

1.1.6 display kernel reboot

display kernel reboot命令用来显示单板的重启信息。

【命令】

display kernel rebootshow-number[offset][verbose][slotslot-number[cpucpu-number]]

【视图】

任意视图

【缺省用户角色】

network-admin

【参数】

show-number:需要显示的重启信息的数目,取值范围为1~10。

offset:需要显示的起始条目距最近条目的偏移,取值范围为0~9。缺省值为0。

verbose:表示显示详细信息。不指定该参数时,显示概要信息。

slotslot-number:表示主控板所在的槽位号。不指定该参数时,表示主用主控板。单板的重启信息会记录在设备当前主用主控板的内存中,主控板掉电后会删除该信息。

cpucpu-number:表示CPU的编号。

【举例】

# 显示最近一条重启概要信息。

display kernel reboot 1

----------------- Reboot record 1 -----------------

Recorded at : 2019-05-01 11:16:00.823018

Occurred at : 2019-05-01 11:16:00.823018

Reason : 0x31

Thread : comsh (TID: 16306)

Context : thread context

Slot : 1

Target Slot : 0

Cpu : 0

VCPU ID : 0

Kernel module info : module name (mrpnc) module address (0xe332a000)

module name (12500) module address (0xe00bd000)

# 显示最近一条重启详细信息。

display kernel reboot 1 verbose

----------------- Reboot record 1 -----------------

Recorded at : 2019-05-01 11:16:00.823018

Occurred at : 2019-05-01 11:16:00.823018

Reason : 0x31

Thread : comsh (TID: 16306)

Context : thread context

Slot : 1

Target Slot : 0

Cpu : 0

VCPU ID : 0

Kernel module info : module name (mrpnc) module address (0xe332a000)

module name (12500) module address (0xe00bd000)

Last 5 thread switches : migration/0 (11:16:00.823018)-->

swapper (11:16:00.833018)-->

kthreadd (11:16:00.833518)-->

swapper (11:16:00.833550)-->

disk (11:16:00.833560)

Dump stack (total 1024 bytes, 16 bytes/line):

0xe2be5ea0: 02 be 5e c0 24 00 00 24 00 00 00 00 05 7d 94 84

0xe2be5eb0: 00 00 00 04 00 00 00 00 00 00 00 28 05 8d 34 c4

0xe2be5ec0: 02 be 60 a0 01 86 ef f0 00 00 00 00 00 00 00 00

0xe2be5ed0: 02 04 05 b4 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be5ee0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be5ef0: 95 47 73 35 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be5f00: a0 e1 64 21 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be5f10: 00 00 00 00 00 00 00 00 00 00 00 00 01 e9 00 00

0xe2be5f20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be5f30: 00 00 00 00 00 00 00 00 02 be 66 c0 02 be 66 d0

0xe2be5f40: 02 be 61 e0 00 00 00 02 00 00 00 00 02 44 b3 a4

0xe2be5f50: 02 be 5f 90 00 00 00 08 02 be 5f e0 00 00 00 08

0xe2be5f60: 02 be 5f 80 00 ac 1b 14 00 00 00 00 00 00 00 00

0xe2be5f70: 05 b4 5f 90 02 be 5f e0 00 00 00 30 02 be 5f e0

0xe2be5f80: 02 be 5f c0 00 ac 1b f4 00 00 00 00 02 45 00 00

0xe2be5f90: 00 03 00 00 00 00 00 00 02 be 5f e0 00 00 00 30

0xe2be5fa0: 02 be 5f c0 00 ac 1b 14 61 f1 2e ae 02 45 00 00

0xe2be5fb0: 02 44 b3 74 02 be 5f d0 00 00 00 30 02 be 5f e0

0xe2be5fc0: 02 be 60 60 01 74 ff f8 00 00 00 00 00 00 08 00

0xe2be5fd0: 02 be 5f f0 00 e8 93 7e 02 be 5f f8 02 be 5f fc

0xe2be5fe0: 00 00 00 00 00 00 00 00 00 00 00 00 02 be 60 18

0xe2be5ff0: 02 be 60 10 00 e9 65 98 00 00 00 58 00 00 2a 4f

0xe2be6000: 02 be 60 10 00 00 00 00 00 00 00 00 02 be 60 68

0xe2be6010: 02 be 60 40 00 e8 c6 a0 00 00 11 17 00 00 00 00

0xe2be6020: 02 be 60 40 00 00 00 00 00 00 00 00 02 be 60 98

0xe2be6030: 02 27 00 00 00 00 00 00 00 00 00 00 02 be 60 68

0xe2be6040: 02 be 60 60 00 00 00 01 00 00 b0 30 02 be 60 98

0xe2be6050: 00 00 00 04 02 21 00 00 00 00 00 00 01 e9 00 00

0xe2be6060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be6070: 00 00 00 00 00 00 00 00 02 be 66 c0 02 be 66 d0

0xe2be6080: 02 be 61 e0 00 00 00 02 00 00 00 00 02 be 61 70

0xe2be6090: 00 00 00 00 02 21 00 00 05 8d 34 c4 05 7d 92 44

Call trace:

Function Address = 0x8012a4b4

Function Address = 0x8017989c

Function Address = 0x80179b30

Function Address = 0x80127438

Function Address = 0x8012d734

Function Address = 0x80100a00

Function Address = 0xe0071004

Function Address = 0x8016ce0c

Function Address = 0x801223a0

表1-4 display kernel reboot命令显示信息描述表

字段

描述

Recorded at

重启被记录的时间点,精确到微秒

Occurred at

重启的时间,精确到微秒

Reason

重启的原因

Thread

重启时运行的内核线程的名称和编号

Context

重启时所在的上下文环境

Slot

触发重启事件的Slot的编号

Target Slot

实际发生重启的Slot的编号

Cpu

触发重启事件的CPU的编号

VCPU ID

触发重启事件的CPU核的编号

Kernel module info

重启发生时,系统中已加载的内核模块信息。包括内核模块名和内核模块加载的内存地址

Last 5 thread switches

重启时,记录重启的CPU上、最近五次的内核线程切换轨迹。包括内核线程的名称和内核线程切换时间点,时间精确到微秒

Dump stack

重启时,运行线程的堆栈信息

Call trace

重启时,运行线程的函数调用栈信息

No information to display

表示系统中没有重启记录

【相关命令】

·reset kernel reboot

1.1.7 display kernel starvation

display kernel starvation命令用来显示内核线程饿死信息。

【命令】

display kernel starvationshow-number[offset][verbose][slotslot-number[cpucpu-number]]

【视图】

任意视图

【缺省用户角色】

network-admin

【参数】

show-number:需要显示的饿死信息的数目,取值范围为1~10。

offset:需要显示的起始条目距最近条目的偏移,取值范围为0~9。缺省值为0。

verbose:表示显示详细信息。不指定该参数时,显示概要信息。

slotslot-number:表示主控板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【举例】

# 显示最近一条内核线程饿死的概要信息。

display kernel starvation 1

----------------- Starvation record 1 -----------------

Description : INFO: task comsh: 16306 blocked for more than 10 seconds.

Recorded at : 2019-05-01 11:16:00.823018

Occurred at : 2019-05-01 11:16:00.823018

Instruction address : 0x4004158c

Thread : comsh (TID: 16306)

Context : thread context

Slot : 1

Cpu : 0

VCPU ID : 0

Kernel module info : module name (mrpnc) module address (0xe332a000)

module name (12500) module address (0xe00bd000)

# 显示最近一条内核线程饿死的详细信息。

display kernel starvation 1 verbose

----------------- Starvation record 1 -----------------

Description : INFO: task comsh: 16306 blocked for more than 10 seconds.

Recorded at : 2019-05-01 11:16:00.823018

Occurred at : 2019-05-01 11:16:00.823018

Instruction address : 0x4004158c

Thread : comsh (TID: 16306)

Context : thread context

Slot : 1

Cpu : 0

VCPU ID : 0

Kernel module info : module name (mrpnc) module address (0xe332a000)

module name (12500) module address (0xe00bd000)

Last 5 thread switches : migration/0 (11:16:00.823018)-->

swapper (11:16:00.833018)-->

kthreadd (11:16:00.833518)-->

swapper (11:16:00.833550)-->

disk (11:16:00.833560)

Register content:

Reg: r0, Val = 0x00000000 ; Reg: r1, Val = 0xe2be5ea0 ;

Reg: r2, Val = 0x00000000 ; Reg: r3, Val = 0x77777777 ;

Reg: r4, Val = 0x00000000 ; Reg: r5, Val = 0x00001492 ;

Reg: r6, Val = 0x00000000 ; Reg: r7, Val = 0x0000ffff ;

Reg: r8, Val = 0x77777777 ; Reg: r9, Val = 0x00000000 ;

Reg: r10, Val = 0x00000001 ; Reg: r11, Val = 0x0000002c ;

Reg: r12, Val = 0x057d9484 ; Reg: r13, Val = 0x00000000 ;

Reg: r14, Val = 0x00000000 ; Reg: r15, Val = 0x02000000 ;

Reg: r16, Val = 0xe2be5f00 ; Reg: r17, Val = 0x00000000 ;

Reg: r18, Val = 0x00000000 ; Reg: r19, Val = 0x00000000 ;

Reg: r20, Val = 0x024c10f8 ; Reg: r21, Val = 0x057d9244 ;

Reg: r22, Val = 0x00002000 ; Reg: r23, Val = 0x0000002c ;

Reg: r24, Val = 0x00000002 ; Reg: r25, Val = 0x24000024 ;

Reg: r26, Val = 0x00000000 ; Reg: r27, Val = 0x057d9484 ;

Reg: r28, Val = 0x0000002c ; Reg: r29, Val = 0x00000000 ;

Reg: r30, Val = 0x0000002c ; Reg: r31, Val = 0x00000000 ;

Reg: cr, Val = 0x84000028 ; Reg: nip, Val = 0x057d9550 ;

Reg: xer, Val = 0x00000000 ; Reg: lr, Val = 0x0186eff0 ;

Reg: ctr, Val = 0x682f7344 ; Reg: msr, Val = 0x00784b5c ;

Reg: trap, Val = 0x0000b030 ; Reg: dar, Val = 0x77777777 ;

Reg: dsisr, Val = 0x40000000 ; Reg: result, Val = 0x00020300 ;

Dump stack (total 1024 bytes, 16 bytes/line):

0xe2be5ea0: 02 be 5e c0 24 00 00 24 00 00 00 00 05 7d 94 84

0xe2be5eb0: 00 00 00 04 00 00 00 00 00 00 00 28 05 8d 34 c4

0xe2be5ec0: 02 be 60 a0 01 86 ef f0 00 00 00 00 00 00 00 00

0xe2be5ed0: 02 04 05 b4 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be5ee0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be5ef0: 95 47 73 35 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be5f00: a0 e1 64 21 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be5f10: 00 00 00 00 00 00 00 00 00 00 00 00 01 e9 00 00

0xe2be5f20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be5f30: 00 00 00 00 00 00 00 00 02 be 66 c0 02 be 66 d0

0xe2be5f40: 02 be 61 e0 00 00 00 02 00 00 00 00 02 44 b3 a4

0xe2be5f50: 02 be 5f 90 00 00 00 08 02 be 5f e0 00 00 00 08

0xe2be5f60: 02 be 5f 80 00 ac 1b 14 00 00 00 00 00 00 00 00

0xe2be5f70: 05 b4 5f 90 02 be 5f e0 00 00 00 30 02 be 5f e0

0xe2be5f80: 02 be 5f c0 00 ac 1b f4 00 00 00 00 02 45 00 00

0xe2be5f90: 00 03 00 00 00 00 00 00 02 be 5f e0 00 00 00 30

0xe2be5fa0: 02 be 5f c0 00 ac 1b 14 61 f1 2e ae 02 45 00 00

0xe2be5fb0: 02 44 b3 74 02 be 5f d0 00 00 00 30 02 be 5f e0

0xe2be5fc0: 02 be 60 60 01 74 ff f8 00 00 00 00 00 00 08 00

0xe2be5fd0: 02 be 5f f0 00 e8 93 7e 02 be 5f f8 02 be 5f fc

0xe2be5fe0: 00 00 00 00 00 00 00 00 00 00 00 00 02 be 60 18

0xe2be5ff0: 02 be 60 10 00 e9 65 98 00 00 00 58 00 00 2a 4f

0xe2be6000: 02 be 60 10 00 00 00 00 00 00 00 00 02 be 60 68

0xe2be6010: 02 be 60 40 00 e8 c6 a0 00 00 11 17 00 00 00 00

0xe2be6020: 02 be 60 40 00 00 00 00 00 00 00 00 02 be 60 98

0xe2be6030: 02 27 00 00 00 00 00 00 00 00 00 00 02 be 60 68

0xe2be6040: 02 be 60 60 00 00 00 01 00 00 b0 30 02 be 60 98

0xe2be6050: 00 00 00 04 02 21 00 00 00 00 00 00 01 e9 00 00

0xe2be6060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0xe2be6070: 00 00 00 00 00 00 00 00 02 be 66 c0 02 be 66 d0

0xe2be6080: 02 be 61 e0 00 00 00 02 00 00 00 00 02 be 61 70

0xe2be6090: 00 00 00 00 02 21 00 00 05 8d 34 c4 05 7d 92 44

Call trace:

Function Address = 0x8012a4b4

Function Address = 0x8017989c

Function Address = 0x80179b30

Function Address = 0x80127438

Function Address = 0x8012d734

Function Address = 0x80100a00

Function Address = 0xe0071004

Function Address = 0x8016ce0c

Function Address = 0x801223a0

Instruction dump:

41a2fe9c 812300ec 800200ec 7f890000 409efe8c 80010014 540b07b9 40a2fe80

4bfffe6c 80780290 7f64db78 4804ea35 <807f002c> 38800000 38a00080 3863000c

本命令显示信息的详细描述请参见表1-4

【相关命令】

·reset kernel starvation

1.1.8 display kernel starvation configuration

display kernel starvation configuration命令用来显示内核线程的饿死监控参数的配置。

【命令】

display kernel starvation configuration[slotslot-number[cpucpu-number]]

【视图】

任意视图

【缺省用户角色】

network-admin

【参数】

slotslot-number:表示单板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【举例】

# 显示内核线程饿死监控参数配置。

display kernel starvation configuration

Thread starvation detection: Disabled

Starvation timer (in seconds): 10

Threads excluded from monitoring: 1

TID: 123 Name: co0

表1-5 display kernel starvation configuration命令显示信息描述表

字段

描述

Thread starvation detection: Enabled

内核线程饿死检测功能处于开启状态

Thread starvation detection: Disabled

内核线程饿死检测功能处于关闭状态

Starvation timer (in seconds):n

内核线程饿死判定周期(单位为秒)。即如果内核线程在n秒内一直不能运行,则判定为饿死

Threads excluded from monitoring

不进行饿死检测的内核线程列表

Name

不进行饿死检测的内核线程的名称

TID

不进行饿死检测的内核线程的编号

【相关命令】

·monitor kernel starvation enable

·monitor kernel starvation exclude-thread

·monitor kernel starvation time

1.1.9 display process

displayprocess命令用来显示进程的状态信息。

【命令】

displayprocess[all|jobjob-id|nameprocess-name][slotslot-number[cpucpu-number]]

【视图】

任意视图

【缺省用户角色】

network-admin

network-operator

【参数】

all:显示所有进程的状态信息。指定all参数和不指定任何可选参数时,命令行的执行效果相同。

jobjob-id:任务编号,用于唯一标识一个进程,该编号不会随着进程的重启而改变,取值范围为1~2147483647。

nameprocess-name:进程名称,为1~15个字符的字符串,不区分大小写,不能包含问号和空格。

slotslot-number:表示单板所在的槽位号,不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【举例】

# 显示进程scmd的状态信息。

display process name scmd

Job ID: 1

PID: 1

Parent JID: 0

Parent PID: 0

Executable path: /sbin/scmd

Instance: 0

Respawn: OFF

Respawn count: 1

Max. spawns per minute: 0

Last started: Wed Jun 1 14:45:46 2019

Process state: sleeping

Max. core: 0

ARGS: -

TID LAST_CPU Stack PRI State HH:MM:SS:MSEC Name

1 0 0K 120 S 0:0:5:220 scmd

表1-6 display process name命令显示信息描述表

字段

描述

Job ID

任务编号,用于唯一标识一个进程,该编号不会随着进程的重启而改变

PID

进程编号,用于标识一个进程,但该编号可能会随着进程的重启而改变

Parent JID

父进程的任务编号

Parent PID

父进程的进程编号

Executable path

进程执行路径(内核线程执行路径显示为“-”)

Instance

进程的实例号(一个进程根据需要在软件实现时决定了它是否会运行多个实例)

Respawn

运行出错时,该进程是否会自动重启:

·ON表示自动重启

·OFF表示不自动重启

Respawn count

进程重启的次数(初始值为1)

Max. spawns per minute

进程一分钟内允许异常重启的最大次数(如果进程在一分钟内异常重启次数超过该值,则系统会自动关闭该进程)

Last started

进程最近一次启动的日期和时间

Process state

进程状态,可能的取值为:

·running:运行状态或正在队列中等待调度

·sleeping:可中断睡眠状态

·traced or stopped:暂停状态

·uninterruptible sleep:不可中断睡眠状态

·zombie:僵死状态(僵死状态指的是进程已经退出,但是仍然占用部分资源的状态)

Max. core

进程最多可以生成的core文件的数量,如果为0表示不生成core文件(进程异常重启一次,会产生一个core文件。如果生成的core文件的数目达到最大值,则不再生成core文件。软件开发和维护人员能够根据core文件的内容来定位异常的原因和异常的位置)

ARGS

进程启动时携带的参数。如果进程不带参数,显示为“-”

TID

线程编号

LAST_CPU

进程最近一次被调度时,所在的CPU

Stack

堆栈大小

PRI

线程优先级

State

线程状态,可能的取值为:

·R:running,运行状态或正在队列中等待调度

·S:sleeping,可中断睡眠状态

·T:traced or stopped,暂停状态

·D:uninterruptible sleep,不可中断睡眠状态

·Z:zombie,僵死状态

HH:MM:SS:MSEC

进程最近一次启动后的运行时间

Name

进程名称

# 显示所有进程的状态信息。

display process all

JID PID %CPU %MEM STAT PRI TTY HH:MM:SS COMMAND

1 1 0.0 0.0 S 120 - 00:00:04 scmd

2 2 0.0 0.0 S 115 - 00:00:00 [kthreadd]

3 3 0.0 0.0 S 99 - 00:00:00 [migration/0]

4 4 0.0 0.0 S 115 - 00:00:05 [ksoftirqd/0]

5 5 0.0 0.0 S 99 - 00:00:00 [watchdog/0]

6 6 0.0 0.0 S 115 - 00:00:00 [events/0]

7 7 0.0 0.0 S 115 - 00:00:00 [khelper]

8 8 0.0 0.0 S 115 - 00:00:00 [kblockd/0]

9 9 0.0 0.0 S 115 - 00:00:00 [ata/0]

10 10 0.0 0.0 S 115 - 00:00:00 [ata_aux]

11 11 0.0 0.0 S 115 - 00:00:00 [kseriod]

12 12 0.0 0.0 S 120 - 00:00:00 [vzmond]

13 13 0.0 0.0 S 120 - 00:00:00 [pdflush]

14 14 0.0 0.0 S 120 - 00:00:00 [pdflush]

15 15 0.0 0.0 S 115 - 00:00:00 [kswapd0]

16 16 0.0 0.0 S 115 - 00:00:00 [aio/0]

17 17 0.0 0.0 S 115 - 00:00:00 [scsi_eh_0]

18 18 0.0 0.0 S 115 - 00:00:00 [scsi_eh_1]

19 19 0.0 0.0 S 115 - 00:00:00 [scsi_eh_2]

35 35 0.0 0.0 D 100 - 00:00:00 [lipc_topology]

---- More ----

表1-7 display process all命令显示信息描述

字段

描述

JID

任务编号,用于唯一标识一个进程,该编号不会随着进程的重启而改变

PID

进程编号

%CPU

进程占设备的总CPU的比率(不支持容器的设备)

进程占进程所在容器的总CPU的比率(支持容器的设备)

%MEM

进程占设备的总内存的比率(不支持容器的设备)

进程占进程所在容器的总内存的比率(支持容器的设备)

STAT

进程状态,可能的取值为:

·R:running,运行状态或处于运行队列

·S:sleeping,可中断睡眠状态

·T:traced or stopped,暂停状态

·D:uninterruptible sleep,不可中断睡眠状态

·Z:zombie,僵死状态

PRI

进程优先级(优先级在进程调度时发挥作用,优先级高的会优先得到调度)

TTY

进程使用的终端

HH:MM:SS

进程最近一次启动后的运行时间。当进程的持续运行时间大于或等于100小时时,该列仅显示小时数,不再显示分和秒

COMMAND

进程名称以及进程运行的参数(如果进程名称带有“[]”标记,则表示内核线程)

1.1.10 display process cpu

displayprocess cpu命令用来显示所有进程的CPU使用率信息。

【命令】

displayprocesscpu[slotslot-number[cpucpu-number]]

【视图】

任意视图

【缺省用户角色】

network-admin

network-operator

【参数】

slotslot-number:表示单板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【举例】

# 显示所有进程CPU使用率信息。

display process cpu

CPU utilization in 5 secs: 16.8%; 1 min: 4.7%; 5 mins: 4.7%

JID 5Sec 1Min 5Min Name

1 0.0% 0.0% 0.0% scmd

2 0.0% 0.0% 0.0% [kthreadd]

3 0.1% 0.0% 0.0% [ksoftirqd/0]

...

表1-8 display process cpu命令显示信息描述表

字段

描述

CPU utilization in 5 secs: 16.8%; 1 min: 4.7%; 5 mins: 4.7%

系统最近5秒CPU使用率;最近1分钟CPU使用率;最近5分钟CPU使用率

JID

任务编号(用于唯一标识一个进程,该编号不会随着进程的重启而改变)

5Sec

最近5秒钟内进程的CPU使用率

1Min

最近1分钟内进程的CPU使用率

5Min

最近5分钟内进程的CPU使用率

Name

进程名称(如果进程名称带有“[ ]”标记,则表示该进程为内核线程)

1.1.11 display process log

displayprocess log命令用来显示所有用户态进程的日志信息。

【命令】

displayprocesslog[slotslot-number[cpucpu-number]]

【视图】

任意视图

【缺省用户角色】

network-admin

network-operator

【参数】

slotslot-number:表示单板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【举例】

# 显示所有用户态进程的日志信息。

display process log

Process JobID PID Abort Core Exit Kill StartTime EndTime

knotify 92 92 N N 0 36 12-17 07:10:27 12-17 07:10:27

knotify 93 93 N N 0 -- 12-17 07:10:27 12-17 07:10:27

automount 94 94 N N 0 -- 12-17 07:10:27 12-17 07:10:28

knotify 111 111 N N 0 -- 12-17 07:10:28 12-17 07:10:28

comsh 121 121 N N 0 -- 12-17 07:10:30 12-17 07:10:30

knotify 152 152 N N 0 -- 12-17 07:10:31 12-17 07:10:31

autocfgd 155 155 N N 0 -- 12-17 07:10:31 12-17 07:10:31

pkg_update 122 122 N N 0 -- 12-17 07:10:30 12-17 07:10:31

表1-9 display process log命令显示信息描述表

字段

描述

Process

用户态进程名

JobID

用户态进程任务编号

PID

用户态进程编号

Abort

是否异常退出:

·Y表示异常退出

·N表示正常退出

Core

是否产生core文件

·Y表示产生

·N表示未产生

Exit

进程退出码,取值为:

·数字表示进程退出码

·--表示无退出码,进程被信号关闭

Kill

关闭进程的信号,取值为:

·数字表示关闭进程的信号的数值

·--表示没有关闭信号,进程主动退出,并非被信号关闭

StartTime

用户态进程创建时间

EndTime

用户态进程结束时间

1.1.12 display process memory

displayprocess memory命令用来显示所有用户态进程的代码段、数据段以及堆栈等的内存使用信息。

【命令】

displayprocessmemory[slotslot-number[cpucpu-number]]

【视图】

任意视图

【缺省用户角色】

network-admin

network-operator

【参数】

slotslot-number:表示单板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【使用指导】

用户态进程启动时,会向系统申请Text、Data、Stack和Dynamic类型的内存:

·Text类型的内存用来存放用户态进程的代码。

·Data类型的内存用来存放用户态进程的数据。

·Stack内存指的是栈内存,一般存放临时数据。

·Dynamic类型的内存指的是堆内存(heap),由系统根据用户态进程运行需要进行动态分配(malloc)和释放(free),可使用display process memory heap命令显示Dynamic类型内存的详细信息。

【举例】

# 显示所有用户态进程的内存使用信息。

display process memory

JID Text Data Stack Dynamic Name

1 384 1800 16 36 scmd

2 0 0 0 0 [kthreadd]

3 0 0 0 0 [ksoftirqd/0]

4 0 0 0 0 [watchdog/0]

5 0 0 0 0 [events/0]

6 0 0 0 0 [khelper]

29 0 0 0 0 [kblockd/0]

49 0 0 0 0 [vzmond]

52 0 0 0 0 [pdflush]

---- More ----

表1-10 display process memory命令显示信息描述表

字段

描述

JID

任务编号。用于唯一标识一个用户态进程,该编号不会随着用户态进程的重启而改变

Text

用户态进程占用的代码段大小,单位为KB(内核线程该项大小为0)

Data

用户态进程占用的数据段大小,单位为KB(内核线程该项大小为0)

Stack

用户态进程占用的堆栈大小,单位为KB(内核线程该项大小为0)

Dynamic

用户态进程动态申请内存大小,单位为KB(内核线程该项大小为0)

Name

用户态进程名称(如果用户态进程名称带有“[ ]”标记,则表示该进程为内核线程)

【相关命令】

·display process memory heap

·display process memory heap address

·display process memory heap size

1.1.13 display process memory fragment free

display process memory fragment free命令用来显示用户态进程的空闲内存分片的信息。

【命令】

display process memory fragment freejobjob-id[slotslot-number[cpucpu-number]]

【视图】

任意视图

【缺省用户角色】

network-admin

network-operator

【参数】

jobjob-id:任务编号,用于唯一标识一个进程,该编号不会随着进程的重启而改变,取值范围为1~2147483647。

slotslot-number:指定单板。slot-number为单板所在的槽位号。如果不指定本参数,则表示指定主用主控板。

cpucpu-number:表示CPU的编号。

【使用指导】

用户态进程运行时,会向系统申请内存,这块内存作为一个整体被申请和释放,就算在进程运行过程中,部分内存块已经被使用过且不再需要使用,也不能提前释放给系统使用,这种空闲但当前不能被使用的内存块也称为内存碎片。

使用本命令可查看大于32Kbytes的内存碎片的起始地址以及大小,方便管理员定位内存不足等问题。

【举例】

# 显示用户态进程job 1的空闲内存分片的信息。

display processmemory fragment free job 1

Free block greater than or equal to 32KB in the main arena:

Address 0x7f2f0f2bd950 size 32kbytes

Free block greater than or equal to 32KB in A1 arena:

Address 0x7f2f0f4bd980 size 34kbytes

the back chunk is :Address 0x7f2f0f4bd990 size 416 Tag 0

the front chunk is :Address 0x7f2f0f4bd970 size 160 Tag 0

表1-11 display process memory fragment free命令显示信息描述表

字段

描述

Free block greater than or equal to 32KB in the main arena:

内存主分配区的、大于或等于32KB的空闲内存分片的起始地址和内存分片的大小,单位为字节

一个进程只有一个主分配区,其余为非主分配区

Free block greater than or equal to 32KB in A1 arena

内存非主分配区的、大于或等于32KB的空闲内存分片的起始地址和内存分片的大小

Found no free block greater than or equal to 32KB.

分配区内未找到大于或等于32KB的空闲内存分片

the back chunk is :Address 0x7f2f0f4bd990 size 416 Tag 0

大于或等于32KB的空闲内存分片之后的chunk的信息

the front chunk is :Address 0x7f2f0f4bd970 size 160 Tag 0

大于或等于32KB的空闲内存分片之前的chunk的信息

【相关命令】

·display process memory fragment used

1.1.14 display process memory fragment used

display process memory fragment used命令用来显示用户态进程已使用的内存分片信息。

【命令】

display process memory fragment usedused-blockjobjob-id[slotslot-number[cpucpu-number]]

【视图】

任意视图

【缺省用户角色】

network-admin

network-operator

【参数】

used-block:进程已使用的内存分片个数,取值范围为1~102400。

jobjob-id:任务编号,用于唯一标识一个用户态进程,该编号不会随着用户态进程的重启而改变,取值范围为1~2147483647

slotslot-number:指定单板。slot-number为单板所在的槽位号。如果不指定本参数,则表示指定主用主控板。

cpucpu-number:表示CPU的编号。

【举例】

# 显示用户态进程job 100已使用的内存分片信息。

display process memory fragment used 1 job 100

Main arena:

Top Chunk:

Address 0x88e9468 size 7064

Neighboring 84 chunks used:

Address 0x88e941c size 80

Address 0x88e93cc size 80

Address 0x88e93ac size 32

Address 0x88e935c size 80

Address 0x88e930c size 80

Address 0x88e92ec size 32

Address 0x88e929c size 80

Address 0x88e924c size 80

Address 0x88e91fc size 80

Address 0x88e91dc size 32

Address 0x88e918c size 80

Address 0x88e913c size 80

Address 0x88e90ec size 80

Address 0x88e909c size 80

Address 0x88e904c size 80

Address 0x88e8ffc size 80

Address 0x88e8fac size 80

Address 0x88e8f8c size 32

Address 0x88e8f3c size 80

---- More ----

表1-12 display process memory fragment used 命令显示信息描述表

字段

描述

XX arena

分配区,XX取值为Main、A1、A2等。其中Main表示主分配区(只有一个主分配区,其余均为非主分配区),A1、A2表示非主分配区

Top chunk

Top内存分片的地址和大小

Neighboring 1 chunks used :

Address0x7f2f8f2bd550 size 48 *

与Top内存分片相邻的xx个已使用的内存分片

在32位设备上,*号用于标识小于80字节的内存;在64位设备上,*号用于标识小于160字节的内存

【相关命令】

·display process memory fragment free

1.1.15 display process memory heap

display process memory heap命令用来显示指定用户态进程的堆内存统计信息。

【命令】

display process memory heap jobjob-id[tag[tag-id] |verbose][slotslot-number[cpucpu-number]]

【视图】

任意视图

【缺省用户角色】

network-admin

network-operator

【参数】

jobjob-id:任务编号,用于唯一标识一个用户态进程,该编号不会随着用户态进程的重启而改变。取值范围为1~2147483647。

tag[tag-id]:显示进程中指定模块申请的堆内存的统计信息。tag-id表示系统内部软件模块的编号,用十六进制字符串表示,取值范围为0~FFFFFFFF。不指定tag-id参数时,表示进程中的所有模块。

verbose显示内存详细统计信息。不指定该参数时,显示内存概要统计信息。

slotslot-number:表示单板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【使用指导】

系统的堆内存由固定大小(比如size=16字节、size=64字节等)的内存块构成,用于存放用户态进程运行过程中需要用到的数据或者中间变量。当用户态进程启动时,系统会根据用户态进程运行需要,给用户态进程动态分配堆内存。用户态进程的堆内存信息可使用display process memory heap命令显示。

每个内存块都有地址,该地址用十六进制数表示,可通过display process memory heap size命令显示。用户使用内存块的地址可以访问内存块,获取内存块的内容,内存块的内容可通过display process memory heap address命令显示。

【举例】

# 显示job 1的堆内存概要统计信息。

display process memory heap job 1

Total virtual memory heap space(in bytes) : 538448

Total physical memory heap space(in bytes) : 356352

Total allocated memory(in bytes) : 369904

Free memory ratio : 0.3%

# 显示job 1的堆内存详细统计信息。

display process memory heap job 1 verbose

Heap usage:

Size Free Used Total Free Ratio

32 8 304 312 2.6%

48 1 339 340 0.3%

64 4 250 254 1.6%

80 7 16 23 30.4%

96 2 70 72 2.8%

112 1 1 2 50.0%

128 0 7 7 0.0%

160 0 2 2 0.0%

176 0 8 8 0.0%

192 0 63 63 0.0%

224 0 67 67 0.0%

240 0 1 1 0.0%

256 0 6 6 0.0%

288 0 1 1 0.0%

304 0 16 16 0.0%

336 0 2 2 0.0%

384 0 1 1 0.0%

512 0 1 1 0.0%

528 0 9 9 0.0%

544 0 1 1 0.0%

592 0 1 1 0.0%

608 0 2 2 0.0%

720 0 226 226 0.0%

752 0 1 1 0.0%

1008 0 1 1 0.0%

1072 0 3 3 0.0%

1200 0 1 1 0.0%

1680 0 3 3 0.0%

2000 0 5 5 0.0%

2064 0 5 5 0.0%

2096 0 1 1 0.0%

4112 0 13 13 0.0%

5136 0 1 1 0.0%

8240 0 1 1 0.0%

11280 0 1 1 0.0%

Large Memory Usage:

Used Blocks : 0

Used Memory(in bytes): 0

Free Blocks : 2

Free Memory(in bytes): 167120

Large Memory Usage detail:

Size Free Used Total Free Ratio

[32K,64K) 1 0 1 100.0%

[96K,128K) 1 0 1 100.0%

Summary:

Total virtual memory heap space(in bytes) : 538448

Total physical memory heap space(in bytes) : 356352

Total allocated memory(in bytes) : 369904

Free memory ratio : 0.3%

以上显示信息表明:job 1分得size大小32字节的内存块312个(已用304个,还有8个未使用),size大小为48字节的内存块340个(已用339个,还有1个未使用),以此类推。

# 显示job 1中所有模块申请的堆内存的统计信息。

display process memory heap job 1 tag

Total allocated memory: 16101568 bytes

Total free memory: 206480 bytes

Heap usage of the job:

Tag UsedBlocks UsedBytes FreeBlocks FreeBytes

0x0 1289 16101568 17 206480

# 显示job 1中模块0申请的堆内存的统计信息。

display process memory heap job 1 tag 0

Heap usage:

Size UsedBlocks UsedBytes FreeBlocks FreeBytes

32 269 8608 5 160

48 300 14400 1 48

64 227 14528 2 128

80 14 1120 1 80

96 63 6048 0 0

112 1 112 4 448

128 7 896 1 128

160 2 320 0 0

176 6 1056 1 176

192 59 11328 0 0

224 63 14112 0 0

240 1 240 0 0

...

表1-13 display process memory heap命令显示信息描述表

字段

描述

Total virtual memory heap space(in bytes)

虚拟堆内存总大小,单位为字节

Total physical memory heap space(in bytes)

物理堆内存总大小,单位为字节

Total allocated memory(in bytes)

任务已使用的堆内存大小,单位为字节

Free memory ratio

进程已经释放但是没有还给系统的堆内存,相对于进程整个虚拟堆内存的百分比

Heap usage

堆内存的使用情况

Size

内存块大小,单位为字节

[64K,96K)表示内存块的大小大于等于64K且小于96K

Free

空闲的内存块个数

Used

已使用的内存块个数

Total

指定大小内存块总个数,为Free和Used之和

Free Ratio

Free与Total的比率,可以反映这种大小内存块的碎片情况

Large Memory Usage

大块内存的使用情况

Used Blocks

已使用的内存块个数

Used Memory(in bytes)

已使用的内存大小,单位为字节

Free Blocks

剩余的内存块个数

Free Memory(in bytes)

剩余的内存大小,单位为字节

Large Memory Usage detail

大块内存的详细使用情况

Total allocated memory

任务已使用的堆内存大小,单位为字节

Total free memory

任务已使用的堆内存大小,单位为字节

Heap usage of the job

任务对堆内存的使用情况

Tag

系统内部软件模块的编号

UsedBlocks

已使用的内存块个数

UsedBytes

已使用的内存大小,单位为字节

FreeBlocks

剩余的内存块个数

FreeBytes

剩余的内存大小,单位为字节

【相关命令】

·display process memory

·display process memory heap address

·display process memory heap size

1.1.16 display process memory heap address

display process memory heap address命令用来显示从指定地址开始的内存空间的内容。

【命令】

display process memory heapjobjob-idaddressstarting-addresslengthmemory-length[slotslot-number[cpucpu-number]]

【视图】

任意视图

【缺省用户角色】

network-admin

network-operator

【参数】

jobjob-id:任务编号,用于唯一标识一个用户态进程,该编号不会随着用户态进程的重启而改变,取值范围为1~2147483647。

addressstarting-address:内存块的起始地址。

lengthmemory-length:内存的长度,取值范围为1~1024,单位为字节。

slotslot-number:表示单板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【使用指导】

当用户态进程运行异常时,使用该命令可以帮助设备维护人员诊断和定位问题。

【举例】

# 显示job 1从地址0xb7e30580开始,长度为128字节的内存空间的内容。

display process memory heap job 1 address b7e30580 length 128

B7E30580: 14 00 EF FF 00 00 00 00 E4 39 E2 B7 7C 05 E3 B7 .........9..|...

B7E30590: 14 00 EF FF 2F 73 62 69 6E 2F 73 6C 62 67 64 00 ..../sbin/slbgd.

B7E305A0: 14 00 EF FF 00 00 00 00 44 3B E2 B7 8C 05 E3 B7 ........D;......

B7E305B0: 14 00 EF FF 2F 73 62 69 6E 2F 6F 73 70 66 64 00 ..../sbin/ospfd.

B7E305C0: 14 00 EF FF 00 00 00 00 A4 3C E2 B7 AC 05 E3 B7 .........<......

B7E305D0: 14 00 EF FF 2F 73 62 69 6E 2F 6D 73 74 70 64 00 ..../sbin/mstpd.

B7E305E0: 14 00 EF FF 00 00 00 00 04 3E E2 B7 CC 05 E3 B7 .........>......

B7E305F0: 14 00 EF FF 2F 73 62 69 6E 2F 6E 74 70 64 00 00 ..../sbin/ntpd..

【相关命令】

·display process memory heap

·display process memory heap size

1.1.17 display process memory heap size

display process memory heap size命令用来显示指定大小已使用内存块的地址。

【命令】

display process memory heapjobjob-id[tagtag-id]sizememory-size[offsetoffset-size][slotslot-number[cpucpu-number]]

【视图】

任意视图

【缺省用户角色】

network-admin

network-operator

【参数】

jobjob-id:任务编号,用于唯一标识一个用户态进程,该编号不会随着用户态进程的重启而改变,取值范围为1~2147483647。

tagtag-id:显示进程中指定模块的代码申请的内存块的地址。tag-id表示系统内部软件模块的编号,用十六进制字符串表示,取值范围为0~FFFFFFFF。不指定该参数时,表示进程中的所有模块。

sizememory-size:内存块大小,取值范围为1~4294967295。

offsetoffset-size:要查询的内存块的偏移,取值范围为0~4294967295,缺省值为128。比如,系统给job 1分配了size为16字节的内存块100个,用户态进程当前已用了66个,如果执行命令display process memory heapjob1size16offset50,则会显示该用户态进程第51到第66个size为16字节的内存块的地址。

slotslot-number:表示单板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【使用指导】

该命令显示的地址为十六进制格式,使用该地址,通过display process memory heap address命令可以显示该地址内存的具体内容。

【举例】

# 显示job 1已使用的size大小为16字节的内存块的地址。

display process memory heap job 1 size 16

0xb7e300c0 0xb7e300d0 0xb7e300e0 0xb7e300f0

0xb7e30100 0xb7e30110 0xb7e30120 0xb7e30130

0xb7e30140 0xb7e30150 0xb7e30160 0xb7e30170

0xb7e30180 0xb7e30190 0xb7e301a0 0xb7e301b0

0xb7e301c0 0xb7e301d0 0xb7e301e0 0xb7e301f0

0xb7e30200 0xb7e30210 0xb7e30220 0xb7e30230

# 显示job 1已使用的size大小为16字节的内存块的地址,从第5个已使用内存块开始显示。

display process memory heap job 1 size 16 offset 4

0xb7e30100 0xb7e30110 0xb7e30120 0xb7e30130

0xb7e30140 0xb7e30150 0xb7e30160 0xb7e30170

0xb7e30180 0xb7e30190 0xb7e301a0 0xb7e301b0

0xb7e301c0 0xb7e301d0 0xb7e301e0 0xb7e301f0

0xb7e30200 0xb7e30210 0xb7e30220 0xb7e30230

【相关命令】

·display process memory heap

·display process memory heap address

1.1.18 display process memoryumem

display process memory umem命令用来显示用户态进程的umem内存的统计信息。

【命令】

display process memory umem jobjob-id[verbose][slotslot-number[cpucpu-number]]

【视图】

任意视图

【缺省用户角色】

network-admin

network-operator

【参数】

jobjob-id:任务编号,用于唯一标识一个用户态进程,该编号不会随着用户态进程的重启而改变。取值范围为1~2147483647。

verbose:显示内存详细统计信息。不指定该参数时,显示概要统计信息。

slotslot-number:指定单板。slot-number为单板所在的槽位号。如果不指定本参数,则表示指定主用主控板。

cpucpu-number:表示CPU的编号。

【使用指导】

用户态进程可以从umem库创建的cache缓存池中申请内存,也可以从系统cache缓存池中独立申请,这些内存都属于用户态进程的umem内存。umem内存用于存放用户态进程运行过程中需要用到的数据或者中间变量。

【举例】

# 显示Job 1009(forward进程)的umem内存概要统计信息。

display process all | include forward

1009 1009 1.3 8.7 S 120 N - 13:01:57 forward PHASE2

20258 20258 0.0 0.0 S 120 N pts/1 00:00:00 grep -E forward

//以上显示信息表明,forward进程的JobID为1009

display process memory umem job 1009

Total virtual memory umem space(in bytes) : 13631488

Total physical memory umem space(in bytes) : 0

Total allocated memory umem space(in bytes) : 13631488

# 显示Job 1009(forward进程)的umem内存的详细信息。

display process all | include forward

1009 1009 1.3 8.7 S 120 N - 13:01:57 forward PHASE2

20258 20258 0.0 0.0 S 120 N pts/1 00:00:00 grep -E forward

//以上显示信息表明,forward进程的JobID为1009

display process memory umem job 1009 verbose

Total virtual memory umem space(in bytes) : 13631488

Total physical memory umem space(in bytes) : 0

Total allocated memory umem space(in bytes) : 13631488

Main cache information for the user process:

Name Inuse Total Import Alloc Free Active

mmap_top 13631488 14680064 0 21 0 21

mmap_heap 13631488 13631488 13631488 21 0 21

vmem_internal 524288 524288 524288 2 0 2

vmem_seg 262144 262144 262144 1 0 1

...

umem_default 5505024 5505024 5505024 21 0 21

Detailed cache information for the user process:

Cachename Bufsize Chunksize Activebuf Buftotal Slabsize Activeslabs Total

Cache Magsize Color Fullmag Emptymag

umem_magazine_143 1152 1152 5 227 262144 1 262144

0x7fc8dd140030 95 64 0 0

umem_magazine_95 768 768 0 0 262144 0 0

...

表1-14 display process memory umem命令显示信息描述表

字段

描述

Total virtual memory umem space(in bytes)

umem虚拟内存总大小,单位为字节

Total physical memory umem space(in bytes)

umem物理内存总大小,单位为字节

Total allocated memory umem space(in bytes)

已使用的umem内存大小,单位为字节

Main cache information for the user process

用户态进程使用的主要Cache缓存池的信息

Name

Cache缓存池的名字

Inuse

Cache缓存池已使用的内存大小,单位为字节

Total

该cache缓存池占用的总内存大小,单位为字节

Import

从上一级缓存申请到的内存大小,单位为字节

Alloc

当前cache缓存池分配出去的内存的数量

Free

当前cache缓存池空闲的内存的数量

Active

当前cache缓存池活跃的内存数量

Detailed cache information for the user process

用户态进程使用的所有Cache缓存池的详细信息

Cachename

cache缓存池的名字

Bufsize

用户态进程申请buf的大小,单位为字节

Chunksize

块的大小,单位为字节

Activebuf

正在使用的buf数量

Buftotal

总共的buf数量

Slabsize

Slab的大小,单位为字节

Activeslabs

正在使用的slab数量

Total

该cache占用的总内存,单位为字节

Cache

cache缓存池的首地址

Magsize

弹夹的大小,单位为字节

Color

cache着色

Fullmag

满弹夹的个数

Emptymag

空弹夹的个数

【相关命令】

·display process

1.1.19 exception filepath

exception filepath命令用来配置core文件的保存路径。

undo exception filepath命令用来将core文件的保存路径配置为空。

【命令】

exception filepathdirectory

undo exception filepathdirectory

【缺省情况】

Core文件的保存路径为设备缺省文件系统的根目录。关于缺省文件系统的详细介绍请参见“基础配置指导”中的“文件系统管理”。

【视图】

用户视图

【缺省用户角色】

network-admin

【参数】

directory:表示core文件的保存路径,只能为存储介质的根目录。

【使用指导】

本命令配置成功后,设备会将生成的core文件存放到当前主用主控板上指定存储介质根目录下的core文件夹下。如果存储介质根目录下没有core文件夹,则会先创建core文件夹,再保存core文件。

当设备上有不同类型存储介质的时候,可使用该命令修改core文件的保存路径。

需要注意的是,当core文件的保存路径为空或无法正常访问时,系统将无法保存core文件。

【举例】

# 配置core文件的保存路径。

exception filepath flash:/

【相关命令】

·display exception filepath

·process core

1.1.20 monitor kernel deadloop enable

monitor kernel deadloop enable命令用来开启内核线程死循环检测功能。

undo monitor kernel deadloop enable命令用来关闭内核线程死循环检测功能。

【命令】

monitor kernel deadloop enable[slotslot-number[cpucpu-number]]

undo monitor kernel deadloop enable[slotslot-number[cpucpu-number]]

【缺省情况】

内核线程死循环检测功能处于开启状态。

【视图】

系统视图

【缺省用户角色】

network-admin

【参数】

slotslot-number:表示单板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【使用指导】

注意

通常情况下,内核线程死循环检测功能及其参数使用缺省配置即可。如果确实需要修改配置,请在工程师的指导下进行,以免引起系统异常。

在内核态空间中,所有资源都是共享的,多个内核线程之间通过任务调度协调工作。如果某个内核线程长时间一直占用CPU,就会导致其它内核线程获取不到运行机会,整个系统挂死,这种现象称为死循环。

开启内核线程死循环检测功能后,如果系统发现某内核线程在指定时间内一直占用CPU,则判定该内核线程为死循环,并记录一条死循环信息供管理员查询。

【举例】

# 开启内核线程死循环检测功能。

system-view

[Sysname] monitor kernel deadloop enable

【相关命令】

·display kernel deadloop

·display kernel deadloop configuration

·monitor kernel deadloop exclude-thread

·monitor kernel deadloop time

1.1.21 monitor kernel deadloop exclude-thread

monitor kernel deadloop exclude-thread命令用来配置不检测指定内核线程是否发生了死循环。

undo monitor kernel deadloop exclude-thread命令用来恢复对指定内核线程是否发生了死循环进行检测。

【命令】

monitor kernel deadloop exclude-threadtid[slotslot-number[cpucpu-number]]

undo monitor kernel deadloop exclude-thread[tid][slotslot-number[cpucpu-number]]

【缺省情况】

开启内核线程死循环检测功能后,系统会监控所有内核线程是否发生了死循环。

【视图】

系统视图

【缺省用户角色】

network-admin

【参数】

tid:表示内核线程编号,用于唯一标识一个内核线程,取值范围为1~2147483647。不指定该参数时,表示恢复到缺省情况。

slotslot-number:表示单板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【使用指导】

多次执行该命令,可以配置对多个内核线程不进行检测,最多可以配置128个。

通常情况下,使用缺省配置即可。如果确实需要修改配置,请在工程师的指导下进行,以免引起系统异常。

【举例】

# 对编号为15的内核线程不进行死循环检测。

system-view

[Sysname]monitor kernel deadloop exclude-thread 15

【相关命令】

·display kernel deadloop configuration

·display kernel deadloop

·monitor kernel deadloop enable

1.1.22 monitor kernel deadloop time

monitor kernel deadloop time命令用来配置判定内核线程是否死循环的时长。

undo monitor kernel deadloop time命令用来恢复缺省情况。

【命令】

monitor kernel deadloop timetime[slotslot-number[cpucpu-number]]

undo monitor kernel deadloop time[slotslot-number[cpucpu-number]]

【缺省情况】

缺省情况下,当某内核线程连续运行超过10秒钟,则判定为死循环。

【视图】

系统视图

【缺省用户角色】

network-admin

【参数】

timetime:表示内核线程死循环判定时长,取值范围为1~65535,单位为秒。

slotslot-number:表示单板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【使用指导】

开启内核线程检测功能后,如果某内核线程持续运行指定时间,则认为该内核线程已经死循环。

通常情况下,使用缺省配置即可。如果确实需要修改配置,请在工程师的指导下进行,以免引起系统异常。

【举例】

# 配置当某内核线程连续运行超过8秒钟,则判定为死循环。

system-view

[Sysname] monitor kernel deadloop time 8

【相关命令】

·display kernel deadloop configuration

·display kernel deadloop

·monitor kernel deadloop enable

1.1.23 monitor kernel starvation enable

monitor kernel starvation enable命令用来开启内核线程饿死检测功能。

undo monitor kernel starvation enable命令用来关闭内核线程饿死检测功能。

【命令】

monitor kernel starvation enable[slotslot-number[cpucpu-number]]

undo monitor kernel starvation enable[slotslot-number[cpucpu-number]]

【缺省情况】

内核线程饿死检测功能处于关闭状态。

【视图】

系统视图

【缺省用户角色】

network-admin

【参数】

slotslot-number:表示单板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【使用指导】

注意

通常情况下,内核线程饿死检测功能及其参数使用缺省配置即可。如果确实需要修改配置,请在工程师的指导下进行,以免引起系统异常。

如果内核线程本身的触发条件没有达到,会导致该内核线程在一段时间内一直得不到调度,这种现象称为饿死。

开启内核线程饿死检测功能后,当系统检测到某内核线程饿死时,会记录一条饿死信息供管理员查询。

内核线程饿死并不会影响整个系统的运行,当触发条件达到,处于饿死状态的内核线程会自动执行。

【举例】

# 开启内核线程饿死检测功能。

system-view

[Sysname] monitor kernel starvation enable

【相关命令】

·display kernel starvation configuration

·display kernel starvation

·monitor kernel starvation time

·monitor kernel starvation exclude-thread

1.1.24 monitor kernel starvation exclude-thread

monitor kernel starvation exclude-thread命令用来配置不检测指定内核线程是否发生了饿死。

undo monitor kernel starvation exclude-thread命令用来恢复对指定内核线程是否发生了饿死进行检测。

【命令】

monitor kernel starvation exclude-threadtid[slotslot-number[cpucpu-number]]

undo monitor kernel starvation exclude-thread[tid][slotslot-number[cpucpu-number]]

【缺省情况】

开启内核线程饿死检测功能后,会监控所有内核线程是否发生了饿死。

【视图】

系统视图

【缺省用户角色】

network-admin

【参数】

tid:表示内核线程编号,用于唯一标识一个内核线程,取值范围为1~2147483647。不指定该参数时,表示恢复到缺省情况。

slotslot-number:表示单板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【使用指导】

多次执行该命令,可以配置对多个内核线程不进行检测,最多可以配置128个。

通常情况下,使用缺省配置即可。如果确实需要修改配置,请在工程师的指导下进行,以免引起系统异常。

【举例】

# 对编号为15的内核线程不进行饿死检测。

system-view

[Sysname] monitor kernel starvation exclude-thread 15

【相关命令】

·display kernel starvation

·display kernel starvation configuration

·monitor kernel starvation enable

1.1.25 monitor kernel starvation time

monitor kernel starvation time命令用来配置判定内核线程是否饿死的时长。

undo monitor kernel starvation time命令用来恢复缺省情况。

【命令】

monitor kernel starvation timetime[slotslot-number[cpucpu-number]]

undo monitor kernel starvation time[slotslot-number[cpucpu-number]]

【缺省情况】

当某内核线程在120秒内一直没有运行,则认为该内核线程被饿死。

【视图】

系统视图

【缺省用户角色】

network-admin

【参数】

timetime:表示内核线程饿死判定时长,取值范围为1~65535,单位为秒。

slotslot-number:表示单板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【使用指导】

通常情况下,使用缺省配置即可。如果确实需要修改配置,请在工程师的指导下进行,以免引起系统异常。

【举例】

# 配置当内核线程在120秒内一直没有运行,则认为该内核线程被饿死。

system-view

[Sysname] monitor kernel starvation time 120

【相关命令】

·display kernel starvation

·display kernel starvation configuration

·monitor kernel starvationenable

1.1.26 monitor process

monitor process命令用来显示进程的统计信息。

【命令】

monitorprocess[dumbtty][iterationnumber][slotslot-number[cpucpu-number]]

【视图】

任意视图

【缺省用户角色】

network-admin

【参数】

dumbtty:以哑终端方式显示进程统计信息(即屏幕不支持定时刷新统计信息)。指定该参数时,全部进程的统计信息以CPU使用率降序排列输出到屏幕上;不指定该参数时,统计信息以交互模式显示,缺省情况下按CPU占用率降序显示前10个进程的统计信息,且每隔5秒刷新一次。

iterationnumber:表示进程统计信息的显示次数,取值范围为1~4294967295。指定dumbtty参数时,number的缺省值为1;不指定dumbtty且不配置number参数时,表示显示次数没有限制,统计信息会每隔5秒刷新一次,一直显示。

slotslot-number:表示单板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【使用指导】

不指定dumbtty参数的情况下,统计信息将以交互模式显示。在交互模式下,系统可以根据用户输入的交互命令字来调整显示方式或直接终止进程。在用户输入交互命令字之前,系统会自动计算可显示的进程个数,超出屏幕范围的进程不会显示。

在交互模式下可以使用的交互命令字及对应的功能请参见表1-14

表1-14 monitor process命令支持的交互命令字描述表

命令字

功能描述

?或h

帮助信息,显示可用的交互式命令字

1

各物理CPU状态的显示开关。比如:

1.输入1,分别显示各物理CPU的参数值

2.再次输入1,显示所有CPU的参数的平均值

3.第三次输入1,又分别显示各物理CPU的参数值

4.如此循环

缺省情况下,显示所有CPU的参数的平均值

c

按CPU占用率降序排列,缺省情况下采用降序排列

d

配置统计信息的更新时间间隔,取值范围为1~2147483647秒,缺省值为5

f

按进程打开的文件句柄数降序排列

k

终止一个任务,此命令会影响系统运行,请谨慎使用

l

刷新屏幕

m

按进程使用内存大小降序排列

n

改变显示的进程个数,取值范围为0~2147483647(缺省值为10,0表示不作限制);超过屏幕范围时,仍只显示一屏内可容纳的进程个数

q

退出交互模式

t

按进程最近一次启动后的运行时间降序排列

<

排序项向左移动一列

>

排序项向右移动一列

【举例】

# 以哑终端方式显示进程统计信息。(使用该方式显示时,系统会一次显示所有进程的统计信息,并且不支持定时刷新,显示完毕后,会退回到命令视图)

monitor process dumbtty

79 processes; 416 threads; 8473 FDs

Thread states: 1 running, 415 sleeping, 0 stopped, 0 zombie

CPU0 states: 95.55% idle, 2.67% user, 1.78% kernel, 0.00% interrupt

CPU1 states: 98.22% idle, 0.89% user, 0.89% kernel, 0.00% interrupt

CPU2 states: 99.12% idle, 0.00% user, 0.88% kernel, 0.00% interrupt

CPU3 states: 86.62% idle, 5.35% user, 8.03% kernel, 0.00% interrupt

Container CPU0 states: 4.46%

Container CPU1 states: 3.57%

Container CPU2 states: 2.65%

Container CPU3 states: 12.50%

Memory: 15952M total, 11880M available, page size 4K

Container memory: 15952M total, 11880M available

JID PID PRI State FDs MEM HH:MM:SS CPU C-CPU Name

920 920 120 S 67 341444K 01:34:07 2.45% 2.79% diagd

652 652 100 S 711 3060976K 12:00:05 1.47% 1.67% drvuserd

940 940 120 S 1038 3881152K 04:12:51 0.49% 0.55% forward

1 1 120 S 45 174952K 00:00:03 0.24% 0.27% scmd

1077 1077 120 S 132 379140K 00:18:44 0.24% 0.27% ethd

其他显示信息略。

# 以哑终端方式显示进程统计信息,并且执行一次命令显示两次统计结果。

monitor process dumbtty iteration 2

79 processes; 416 threads; 8473 FDs

Thread states: 1 running, 415 sleeping, 0 stopped, 0 zombie

CPU0 states: 95.55% idle, 2.67% user, 1.78% kernel, 0.00% interrupt

CPU1 states: 99.10% idle, 0.00% user, 0.90% kernel, 0.00% interrupt

CPU2 states: 92.80% idle, 2.70% user, 4.50% kernel, 0.00% interrupt

CPU3 states: 90.92% idle, 3.63% user, 5.45% kernel, 0.00% interrupt

Container CPU0 states: 5.35%

Container CPU1 states: 3.60%

Container CPU2 states: 2.70%

Container CPU3 states: 10.00%

Memory: 15952M total, 11878M available, page size 4K

Container memory: 15952M total, 11878M available

JID PID PRI State FDs MEM HH:MM:SS CPU C-CPU Name

920 920 120 S 67 341444K 01:34:07 2.47% 2.57% diagd

652 652 100 S 711 3060976K 12:00:09 1.12% 1.16% drvuserd

940 940 120 S 1038 3881152K 04:12:52 0.44% 0.46% forward

1544 1544 120 S 144 431872K 02:19:58 0.44% 0.46% isisd

1 1 120 S 45 174952K 00:00:03 0.22% 0.23% scmd

1077 1077 120 S 132 379140K 00:18:44 0.22% 0.23% ethd

其他显示信息略。

// 5秒钟后,系统会自动统计一次,并显示统计信息如下。(相当于执行了两次monitor process dumbtty,两次执行的时间间隔为5秒)

79 processes; 416 threads; 8473 FDs

Thread states: 1 running, 415 sleeping, 0 stopped, 0 zombie

CPU0 states: 95.90% idle, 2.54% user, 1.56% kernel, 0.00% interrupt

CPU1 states: 94.12% idle, 1.96% user, 3.92% kernel, 0.00% interrupt

CPU2 states: 96.88% idle, 1.95% user, 1.17% kernel, 0.00% interrupt

CPU3 states: 98.45% idle, 0.58% user, 0.97% kernel, 0.00% interrupt

Container CPU0 states: 4.69%

Container CPU1 states: 4.50%

Container CPU2 states: 2.34%

Container CPU3 states: 1.76%

Memory: 15952M total, 11878M available, page size 4K

Container memory: 15952M total, 11878M available

JID PID PRI State FDs MEM HH:MM:SS CPU C-CPU Name

652 652 100 S 711 3060976K 12:00:09 1.58% 1.43% drvuserd

920 920 120 S 67 341444K 01:34:07 0.70% 0.64% diagd

940 940 120 S 1038 3881152K 04:12:52 0.54% 0.49% forward

1544 1544 120 S 144 431872K 02:19:58 0.27% 0.24% isisd

853 853 120 S 33 194772K 00:27:33 0.10% 0.09% loads

1573 1573 120 S 79 350424K 00:46:47 0.10% 0.09% nqad

865 865 120 S 115 541132K 00:00:25 0.05% 0.04% devd

1094 1094 120 S 103 448796K 00:12:33 0.05% 0.04% staticrtd

其他显示信息略。

# 以交互方式显示进程统计信息。

monitor process

79 processes; 416 threads; 8474 FDs

Thread states: 1 running, 415 sleeping, 0 stopped, 0 zombie

CPU states: 96.53% idle, 1.76% user, 1.71% kernel, 0.00% interrupt

Container CPU states: 3.37% total, 1.68% user, 1.69% system

Memory: 15952M total, 11877M available, page size 4K

Container memory: 15952M total, 11877M available

JID PID PRI State FDs MEM HH:MM:SS CPU C-CPU Name

652 652 100 S 711 3060976K 12:00:14 1.45% 1.41% drvuserd

920 920 120 S 67 341444K 01:34:08 0.64% 0.63% diagd

940 940 120 S 1039 3881152K 04:12:54 0.50% 0.48% forward

1544 1544 120 S 144 431872K 02:19:59 0.29% 0.29% isisd

1077 1077 120 S 132 379140K 00:18:45 0.09% 0.09% ethd

1573 1573 120 S 79 350424K 00:46:47 0.09% 0.09% nqad

853 853 120 S 33 194772K 00:27:33 0.04% 0.04% loads

921 921 120 S 65 397888K 00:00:21 0.04% 0.04% lauthd

928 928 120 S 150 514804K 00:13:14 0.04% 0.04% vland

1545 1545 125 S 110 449236K 00:24:54 0.04% 0.04% ip6addrd

以上信息会每隔5秒刷新一次。

·输入“h”或“?”,将显示如下帮助信息。

Help for interactive commands:

?,h Show the available interactive commands

1 Toggle SMP view: '1' single/separate states

c Sort by the CPU field(default)

d Set the delay interval between screen updates

f Sort by number of open files

k Kill a job

l Refresh the screen

m Sort by memory used

n Set the maximum number of processes to display

q Quit the interactive display

t Sort by run time of processes since last restart

< Move sort field to the next left column

> Move sort field to the next right column

Press any key to continue

·输入“d”后,根据出现的提示如果输入“3”,则统计信息将会每隔3秒更新一次。

Enter the delay interval between updates(1~2147483647):3

·输入“n”后,根据出现的提示如果输入“5”,则显示的进程数目将会变为5个。

Enter the max number of processes to display(0 means unlimited):5

79 processes; 416 threads; 8473 FDs

Thread states: 1 running, 415 sleeping, 0 stopped, 0 zombie

CPU states: 96.06% idle, 1.77% user, 2.17% kernel, 0.00% interrupt

Container CPU states: 3.62% total, 1.68% user, 1.94% system

Memory: 15952M total, 11878M available, page size 4K

Container memory: 15952M total, 11878M available

JID PID PRI State FDs MEM HH:MM:SS CPU C-CPU Name

652 652 100 S 711 3060976K 12:00:40 1.55% 1.42% drvuserd

920 920 120 S 67 341444K 01:34:23 1.00% 0.92% diagd

940 940 120 S 1038 3881152K 04:13:03 0.63% 0.58% forward

1544 1544 120 S 144 431872K 02:20:04 0.26% 0.24% isisd

1077 1077 120 S 132 379140K 00:18:45 0.17% 0.16% ethd

·输入“f”,统计信息将以打开的文件句柄数降序输出(c、m、t命令字类似)。

79 processes; 416 threads; 8473 FDs

Thread states: 1 running, 415 sleeping, 0 stopped, 0 zombie

CPU states: 95.84% idle, 2.08% user, 2.08% kernel, 0.00% interrupt

Container CPU states: 4.49% total, 2.15% user, 2.34% system

Memory: 15952M total, 11878M available, page size 4K

Container memory: 15952M total, 11878M available

JID PID PRI State FDs MEM HH:MM:SS CPU C-CPU Name

940 940 120 S 1038 3881152K 04:13:04 0.53% 0.57% forward

652 652 100 S 711 3060976K 12:00:42 1.21% 1.30% drvuserd

898 898 120 S 278 835480K 00:01:41 0.00% 0.00% ifast

880 880 100 S 213 681996K 00:00:01 0.00% 0.00% ifmgr

1078 1078 120 S 194 644916K 00:00:06 0.00% 0.00% qosd

861 861 100 S 175 829244K 00:00:01 0.00% 0.00% dbmd

1637 1637 120 S 172 554460K 00:12:16 0.13% 0.14% bgpd

1440 1440 110 S 168 580800K 00:19:17 0.00% 0.00% laggd

928 928 120 S 150 514804K 00:13:15 0.13% 0.14% vland

1076 1076 120 S 149 564588K 00:19:38 0.00% 0.00% macd

·输入“k”后,根据出现的提示如果输入884,将会终止此JID对应的任务“lsmd”。

Enter the JID to kill: 884

78 processes; 414 threads; 8401 FDs

Thread states: 2 running, 412 sleeping, 0 stopped, 0 zombie

CPU states: 96.43% idle, 1.76% user, 1.81% kernel, 0.00% interrupt

Container CPU states: 3.33% total, 1.63% user, 1.70% system

Memory: 15952M total, 11880M available, page size 4K

Container memory: 15952M total, 11880M available

JID PID PRI State FDs MEM HH:MM:SS CPU C-CPU Name

652 652 100 S 711 3060976K 12:00:48 1.45% 1.35% drvuserd

920 920 120 S 67 341444K 01:34:26 0.65% 0.60% diagd

940 940 120 S 1037 3881152K 04:13:06 0.50% 0.46% forward

1544 1544 120 S 144 431872K 02:20:06 0.29% 0.27% isisd

928 928 120 S 150 514804K 00:13:15 0.09% 0.09% vland

1094 1094 120 S 103 448796K 00:12:34 0.09% 0.09% staticrtd

1573 1573 120 S 79 350424K 00:46:49 0.09% 0.09% nqad

853 853 120 S 33 194772K 00:27:34 0.04% 0.04% loads

1076 1076 120 S 149 564588K 00:19:38 0.04% 0.04% macd

1545 1545 125 S 110 449236K 00:24:56 0.04% 0.04% ip6addrd

·输入“q”,将退出交互模式。

表1-15 monitor process命令输出信息描述表

字段

描述

79 processes; 416 threads; 8473 FDs

系统的进程总数,线程总数,文件句柄总数

Thread states: 1 running, 415 sleeping, 0 stopped, 0 zombie

线程状态:

·处于running状态的线程数

·处于sleeping(包括interruptible sleep和uninterruptible sleep)状态的线程数

·处于stopped状态的线程数

·处于zombie状态的线程数

CPU states

物理设备上CPU的使用情况:空闲率,用户态占用率,内核态占用率,中断占用率

Container CPU states

容器对CPU的占用率

Memory

物理设备上内存的使用情况:总量,剩余内存的大小,page大小,单位为KB

Container Memory

容器内内存的使用情况:容器内存的总量,容器内剩余内存的大小,单位为KB

JID

任务编号(用于唯一标识一个进程,该编号不会随着进程的重启而改变)

PID

进程编号

PRI

进程优先级

State

进程状态,可能的取值为:

·R:running,运行状态或处于运行队列

·S:sleeping,可中断睡眠状态

·T:traced or stopped,暂停状态

·D:uninterruptible sleep,不可中断睡眠状态

·Z:zombie,僵死状态

FDs

file descriptions,进程打开的文件句柄数

MEM

进程所使用的内存大小(内核线程该项显示为0)

HH:MM:SS

进程自最近一次启动以来的运行时间

CPU

物理设备内进程的CPU使用率

C-CPU

容器内进程的CPU利用率

Name

进程名称(如果进程名称带有“[ ]”标记,则表示该进程为内核线程)

1.1.27 monitor thread

monitor thread命令用来显示线程的统计信息。

【命令】

monitorthread[dumbtty][iterationnumber][slotslot-number[cpucpu-number]]

【视图】

任意视图

【缺省用户角色】

network-admin

【参数】

dumbtty:以哑终端方式显示线程统计信息(即屏幕不支持定时刷新统计信息)。指定该参数时,全部线程的统计信息以CPU使用率降序排列输出到屏幕上。不指定该参数时,统计信息以交互模式显示,缺省情况下按CPU占用率降序显示前10个线程的统计信息,且每隔5秒更新一次。

iterationnumber:进程统计信息的显示次数,取值范围为1~4294967295。指定dumbtty参数时number的缺省值为1;不指定dumbtty且不配置number参数时,表示显示次数没有限制,统计信息会一直显示。

slotslot-number:表示单板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【使用指导】

不指定dumbtty参数的情况下,统计信息将以交互模式显示。在交互模式下,系统可以根据用户输入的交互命令字来调整显示方式或直接终止进程。在用户输入交互命令字之前,系统会自动计算可显示的线程个数,超出屏幕范围的线程不会显示。

在交互模式下可以使用的交互命令字及对应的功能请参见表1-16

表1-16 monitor thread命令支持的交互命令字描述表

命令字

功能描述

?或h

帮助信息,显示可用的交互式命令字

1

各物理CPU状态的显示开关。比如:

1.输入1,分别显示各物理CPU的参数值

2.再次输入1,显示所有CPU的参数的平均值

3.第三次输入1,又分别显示各物理CPU的参数值

4.如此循环

缺省情况下,显示所有CPU的参数的平均值

c

按CPU占用率降序排列,缺省情况下采用降序排列

d

配置统计信息的更新时间间隔,单位为秒,缺省值为5

k

终止一个任务(进程),此命令会影响系统运行,请谨慎使用

l

刷新屏幕

n

改变显示的线程个数,取值为0~2147483647(缺省值为10,0表示不作限制);超过屏幕范围时,仍只显示一屏内可容纳的线程个数

q

退出交互模式

t

按进程最近一次启动后的运行时间降序排列

<

排序项向左移动一列

>

排序项向右移动一列

【举例】

# 以哑终端方式显示线程统计信息。

monitor thread dumbtty

72 processes; 326 threads

Thread states: 4 running, 322 sleeping, 0 stopped, 0 zombie

CPU0 states: 0.01% idle, 22.88% user, 77.11% kernel, 0.00% interrupt

CPU1 states: 93.08% idle, 0.00% user, 0.00% kernel, 6.92% interrupt

CPU2 states: 100.00% idle, 0.00% user, 0.00% kernel, 0.00% interrupt

CPU3 states: 100.00% idle, 0.00% user, 0.00% kernel, 0.00% interrupt

CPU4 states: 100.00% idle, 0.00% user, 0.00% kernel, 0.00% interrupt

CPU5 states: 100.00% idle, 0.00% user, 0.00% kernel, 0.00% interrupt

CPU6 states: 100.00% idle, 0.00% user, 0.00% kernel, 0.00% interrupt

CPU7 states: 100.00% idle, 0.00% user, 0.00% kernel, 0.00% interrupt

Container CPU0 states: 107.46%

Container CPU1 states: 0.00%

Container CPU2 states: 0.00%

Container CPU3 states: 0.46%

Container CPU4 states: 0.00%

Container CPU5 states: 0.46%

Container CPU6 states: 0.00%

Container CPU7 states: 0.00%

Memory: 3932M total, 173M available, page size 4K

Container memory: 3932M total, 173M available

JID TID LAST_CPU PRI State HH:MM:SS MAX CPU C-CPU Name

862 862 0 120 R 15:47:52 0 4.54% 4.56% scanengi

861 861 0 120 R 15:47:52 0 4.36% 4.38% managerd

897 1001 0 120 R 15:47:48 0 3.42% 3.44% NDClient

878 878 0 120 S 00:08:06 0 0.08% 0.08% diagd

897 1027 0 120 S 00:03:23 0 0.08% 0.08% APMGRFW_

1443 1444 0 120 S 00:01:09 0 0.08% 0.08% ccf_thre

其它显示信息略。

# 以交互模式显示线程统计信息。

monitor thread

72 processes; 326 threads

Thread states: 4 running, 322 sleeping, 0 stopped, 0 zombie

CPU states: 87.00% idle, 3.73% user, 8.71% kernel, 0.56% interrupt

Container CPU states: 12.55% total, 3.72% user, 8.83% system

Memory: 3932M total, 173M available, page size 4K

Container memory: 3932M total, 173M available

JID TID LAST_CPU PRI State HH:MM:SS MAX CPU C-CPU Name

861 861 0 120 R 15:48:07 0 4.06% 3.92% managerd

897 1001 0 120 R 15:48:03 0 4.06% 3.92% NDClient

862 862 0 120 R 15:48:07 0 3.95% 3.81% scanengi

1 1 0 120 S 00:00:00 0 0.11% 0.10% scmd

897 958 0 120 S 00:06:47 0 0.11% 0.10% AGINGQUE

897 960 3 120 S 00:05:03 0 0.11% 0.10% AGINGQUE

897 1002 0 120 S 00:02:48 0 0.11% 0.10% TP_TIMER

897 1027 0 120 S 00:03:23 0 0.11% 0.10% APMGRFW_

897 8128 0 120 S 00:00:49 0 0.11% 0.10% ND_MAIN

897 8134 0 120 S 00:01:15 0 0.11% 0.10% IP6ADDR

·输入“h”或“?”,帮助信息显示如下:

Help for interactive commands:

?,h Show the available interactive commands

1 Toggle SMP view: '1' single/separate states

c Sort by the CPU field(default)

d Set the delay interval between screen updates

k Kill a job

l Refresh the screen

n Set the maximum number of threads to display

q Quit the interactive display

t Sort by run time of threads since last restart

< Move sort field to the next left column

> Move sort field to the next right column

Press any key to continue

·输入“d”后,根据出现的提示如果输入“3”,统计信息将会每隔3秒更新一次。

Enter the delay interval between screen updates(1~2147483647):3

·输入“n”后,根据出现的提示如果输入“5”,显示的线程数目将会变为5个。

Enter the max number of threads to display(0 means unlimited):5

72 processes; 326 threads

Thread states: 4 running, 322 sleeping, 0 stopped, 0 zombie

CPU states: 86.65% idle, 3.37% user, 9.07% kernel, 0.91% interrupt

Container CPU states: 12.54% total, 3.39% user, 9.15% system

Memory: 3932M total, 173M available, page size 4K

Container memory: 3932M total, 173M available

JID TID LAST_CPU PRI State HH:MM:SS MAX CPU C-CPU Name

861 861 0 120 R 15:48:17 0 4.26% 4.00% managerd

862 862 0 120 R 15:48:17 0 4.26% 4.00% scanengi

897 1001 0 120 R 15:48:13 0 4.26% 4.00% NDClient

897 958 0 120 S 00:06:47 0 0.04% 0.04% AGINGQUE

897 960 3 120 S 00:05:03 0 0.04% 0.04% AGINGQUE

·输入“k”后,根据出现的提示输入881,将会终止此JID对应的任务diagd。

Enter the JID to kill:861

71 processes; 325 threads

Thread states: 3 running, 322 sleeping, 0 stopped, 0 zombie

CPU states: 86.95% idle, 3.21% user, 9.23% kernel, 0.61% interrupt

Container CPU states: 12.52% total, 3.24% user, 9.28% system

Memory: 3932M total, 175M available, page size 4K

Container memory: 3932M total, 175M available

JID TID LAST_CPU PRI State HH:MM:SS MAX CPU C-CPU Name

897 1001 0 120 R 15:48:21 0 6.23% 5.97% NDClient

862 862 0 120 R 15:48:25 0 6.21% 5.95% scanengi

878 878 0 120 S 00:08:07 0 0.07% 0.06% diagd

897 962 5 120 S 00:04:55 0 0.04% 0.04% AGINGQUE

8132 8132 0 125 S 00:02:26 0 0.04% 0.04% ip6addrd

·输入“q”,将退出交互模式。

表1-17 monitor thread命令显示信息描述表

显示项

内容描述

72 processes; 326 threads

系统的进程总数,线程总数

Thread states

线程状态:

·处于running状态的线程数

·处于sleeping(包括interruptible sleep和uninterruptible sleep)状态的线程数

·处于stopped状态的线程数

·处于zombie状态的线程数

CPU states

物理设备上CPU的使用情况:空闲率,用户态占用率,内核态占用率,中断占用率

Container CPU states

容器对CPU的占用率

Memory

物理设备上内存的使用情况:总量,剩余内存的大小,page大小,单位为KB

Container Memory

容器内内存的使用情况:容器内存的总量,容器内剩余内存的大小,单位为KB

JID

任务编号,用于唯一标识一个进程,该编号不会随着进程的重启而改变

TID

线程编号

LAST_CPU

线程最近一次被调度所在的CPU的编号

PRI

线程优先级

State

进程状态,可能的取值为:

·R:running,运行状态或处于运行队列

·S:sleeping,可中断睡眠状态

·T:traced or stopped,暂停状态

·D:uninterruptible sleep,不可中断睡眠状态

·Z:zombie,僵死状态

HH:MM:SS

线程自最近一次启动以来的运行时间

MAX

线程单次调度占用CPU的最长时间,以毫秒为单位

CPU

物理设备内线程的CPU使用率

C-CPU

容器内线程的CPU利用率

Name

线程名称(如果线程名称带有“[ ]”标记,则表示该线程为内核线程)

1.1.28 process core

processcore命令用来开启/关闭用户态进程异常时生成core文件的功能,并配置可生成core文件的最大个数。

【命令】

processcore{maxcorevalue|off}{jobjob-id|nameprocess-name}[slotslot-number[cpucpu-number]]

【视图】

用户视图

【缺省情况】

同一用户态进程在首次异常时会生成core文件,后续异常不再生成core文件。即maxcore的最大数值为1。

【缺省用户角色】

network-admin

【参数】

off:表示关闭用户态进程异常时生成core文件的功能。

maxcorevalue:表示开启用户态进程的core文件生成功能,并配置能生成的core文件的最大个数。value表示用户态进程能生成的core文件的最大个数,取值范围为1~10,缺省值为1。

nameprocess-name:用户态进程的名称,为1~15个字符的字符串,不区分大小写。process core命令的配置对用户态进程下的所有实例有效。

jobjob-id:任务ID,用于唯一标识一个进程,该ID不会随着进程的重启而改变,取值范围为1~2147483647。

slotslot-number:表示单板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【使用指导】

开启用户态进程的core文件生成功能,并配置能生成的core文件的最大个数后,用户态进程异常重启一次,就会产生一个core文件并记录用户态进程的异常信息。如果生成的core文件的数目达到最大值,则不再生成新的core文件。软件开发和维护人员能够根据core文件的内容来定位异常的原因和异常的位置。

因为生成的core文件会占用系统存储资源,如果用户对某些用户态进程的异常退出不关心,可以关闭这些用户态进程的core文件记录功能。

【举例】

# 关闭用户态进程routed的core文件生成功能。

process core off name routed

# 开启用户态进程routed的core文件生成功能,并且最多可生成5个core文件。

process core maxcore 5 name routed

【相关命令】

·display exception context

·exception filepath

1.1.29 reset exception context

reset exception context命令用来清除用户态进程异常时记录的上下文信息。

【命令】

resetexception context[slotslot-number[cpucpu-number]]

【视图】

用户视图

【缺省用户角色】

network-admin

【参数】

slotslot-number:表示主控板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【举例】

# 清除用户态进程异常记录。

reset exception context

【相关命令】

·display exception context

1.1.30 reset kernel deadloop

reset kernel deadloop命令用来清除内核线程死循环信息。

【命令】

reset kernel deadloop[slotslot-number[cpucpu-number]]

【视图】

用户视图

【缺省用户角色】

network-admin

【参数】

slotslot-number:表示主控板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【举例】

# 清除内核线程死循环信息。

reset kernel deadloop

【相关命令】

·display kernel deadloop

1.1.31 reset kernel exception

reset kernel exception命令用来清除内核线程的异常信息。

【命令】

reset kernel exception[slotslot-number[cpucpu-number]]

【视图】

用户视图

【缺省用户角色】

network-admin

【参数】

slotslot-number:表示主控板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【举例】

# 清除内核线程的异常信息。

reset kernel exception

【相关命令】

·display kernel exception

1.1.32 reset kernel reboot

reset kernel reboot命令用来清除内核线程重启信息。

【命令】

reset kernel reboot[slotslot-number[cpucpu-number]]

【视图】

用户视图

【缺省用户角色】

network-admin

【参数】

slotslot-number:表示主控板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【举例】

# 清除内核线程重启信息。

reset kernel reboot

【相关命令】

·display kernel reboot

1.1.33 reset kernel starvation

reset kernel starvation命令用来清除内核线程饿死信息。

【命令】

reset kernel starvation[slotslot-number[cpucpu-number]]

【视图】

用户视图

【缺省用户角色】

network-admin

【参数】

slotslot-number:表示主控板所在的槽位号。不指定该参数时,表示主用主控板。

cpucpu-number:表示CPU的编号。

【举例】

# 清除内核线程饿死信息。

reset kernel starvation

【相关命令】

·display kernel starvation

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们