qnx 启动&日志

QNX启动流程_qnx 启动-CSDN博客

8155-XBL分析 (xjx100.cn)

[实践篇]13.24 QNX镜像编译_qnx 编译-CSDN博客

Diagnostic Log and Trace——DLT 离线日志存储_dlt创建离线日志-CSDN博客

- slogger2 (qnx.com)

use slogger2
slogger2 - system logger service

日志保存在 /dev/shmem/slogger2 中,当进程结束,日志会复制到  -l     log_save_path  指定路径

 -l     log_save_path
        Note: This is mainly intended as a debugging feature.

        When a client process stops or terminates copy its associated
        buffer set(s) under /dev/shmem/slogger2/ to <log_save_path>.

        The default behavior of slogger2 once a client disconnects
        is to postpone the immediate cleanup of resources associated
        with the respective buffer set(s) until a later time. The
        present implementation relies on a queue of disconnected
        clients.

-c 参数指定out 和 error 两个buffer 大小,通过写 /dev/slog2/下对应的文件写到out 和 error buffer

-c     out_buffer_size,error_buffer_size (in bytes)
        Set up a buffer set containing two logging buffers (out and
        error). Writing to these buffers is accomplished by opening
        for write the following paths:

            path                | buffer
            --------------------+--------
            /dev/slog2/critical | error
            /dev/slog2/error    | error
            /dev/slog2/warning  | out
            /dev/slog2/info     | out
            /dev/slog2/debug    | out

        Each log line is prefixed with the process id of the client
        within square brackets.

-C 指定控制台buffer 大小

 -C     dev_console_buffer_size (in bytes)
        By default this feature is enabled with a buffer size of 16k.
        To disable set size to 0.

        Support /dev/console to provide a general purpose console
        logging node.

-G  log 等级

qnx/sdk/qnx710/target/qnx7/usr/include/sys/slog2.h

/**
  * Severity level definitions
  */
#define SLOG2_SHUTDOWN  0   /* Shut down the system NOW. eg: for OEM use */
#define SLOG2_CRITICAL  1   /* Unexpected unrecoverable error. eg: hard disk error */
#define SLOG2_ERROR     2   /* Unexpected recoverable error. eg: needed to reset a hw controller */
#define SLOG2_WARNING   3   /* Expected error. eg: parity error on a serial port */
#define SLOG2_NOTICE    4   /* Warnings. eg: Out of paper */
#define SLOG2_INFO      5   /* Information. eg: Printing page 3 */
#define SLOG2_DEBUG1    6   /* Debug messages eg: Normal detail */
#define SLOG2_DEBUG2    7   /* Debug messages eg: Fine detail */
 

 -G     numeric verbosity override value
        forces a system-wide verbosity_level override to control
        logging behavior, valid values are:

               -1 : disable logging (i.e. effectively disable
                    all logging in the system)
           0 to 7 : the regular severity/verbosity levels as
                    defined in <sys/slog2.h>

        the behavior of slog2_set_verbosity() will be affected so
        that the verbosity value will be clipped to the buffer
        set's verbosity_level when the new verbosity value is
        bigger

 cat /etc/syslog.conf
*.*     /dev/slog

 use  syslogd
NAME
     syslogd - log systems messages

SYNOPSIS
     syslogd [-dF] [-f config_file] [-m mark_interval] [-t threadcount]

 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 参数解析slogger 下对应的buffer_set 日志

slog2info -l  /dev/shmem/slogger2/qvm.1155178

-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/.

-i  获取buffer_set

slog2info -l  /dev/shmem/slogger2/qvm.1155178   -i
buffer_set_name=qvm, num_buffers=1, verbosity_level=5
 [0] : buffer_name: qvm, buffer_size: 4096

-i                  Display information about a buffer_set file specified by -l

slog2info  -b  qvm   -w

就可以持续输出  buffer_set 是qvm 日志,这个就是 -l    和  -i  作用 

logger 是qvm 配置文件
logger <type> <destination>
   Qvm output of <type> is directed to <destination>.
   Allowed types are:
       internal - an internal error in qvm has been detected
       fatal - an error that qvm can not continue execution from
       error - an error that qvm can continue execution from
       warn - warning messages
       info - general information messages
       verbose - more verbose informational messages
       debug - internal debugging information
    Allowed destinations are:
       stderr - send messages to qvm's standard error
       stdout - send messages to qvm's standard output
       slog   - send messages to qvm's slogger2 buffer

tracelogger 

 use tracelogger
tracelogger - logs events into an event file

tracelogger [-acrw] [-n num] [-k num] [-b num] [-F [0-7]] [-s seconds] [-f file] [-d1] [-P] [-R] [-M -S max_filesize]
            [-A key=value] [-v]

tracelogger - logs events into an event file - default
            event file is /dev/shmem/tracebuffer.kev.

Options:
            -a Enable Security Class events

/mnt/scripts/enable_debug_trace.sh

chmod a+x /usr/sbin/tracelogger
echo 0 > /dev/pdbg/memorydump/trace_status
if [ "$1" == "highprio" ]; then
    echo "Launching Debug Tracelogger with 255 Priority"
    on -p 255 tracelogger -c -r -k 4096 -f /dev/shmem/debug_tracebuffer.kev &
else
    echo "Launching Debug Tracelogger with default Priority"
    tracelogger -c -r -k 4096 -f /dev/shmem/debug_tracebuffer.kev &
fi

ARM9+ARM11(最新的采用Cotex-A8或是Cotex-A9)的架构。其中ANDROID是在ARM11上运行,而ARM9部分负责处理通信协议、射频、GPIO等,或者可以称作MODEM端,同样也运行一个OS,称为AMSS(Advanced Mobile Subscriber Software)

p/AMSS/platform/services/daemons/memorydump/memorydump.use:2:sets the secure monitor(TZ) dump buffer, starts tracelogger
qnx_ap/AMSS/platform/services/daemons/memorydump/src/main.c:643:        /* we have to wait 1s for tracelogger spawn done
qnx_ap/AMSS/platform/services/daemons/memorydump/src/pdbg.c:59:        len = snprintf(reply_msg, size, "memdump_tracelogger is enabled\n");
qnx_ap/AMSS/platform/services/daemons/memorydump/src/pdbg.c:62:        len = snprintf(reply_msg, size, "memdump_tracelogger is disabled\n");
qnx_ap/AMSS/platform/services/daemons/memorydump/src/pdbg.c:86:        LOG(QCLOG_INFO, "Stopping memdump_tracelogger");
qnx_ap/AMSS/platform/services/daemons/memorydump/src/pdbg.c:94:            LOG(QCLOG_INFO, "Starting memdump_tracelogger");
qnx_ap/AMSS/platform/services/daemons/memorydump/src/pdbg.c:100:            LOG(QCLOG_ERROR, "memorydump pdbg trace rejected. wdog_tracelogger enabled already!!!");

 use memorydump
memorydump Sets the debug cookies, copies MMU info into reset_info asinfo,
sets the secure monitor(TZ) dump buffer, starts tracelogger

Usage :
-t : Enable kernel tracing
-r : Enable ramdump functionality
-d : Dump mode - full/mini_rawdump/mini_dload/nodump
-U : To set the UID,GID

 pidin  syspage=asinfo | grep  reset_info
  0540) 00000000c6a00000-00000000c6afffff o:0060 a:0007 p:100 c:0 n:/memory/ram/reset_info

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值