This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] TDA4VM: 如何查看 QNX 中的 CPU 和内存使用情况

Part Number: TDA4VM


在 A72 上运行 QNX 时,如何查看 CPU 和内存使用情况?

  • 您可以使用不同的 QNX 实用程序来查看内存和 CPU 使用情况,这些实用程序均作为标准 QNX SDP 安装的一部分提供。  QNX 实用程序在 qnx.com 网站上有详细说明

    QNX“top”实用程序可用于显示 CPU 的使用情况。   

    20 processes; 86 threads;
    CPU states: 0.0% user, 0.0% kernel
    CPU  0 Idle: 99.9%
    CPU  1 Idle: 99.8%
    Memory: 4096M total, 2519M avail, page size 4K
    
          PID   TID PRI STATE    HH:MM:SS    CPU  COMMAND
            1    14  10 Run       0:00:00   0.04% kernel
       221204     1  10 Rply      0:00:00   0.02% top
           11     2  21 Rcv       0:00:00   0.00% io-pkt-v6-hc
            5     2  10 NSlp      0:00:00   0.00% random
            6     1  24 Rcv       0:00:00   0.00% devc-seromap
        12300     9  10 Rcv       0:00:00   0.00% io-usb-otg
            1     3  10 Rcv       0:00:00   0.00% kernel
            1    11  10 Rcv       0:00:00   0.00% kernel
        20494     1  10 Rcv       0:00:00   0.00% tisci-mgr
        36880     1  10 Rcv       0:00:00   0.00% tiipc-mgr
    
                 Min        Max       Average
    CPU 0 idle:   99%        99%        99%
    CPU 1 idle:   99%        99%        99%
    Mem Avail:   2519MB      2519MB      2519MB
    Processes:    20         20         20
    Threads:      86         86         86

    QNX“pidin”实用程序可用于显示不同的内存视图

    pidin inin”选项将显示整个系统的使用情况

    CPU:AARCH64 Release:7.0.4  FreeMem:2519MB/4096MB BootTime:Jan 01 00:00:00 GMT 1970
     Actual resident free memory:2520Mb
    Processes: 20, Threads: 86
    Processor1: 1092604032 Cortex-A72 2000MHz FPU
    Processor2: 1092604032 Cortex-A72 2000MHz FPU

    pidin mem”将显示所有进程使用的内存。  使用“pidin -P <进程名称> mem”可以按特定进程查看内存使用情况

    J7EVM@QNX:/# pidin -P procnto-smp-instr mem
         pid tid name               prio STATE            code  data        stack
           1   1 /procnto-smp-instr   0f RUNNING             0     0    480(480)
           1   2 /procnto-smp-instr   0f READY               0     0    480(480)
           1   3 /procnto-smp-instr  10r RUNNING             0     0  8192(8192)
           1   4 /procnto-smp-instr   1r RECEIVE             0     0  512K(512K)
           1   5 /procnto-smp-instr  10r CONDVAR             0     0  8192(8192)
           1   6 /procnto-smp-instr  10r CONDVAR             0     0  8192(8192)
           1   7 /procnto-smp-instr 255r RECEIVE             0     0  8192(8192)
           1   8 /procnto-smp-instr 255r RECEIVE             0     0  8192(8192)
           1   9 /procnto-smp-instr 255r RECEIVE             0     0  8192(8192)
           1  10 /procnto-smp-instr 255r RECEIVE             0     0  8192(8192)
           1  11 /procnto-smp-instr  10r RECEIVE             0     0  8192(8192)
           1  12 /procnto-smp-instr  10r RECEIVE             0     0  8192(8192)
           1  13 /procnto-smp-instr  10r RECEIVE             0     0  8192(8192)
           1  14 /procnto-smp-instr  10r RECEIVE             0     0  8192(8192)
           1  15 /procnto-smp-instr  21r RECEIVE             0     0  8192(8192)
                procnto-smp-instr  @ffffff8060045000             689K  108K