number of cores with userland cat

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2020-06-03 08:00:07 +00:00
parent 6202b44eba
commit 83714691d0

View File

@@ -11016,12 +11016,23 @@ cat /proc/cpuinfo
getconf _NPROCESSORS_CONF getconf _NPROCESSORS_CONF
.... ....
Or from <<user-mode-simulation>>, we can use <<sysconf>> with link:userland/linux/sysconf.c[] or <<cpp-multithreading>>'s link:userland/cpp/thread_hardware_concurrency.cpp[]: Or from <<user-mode-simulation>>, we can use either of:
* <<sysconf>> with link:userland/linux/sysconf.c[]
+
.... ....
./run --cpus 2 --emulator gem5 --userland userland/linux/sysconf.c | grep _SC_NPROCESSORS_ONLN ./run --cpus 2 --emulator gem5 --userland userland/linux/sysconf.c | grep _SC_NPROCESSORS_ONLN
....
* <<cpp-multithreading>>'s link:userland/cpp/thread_hardware_concurrency.cpp[]:
+
....
./run --cpus 2 --emulator gem5 --userland userland/cpp/thread_hardware_concurrency.cpp ./run --cpus 2 --emulator gem5 --userland userland/cpp/thread_hardware_concurrency.cpp
.... ....
* direct access to several special filesystem files that contain this information e.g. via link:userland/c/cat.c[]:
+
....
./run --cpus 2 --emulator gem5 --userland userland/c/cat.c --cli-args /proc/cpuinfo
....
====== QEMU user mode multithreading ====== QEMU user mode multithreading