diff --git a/.gitmodules b/.gitmodules index 28dfb90..efa14ef 100644 --- a/.gitmodules +++ b/.gitmodules @@ -30,6 +30,12 @@ [submodule "submodules/linux"] path = submodules/linux url = https://github.com/cirosantilli/linux +[submodule "submodules/lmbench"] + path = submodules/lmbench + url = https://github.com/cirosantilli/lmbench +[submodule "submodules/omp-validation"] + path = submodules/omp-validation + url = https://github.com/cirosantilli/omp-validation [submodule "submodules/parsec-benchmark"] path = submodules/parsec-benchmark url = https://github.com/cirosantilli/parsec-benchmark @@ -42,6 +48,3 @@ [submodule "submodules/stream-benchmark"] path = submodules/stream-benchmark url = https://github.com/cirosantilli/stream-benchmark -[submodule "submodules/omp-validation"] - path = submodules/omp-validation - url = https://github.com/cirosantilli/omp-validation diff --git a/README.adoc b/README.adoc index a9717ed..4161ca7 100644 --- a/README.adoc +++ b/README.adoc @@ -18147,7 +18147,7 @@ Aborted (core dumped) Get the failing command with: -,,.. +.... make VERBOSE=1 model-armv8 .... @@ -19718,6 +19718,8 @@ Examples: * `fs` ** link:rootfs_overlay/lkmc/nodejs/file_write_read.js[] ** link:rootfs_overlay/lkmc/nodejs/read_stdin_to_string.js[] Question: https://stackoverflow.com/questions/30441025/read-all-text-from-stdin-to-a-string +* `class` +** link:rootfs_overlay/lkmc/nodejs/object_to_string.js[]: `util.inspect.custom` and `toString` override experiment: https://stackoverflow.com/questions/24902061/is-there-an-repr-equivalent-for-javascript/26698403#26698403 ===== NPM diff --git a/nodejs b/nodejs new file mode 120000 index 0000000..b0494e0 --- /dev/null +++ b/nodejs @@ -0,0 +1 @@ +rootfs_overlay/lkmc/nodejs/ \ No newline at end of file diff --git a/python b/python new file mode 120000 index 0000000..cb06030 --- /dev/null +++ b/python @@ -0,0 +1 @@ +rootfs_overlay/lkmc/python/ \ No newline at end of file diff --git a/rootfs_overlay/lkmc/nodejs/object_to_string.js b/rootfs_overlay/lkmc/nodejs/object_to_string.js new file mode 100755 index 0000000..73100e0 --- /dev/null +++ b/rootfs_overlay/lkmc/nodejs/object_to_string.js @@ -0,0 +1,36 @@ +#!/usr/bin/env node + +// https://cirosantilli.com/linux-kernel-module-cheat#node-js + + +const util = require('util'); + +class MyClassUtilInspectCustom { + constructor(a, b) { + this.a = a; + this.b = b; + } + [util.inspect.custom]() { + return `my type is MyClassUtilInspectCustom and a is ${this.a} and b is ${this.b}`; + } +} + +let my_object = new MyClassUtilInspectCustom(1, 2); +console.log(util.inspect(my_object)); +console.log(my_object); +console.log(my_object.toString()); + +class MyClassToString { + constructor(a, b) { + this.a = a; + this.b = b; + } + toString() { + return `my type is MyClassToString and a is ${this.a} and b is ${this.b}`; + } +} + +my_object = new MyClassToString(1, 2); +console.log(util.inspect(my_object)); +console.log(my_object); +console.log(my_object.toString()); diff --git a/submodules/lmbench b/submodules/lmbench new file mode 160000 index 0000000..5ddee65 --- /dev/null +++ b/submodules/lmbench @@ -0,0 +1 @@ +Subproject commit 5ddee6553420077873891c2706a02e095466ca4c