2.查看log
在qnx中使用slog2info命令,查看log信息
# use slog2info
slog2info [options]
If no options are specified then all the logs are displayed.
Options:
-w / -W Wait mode, listens for new prints. Ctrl-C to stop.
[-w] Prints all available older logs prior to live
streaming.
[-W] Ignores all older logs and starts live streaming
from the current moment.
-l filename Specify a specific buffer_set file to parse. This allows
selection of PID-specific buffer_set. Choose one of the
files under /dev/shmem/slogger2/.
-b bset1,bset2,... Only parse logs with that match one of the list of buffer
set names.
Alternative permitted usage: -b bset1 -b bset2 -b ...
-i Display information about a buffer_set file specified by -l
-r resetfilename Display the pre-reset logs contained in a special file that
slogger2 may have generated during startup when slogger2
was invoked with the -d/-D option.
-c Clears the live slog2 buffers. Can be used with -b to
clear target buffer sets.
-s / -S [-s] Show the numeric severity level for each log line.
[-S] Show the severity level for each log line as one of:
SLOG2_[SHUTDOWN|CRITICAL|ERROR|WARNING|NOTICE|INFO|DEBUG1
|DEBUG2]
-e code1,code2,... Only parse logs that match one of the specified event
code names.
-t Display thread id.
-n Newline '\n' characters will be discarded from logs and
each log line in a multiline log will appear as a
separate log line in the output.
-a Highlight logs with ANSI terminal color-codes. Logs of
过滤某一个进程的log
slog2info -b ais_server -w //过滤只显示ais_server进程的log
实时显示log
slog2info -w | grep cci //实时过滤有cci打印的log
查看slog2info文件的log,需要将log文件放入机器里面,使用如下命令查看log
slog2info -l [filename]
清除slog2info打印的log
slog2info -c
3.查看进程
slog2info ar | grep ais //查看ais相关进程
4.杀死进程
使用方法:
slay <进程名 | 进程>
slay ais_server //杀死ais_server进程
slay 32806 //杀死进程好为32806进程
除了使用slay命令外,也可以使用kill命令
4.查看cpu资源占用
top | grep ais_server //查看ais的资源占用
hogs | grep ais //查看ais的CPU使用情况
5.查看内存信息
showmem
6.挂载根目录
使得可以对文件可以进行写操作,写完之后记得sync和修改文件权限
mount -uw /