Core Resources
CPU
The QuecPi Alpha single-board computer utilizes the Qualcomm QCS6490 as its core processor, based on Arm v8 Cortex architecture with a maximum clock speed of 2.7 GHz.
- View CPU Information Command
root@qcm6490-idp:/# cat /proc/cpuinfo
processor : 0
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x2
CPU part : 0xd05
CPU revision : 0
processor : 1
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x2
CPU part : 0xd05
CPU revision : 0
- processor: The number of the logical processing core in the system. For a multi-core processor, it can be a physical core or a virtualized logical core using hyper-threading technology.
- BogoMIPS: Rough measurement of CPU speed (Millions of Instructions Per Second) during system kernel boot.
- Check CPU Utilization
Execute top
, then press 1
to show per-CPU core usage:
root@qcm6490-idp:/# top
top - 00:20:05 up 20 min, 1 user, load average: 0.04, 0.07, 0.06
Tasks: 340 total, 1 running, 339 sleeping, 0 stopped, 0 zombie
%Cpu0 : 0.5 us, 1.6 sy, 0.0 ni, 97.3 id, 0.0 wa, 0.5 hi, 0.0 si, 0.0 st
%Cpu1 : 0.5 us, 0.0 sy, 0.0 ni, 98.9 id, 0.0 wa, 0.5 hi, 0.0 si, 0.0 st
%Cpu2 : 1.6 us, 0.0 sy, 0.0 ni, 97.3 id, 0.5 wa, 0.0 hi, 0.0 si, 0.5 st
%Cpu3 : 0.0 us, 0.5 sy, 0.0 ni, 98.4 id, 0.0 wa, 0.5 hi, 0.0 si, 0.5 st
%Cpu4 : 1.1 us, 0.0 sy, 0.0 ni, 98.4 id, 0.0 wa, 0.0 hi, 0.0 si, 0.5 st
%Cpu5 : 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu6 : 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu7 : 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 7366.7 total, 6386.2 free, 498.6 used, 481.9 buff/cache
MiB Swap: 5395.5 total, 5395.5 free, 0.0 used. 6698.9 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 20 0 162028 9468 6524 S 1.1 0.1 0:07.64 systemd
594 message+ 20 0 6904 3712 3328 S 1.1 0.0 0:06.46 dbus-daemon
1087 root 20 0 1794556 61472 30848 S 1.1 0.8 0:05.56 containerd
1816 root 20 0 5768 2688 2048 R 1.1 0.0 0:00.04 top
40 root 20 0 0 0 0 I 0.5 0.0 0:00.48 kworker/3:0-mm_percpu_wq
50 root 20 0 0 0 0 S 0.5 0.0 0:00.55 rcuop/4
127 root 20 0 0 0 0 I 0.5 0.0 0:00.47 kworker/u16:6-events_unbound
280 root 20 0 34988 15176 14792 S 0.5 0.2 0:05.38 systemd-journal
925 root 20 0 630136 72200 53256 S 0.5 1.0 0:06.65 weston
- %us: CPU utilization of user space program (non-nice scheduled)
- %sy: CPU utilization of system space, especially the utilization of the kernel program
- %ni: CPU utilization of user space program with nice scheduling
- %id: Idle CPU
- %wa: I/O waiting percentage of the CPU
- %hi: Hardware interrupt count processed by CPU
- %si: Software interrupt count processed by CPU
- %st: Real-time
- Check CPU Temperature
root@qcm6490-idp:/# cat /sys/class/thermal/thermal_zone0/temp
37000
- The value above represents thousandths of degrees Celsius (divide by 1000 for actual temperature).
- CPU Stress Testing
There are many methods to test CPU stress. The stability of the CPU during computation can be tested by using the bc
command to calculate Pi.
root@qcm6490-idp:/# echo "scale=5000; 4*a(1)" | bc -l -q &
[1] 1592
The above command will calculate Pi in the background with a precision of 5000 decimal places, and the calculation process will take some time.
At this point, we can use the top
command to check the changes in CPU utilization, as shown below:
root@qcm6490-idp:/# top
top - 06:42:14 up 8 min, 1 user, load average: 0.29, 0.16, 0.09
Tasks: 326 total, 3 running, 323 sleeping, 0 stopped, 0 zombie
%Cpu(s): 12.7 us, 0.2 sy, 0.0 ni, 86.8 id, 0.0 wa, 0.1 hi, 0.0 si, 0.2 st
MiB Mem : 7366.9 total, 6540.2 free, 439.5 used, 387.2 buff/cache
MiB Swap: 5395.7 total, 5395.7 free, 0.0 used. 6770.1 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1592 root 20 0 3052 1792 1536 R 99.7 0.0 0:14.37 bc
588 message+ 20 0 6908 3584 3200 S 0.7 0.0 0:03.06 dbus-da+
1 root 20 0 162064 9324 6380 S 0.3 0.1 0:04.26 systemd
...
Approximately 15 seconds later, the PI result is calculated. During this period, the CPU utilization reaches 100%, and no abnormalities occurs, which indicates that the CPU stress test is successful. You can further increase the precision value to raise the testing pressure.
root@qcm6490-idp:/# 3.141592653589793238462643383279502884197169399375105820974944592307\
81640628620899862803482534211706798214808651328230664709384460955058\
22317253594081284811174502841027019385211055596446229489549303819644\
...
PMIC
The Linux kernel generally provides three suspend modes: Freeze, Standby, and STR (Suspend to RAM). These modes can be triggered by writing "freeze", "standby", and "mem" respectively to the /sys/power/state file in user space. QuecPi Alpha supports the freeze and mem methods, but does not support the disk method currently. The following test instructions uses the mem mode as an example.
- Check Supported Modes of QuecPi Alpha
root@qcm6490-idp:/# cat /sys/power/state
freeze mem disk
- Set Wakeup Source
Please configure the wakeup source before testing the wakeup feature. Here configures the debug port (ttyMSM0) as wakeup source:
root@qcm6490-idp:/# echo enabled > /sys/devices/platform/soc@0/9c0000.geniqup/994000.serial/tty/ttyMSM0/power/wakeup
- Suspend to RAM
To enter the corresponding power management mode, write the appropriate string to the /sys/power/state file in user space. To set the system to suspend to RAM, see the following method:
root@qcm6490-idp:/# echo mem > /sys/power/state
[15219.746797] PM: suspend entry (s2idle)
[15219.760424] Filesystems sync: 0.013 seconds
[15219.780574] Freezing user space processes
[15219.781589] process_accept_req: 22 callbacks suppressed
[15219.781600] smcinvoke: process_accept_req: Server id :17 interrupted probaby due to suspend, pid:897
[15219.791806] smcinvoke: process_accept_req: Server id :24 interrupted probaby due to suspend, pid:962
[15219.801969] smcinvoke: process_accept_req: Server id :18 interrupted probaby due to suspend, pid:903
[15219.812240] smcinvoke: process_accept_req: Server id :17 interrupted probaby due to suspend, pid:898
[15219.822590] smcinvoke: process_accept_req: Server id :18 interrupted probaby due to suspend, pid:902
[15219.832962] smcinvoke: process_accept_req: Server id :26 interrupted probaby due to suspend, pid:969
[15219.843391] smcinvoke: process_accept_req: Server id :21 interrupted probaby due to suspend, pid:929
[15219.853728] smcinvoke: process_accept_req: Server id :21 interrupted probaby due to suspend, pid:930
[15219.864031] smcinvoke: process_accept_req: Server id :17 interrupted probaby due to suspend, pid:899
[15219.874482] smcinvoke: process_accept_req: Server id :22 interrupted probaby due to suspend, pid:935
[15219.900228] Freezing user space processes completed (elapsed 0.119 seconds)
- Wakeup through Debug Port
After entering the sleep command, QuecPi Alpha enters sleep mode, saves the running state data to memory, disables the peripherals, and enters the waiting mode. Because waking up through debug port is configured, the system can be successfully woken up by simply inputting any character on the keyboard, as shown below:
[15221.270632] process_accept_req: 3 callbacks suppressed
[15221.270636] smcinvoke: process_accept_req: process_accept_req txn 4 either invalid or removed from Q
[15221.270655] smcinvoke: process_accept_req: process_accept_req txn 2 either invalid or removed from Q
[15221.270668] smcinvoke: process_accept_req: process_accept_req txn 3 either invalid or removed from Q
[15221.270742] smcinvoke: process_accept_req: process_accept_req txn 2 either invalid or removed from Q
[15221.270870] smcinvoke: process_accept_req: process_accept_req txn 1 either invalid or removed from Q
[15221.270924] smcinvoke: process_accept_req: process_accept_req txn 4 either invalid or removed from Q
[15221.270981] smcinvoke: process_accept_req: process_accept_req txn 3 either invalid or removed from Q
[15221.270982] done.
[15221.271044] smcinvoke: process_accept_req: process_accept_req txn 1 either invalid or removed from Q
[15221.271059] smcinvoke: process_accept_req: process_accept_req txn 3 either invalid or removed from Q
[15221.271078] smcinvoke: process_accept_req: process_accept_req txn 2 either invalid or removed from Q
[15221.371963] PM: suspend exit
UFS
QuecPi Alpha features 128 GB UFS storage chip with superior performance (faster read/write, full-duplex communication and command queue) compared to eMMC.
1. Check Capacity
fdisk -l
queries the ufs partition information and capacity.
root@qcm6490-idp:/opt/bc-1.08.1# fdisk -l
Disk /dev/sda: 116.09 GiB, 124646326272 bytes, 30431232 sectors
Disk model: C2G072
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 49B3A77D-3D7D-22A5-0A10-6A2ECDDEA256
Device Start End Sectors Size Type
/dev/sda1 6 131077 131072 512M EFI System
/dev/sda2 131078 138757 7680 30M Linux filesystem
/dev/sda3 138758 30431226 30292469 115.6G Linux root (ARM-64)
2. Check Partitions
The df
command queries the ufs partition information, usages and mount directories and other information.
root@qcm6490-idp:/opt/bc-1.08.1# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 109G 3.3G 101G 4% /sysroot
devtmpfs 4.0M 0 4.0M 0% /dev
tmpfs 3.6G 0 3.6G 0% /dev/shm
tmpfs 1.5G 31M 1.5G 3% /run
tmpfs 4.0M 0 4.0M 0% /sys/fs/cgroup
tmpfs 3.6G 12K 3.6G 1% /tmp
tmpfs 3.6G 0 3.6G 0% /var/volatile
/dev/sda1 511M 136M 376M 27% /boot
/dev/sda2 25M 892K 22M 4% /var/persist
tmpfs 737M 0 737M 0% /run/user/0
3. Performance Test
Performance test primarily evaluates the read and write speeds of files on ufs under the Linux system. This is typically done using a combination of the time
and dd
commands for testing.
- Write Test
root@qcm6490-idp:/opt# time dd if=/dev/zero of=tempfile bs=1M count=100 conv=fdatasync
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.2874 s, 365 MB/s
real 0m0.316s
user 0m0.000s
sys 0m0.122s
When using the dd
command to write files, you should add the conv=fdatasync parameter. This indicates that after dd finishes writing for N times, it will flush the cache and synchronize the data to the disk, because the write operation to the disk is generally written to the cache first and may return before being written to the disk. Here, the disk write speed tested is 365 MB/s.
- Read Test
In embedded systems, it is often necessary to test the file read and write performance of the system but the impact of cache is usually ignored when reading. Therefore, you can specify the parameter iflag=direct,nonblock.
root@qcm6490-idp:/opt# time dd if=tempfile of=/dev/null bs=1M count=100 iflag=direct,nonblock
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.196993 s, 532 MB/s
real 0m0.201s
user 0m0.001s
sys 0m0.041s
It can be seen that the direct read speed from the disk is 532 MB/s.
Memory
- Check Memory information
root@qcm6490-idp:/opt/bc-1.08.1# cat /proc/meminfo
MemTotal: 7543736 kB
MemFree: 6664720 kB
MemAvailable: 6928688 kB
Buffers: 19768 kB
Cached: 380520 kB
SwapCached: 0 kB
Active: 52044 kB
Inactive: 462332 kB
Active(anon): 3588 kB
Inactive(anon): 142568 kB
Active(file): 48456 kB
Inactive(file): 319764 kB
- MemTotal: Total available RAM size, physical memory minus reserved bits and kernel usage
- MemFree: LowFree + HighFree
- Buffers: Size used to cache block devices
- Cached: Size of file buffer cache
- SwapCached: Memory that has been swapped out. Related to I/O
- Active: Memory that is frequently (recently) used
- Inactive: Memory that has not been used recently
- Get Memory Usage
root@qcm6490-idp:/opt/bc-1.08.1# free -m
total used free shared buff/cache available
Mem: 7366 437 6504 31 424 6763
Swap: 5395 0 5395
- total: Total memory
- used: Used memory
- free: Available memory
Memory Stress Test
By specifying the memory size and number of tests, stress test can be performed on the system's existing memory. The system tool memtester can be used for this purpose. For example, to test with 300MB of memory for once, the command would be "memtester 300M 1".
The following example uses 300 MB of memory and performs a single test:
root@qcm6490-idp:/# memtester 300M 1
memtester version 4.5.1 (64-bit)
Copyright (C) 2001-2020 Charles Cazabon.
Licensed under the GNU General Public License version 2 (only).
pagesize is 4096
pagesizemask is 0xfffffffffffff000
want 300MB (314572800 bytes)
got 300MB (314572800 bytes), trying mlock ...locked.
Loop 1/1:
Stuck Address : ok
Random Value : ok
Compare XOR : ok
Compare SUB : ok
Compare MUL : ok
Compare DIV : ok
Compare OR : ok
Compare AND : ok
Sequential Increment: ok
Solid Bits : ok
Block Sequential : ok
Checkerboard : ok
Bit Spread : ok
Bit Flip : ok
Walking Ones : ok
Walking Zeroes : ok
Done.