When running the run-jsc-stress-tests script, on Linux systems the following warning shows: sysctl: cannot stat /proc/sys/hw/activecpu: No such file or directory That kernel interface (hw.activecpu) is not available on Linux. The script gets right the number of CPUs because it fallbacks later to the nproc utility. However the warning about hw.activecpu should be hidden.
Created attachment 230306 [details] Patch
Comment on attachment 230306 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=230306&action=review > Tools/Scripts/run-jsc-stress-tests:77 > + $numProcessors = `sysctl -n hw.activecpu 2>/dev/null`.to_i I suggest this instead: $numProcessors = `sysctl -i -n hw.activecpu`.to_i That’s much better than hiding all possible errors by routing them to /dev/null.
(In reply to comment #2) > I suggest this instead: > > $numProcessors = `sysctl -i -n hw.activecpu`.to_i > > That’s much better than hiding all possible errors by routing them to /dev/null. The idea of the patch was precisely to hide the stderr output. IMHO there is no point on printing any error that sysctl can give, because in that case, then the current codebase already does another try that uses the system utility nproc. (which is how it gets the number of CPUs on Linux) Also, your suggestion of passing "-i" don't works on Linux.... If you pass the flag "-i" to sysctl on Linux you will get this: $ sysctl -i -n hw.activecpu sysctl: invalid option -- 'i' Usage: sysctl [options] [variable[=value] ...] Options: -a, --all display all variables -A alias of -a -X alias of -a --deprecated include deprecated parameters to listing -b, --binary print value without new line -e, --ignore ignore unknown variables errors -N, --names print variable names without values -n, --values print only values of a variables -p, --load[=<file>] read values from file -f alias of -p --system read values from all system directories -r, --pattern <expression> select setting that match expression -q, --quiet do not echo variable set -w, --write enable writing a value to variable -o does nothing -x does nothing -d alias of -h -h, --help display this help and exit -V, --version output version information and exit For more details see sysctl(8). .... which makes the noise even worse
Comment on attachment 230306 [details] Patch I think this is fine.
Comment on attachment 230306 [details] Patch Clearing flags on attachment: 230306 Committed r168083: <http://trac.webkit.org/changeset/168083>
All reviewed patches have been landed. Closing bug.
I’m fine with the patch we landed, but I don’t agree that we want to hide all error output. Ideally, we’d want to hide the “I never heard of hw.activecpu before” error, but if there are other types of errors we’d like to see them. Anyway, not a big deal and OK like this.