System Information¶
System Information is the collection of inventory details about the hardware, operating system and software. Embedded devices can be built on any combinations of existing hardware and software components. As such, tracking the system information allows diagnostic data to be associated with a specific combination of components, each of which is also associated with a particular version. Component types include the following:
Motherboard/System-on-chip (SoC) |
|
Firmware |
|
Operating system |
|
CPU |
|
GPU |
|
RAM |
|
Storage devices |
|
Network adapters |
|
USB controllers and devices |
|
PCI devices |
PSYGIG Mobility IoT SDK associates the system information with all diagnostic data collected within the SDK. This provides the opportunity to realize valuable insights when system components are upgraded or replaced. For example, the application performance effects of upgrading to a GPU with a higher compute core count can be visualized in a comparison graph.
The System Information API includes many features suitable for integration into embedded systems:
Works on existing applications; no need to recompile source code
Up-to-date with latest hardware standards and technologies
Accurate hardware specifications (eg. CPU architecture) and measurements (eg. clock speed)
Maintain an inventory of peripheral devices and sensors
Generate a system information report in HTML
Export to a variety of file formats (eg. JSON, CSV, XML)
Using psymon
¶
Without modifying your existing source code, you can instantly enable system information collection
to your application by using the psymon
script to run your program. For example:
psymon "/path/to/your/app --arg1 --arg2 --arg3"
See psymon man page for a complete list of options.
Using C/C++ SDK API¶
The System Information API can be accessed by including a single header file
and linking the libpsyiage
shared library. See Advanced Setup - Building your application with libpsyiage for details.
Print CPU details to stdout¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #include <psyiage/psyiagesdk.h>
int main(int argc, char **argv)
{
psyiage_handle pah; // handle to psyiage instance
/* ... Initialize code omitted for simplicity ... */
// Get the system information
rc = psyiage_sysinfo_get(pah, &sysinfo );
// Print out the system information
printf("CPU Architecture:\t%s\n", sysinfo.cpuinfo.architecture);
printf("CPU Features:\t%s\n", sysinfo.cpuinfo.features);
switch (sysinfo.cpuinfo.archtype)
{
case ARCH_X86:
printf("Vendor:\t%s\n", sysinfo.cpuinfo.X86Info.vendor);
printf("Brand:\t%s\n", sysinfo.cpuinfo.X86Info.brand);
printf("Microarchitecture:\t%s\n", sysinfo.cpuinfo.X86Info.uarch);
printf("Family:\t0x%x\n", sysinfo.cpuinfo.X86Info.family);
printf("Model:\t0x%x\n", sysinfo.cpuinfo.X86Info.model);
printf("Stepping:\t0x%x\n", sysinfo.cpuinfo.X86Info.stepping);
break;
case ARCH_ARM:
printf("Implementer:\t0x%x\n", sysinfo.cpuinfo.ArmInfo.implementer);
printf("Microarchitecture:\t0x%x\n", sysinfo.cpuinfo.ArmInfo.architecture);
printf("Variant:\t0x%x\n", sysinfo.cpuinfo.ArmInfo.variant);
printf("Part:\t0x%x\n", sysinfo.cpuinfo.ArmInfo.part);
printf("Revision:\t0x%x\n", sysinfo.cpuinfo.ArmInfo.revision);
break;
default:
break;
}
/* ... Cleanup code omitted for simplicity ... */
}
|
Sample system information output¶
{
"SysInfo": {
"CPUInfo": {
"ThreadsPerCore": 1,
"CoresPerPackage": 1,
"NumPackages": 8,
"Vendor": "GenuineIntel",
"Model": "Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz",
"Architecture": "x86",
"Features": "aes avx avx2 bmi1 bmi2 cx16 erms f16c fma3 sse4_1 sse4_2 ssse3 ",
"Endian": "Little Endian",
"ClockMhz": 2808,
"X86Info": {
"Microarchitecture": "INTEL_KBL",
"Family": 6,
"Model": 158,
"Stepping": 9
},
"CacheInfo": [
{
"Level": 1,
"Size": 32768,
"LineSize": 64,
"Associativity": 8,
"Type": "Data"
},
{
"Level": 1,
"Size": 32768,
"LineSize": 64,
"Associativity": 8,
"Type": "Instruction"
},
{
"Level": 2,
"Size": 262144,
"LineSize": 64,
"Associativity": 4,
"Type": "Unified"
},
{
"Level": 3,
"Size": 6291456,
"LineSize": 64,
"Associativity": 12,
"Type": "Unified"
}
]
},
"MemInfo": {
"TotalRAM": 8339906560,
"FreeRAM": 123629568,
"SharedRAM": 1137197056,
"BufferRAM": 14872576,
"TotalSwap": 8587309056,
"FreeSwap": 4164923392,
"TotalHiMem": 0,
"FreeHiMem": 0,
"NumProcesses": 1106
},
"FileSystemInfo": [
{
"Device": "/dev/sda1",
"MountDir": "/",
"FileSystem": "ext4",
"MountOpts": "rw,relatime,errors=remount-ro,d",
"BlockSize": 4096,
"FragSize": 4096,
"TotalBlocks": 8223964,
"FreeBlocks": 914408,
"AvailBlocks": 490895,
"TotalInodes": 2097152,
"FreeInodes": 1239254,
"AvailInodes": 1239254,
"FileSystemID": 272869076,
"FileSystemFlags": 4096
},
{
"Device": "/home/psygig/.Private",
"MountDir": "/home/psygig",
"FileSystem": "ecryptfs",
"MountOpts": "rw,nosuid,nodev,relatime,ecrypt",
"BlockSize": 4096,
"FragSize": 4096,
"TotalBlocks": 8223964,
"FreeBlocks": 914408,
"AvailBlocks": 490895,
"TotalInodes": 2097152,
"FreeInodes": 1239254,
"AvailInodes": 1239254,
"FileSystemID": 272869076,
"FileSystemFlags": 4102
}
],
"OSInfo": {
"Name": "Ubuntu",
"FullName": "Ubuntu 16.04.5 LTS",
"CodeName": "xenial",
"Major": 16,
"Minor": 4,
"Patch": 5,
"Build": 0,
"KernelInfo": {
"Name": "Linux",
"Major": 4,
"Minor": 15,
"Patch": 0,
"Build": 43
}
},
"USBInfo": [
{
"Product": "xHCI Host Controller",
"Manufacturer": "Linux 4.15.0-43-generic xhci-hcd",
"DeviceClass": "Hub",
"Version": "4.15",
"Serial": "0000:03:00.0",
"UsbVersion": " 2.00",
"ProductId": 2,
"VendorId": 7531
},
{
"Product": "EHCI Host Controller",
"Manufacturer": "Linux 4.15.0-43-generic ehci_hcd",
"DeviceClass": "Hub",
"Version": "4.15",
"Serial": "0000:02:03.0",
"UsbVersion": " 2.00",
"ProductId": 2,
"VendorId": 7531
},
{
"Product": "VMware Virtual USB Hub",
"Manufacturer": "",
"DeviceClass": "Hub",
"Version": "1.0",
"Serial": "",
"UsbVersion": " 2.00",
"ProductId": 2,
"VendorId": 3599
},
{
"Product": "Virtual Bluetooth Adapter",
"Manufacturer": "VMware",
"DeviceClass": "Wireless Controller",
"Version": "1.0",
"Serial": "000650268328",
"UsbVersion": " 2.00",
"ProductId": 8,
"VendorId": 3599
},
{
"Product": "xHCI Host Controller",
"Manufacturer": "Linux 4.15.0-43-generic xhci-hcd",
"DeviceClass": "Hub",
"Version": "4.15",
"Serial": "0000:03:00.0",
"UsbVersion": " 3.00",
"ProductId": 3,
"VendorId": 7531
},
{
"Product": "VMware Virtual USB Hub",
"Manufacturer": "",
"DeviceClass": "Hub",
"Version": "1.0",
"Serial": "",
"UsbVersion": " 1.10",
"ProductId": 2,
"VendorId": 3599
},
{
"Product": "UHCI Host Controller",
"Manufacturer": "Linux 4.15.0-43-generic uhci_hcd",
"DeviceClass": "Hub",
"Version": "4.15",
"Serial": "0000:02:00.0",
"UsbVersion": " 1.10",
"ProductId": 1,
"VendorId": 7531
},
{
"Product": "VMware Virtual USB Hub",
"Manufacturer": "",
"DeviceClass": "Hub",
"Version": "1.0",
"Serial": "",
"UsbVersion": " 1.10",
"ProductId": 2,
"VendorId": 3599
},
{
"Product": "VMware Virtual USB Mouse",
"Manufacturer": "VMware",
"DeviceClass": "Unknown",
"Version": "1.3",
"Serial": "",
"UsbVersion": " 1.10",
"ProductId": 3,
"VendorId": 3599
}
],
"DiskInfo": [
{
"Device": "sr0",
"Model": "VMware SATA CD01",
"Vendor": "NECVMWar",
"Serial": "",
"Size": 1073741312,
"PartitionInfo": []
},
{
"Device": "sda",
"Model": "VMware Virtual S",
"Vendor": "VMware, ",
"Serial": "",
"Size": 42949672960,
"PartitionInfo": [
{
"PartNum": 2,
"Start": 34360785920,
"Size": 1024
},
{
"PartNum": 5,
"Start": 34360786944,
"Size": 8587837440
},
{
"PartNum": 1,
"Start": 1048576,
"Size": 34358689792
}
]
}
]
}
}