[Webkit-unassigned] [Bug 132286] run-jsc-stress-tests: Silence warning about kernel interface hw.activecpu not available on Linux

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 30 20:16:22 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=132286





--- Comment #3 from Carlos Alberto Lopez Perez <clopez at igalia.com>  2014-04-30 20:16:41 PST ---
(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

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list