<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>132286</bug_id>
          
          <creation_ts>2014-04-28 10:34:12 -0700</creation_ts>
          <short_desc>run-jsc-stress-tests: Silence warning about kernel interface hw.activecpu not available on Linux</short_desc>
          <delta_ts>2014-05-03 20:19:00 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Carlos Alberto Lopez Perez">clopez</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>darin</cc>
    
    <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>oliver</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1004640</commentid>
    <comment_count>0</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2014-04-28 10:34:12 -0700</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1004642</commentid>
    <comment_count>1</comment_count>
      <attachid>230306</attachid>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2014-04-28 10:39:08 -0700</bug_when>
    <thetext>Created attachment 230306
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1005233</commentid>
    <comment_count>2</comment_count>
      <attachid>230306</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2014-04-29 17:37:38 -0700</bug_when>
    <thetext>Comment on attachment 230306
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=230306&amp;action=review

&gt; Tools/Scripts/run-jsc-stress-tests:77
&gt; +    $numProcessors = `sysctl -n hw.activecpu 2&gt;/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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1005640</commentid>
    <comment_count>3</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2014-04-30 20:16:41 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; I suggest this instead:
&gt; 
&gt;     $numProcessors = `sysctl -i -n hw.activecpu`.to_i
&gt; 
&gt; 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 &quot;-i&quot; don&apos;t works on Linux....

If you pass the flag &quot;-i&quot; to sysctl on Linux you will get this:

$ sysctl -i -n hw.activecpu
sysctl: invalid option -- &apos;i&apos;

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[=&lt;file&gt;]  read values from file
  -f                   alias of -p
      --system         read values from all system directories
  -r, --pattern &lt;expression&gt;
                       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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1005647</commentid>
    <comment_count>4</comment_count>
      <attachid>230306</attachid>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2014-04-30 20:49:23 -0700</bug_when>
    <thetext>Comment on attachment 230306
Patch

I think this is fine.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1005648</commentid>
    <comment_count>5</comment_count>
      <attachid>230306</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-04-30 21:20:44 -0700</bug_when>
    <thetext>Comment on attachment 230306
Patch

Clearing flags on attachment: 230306

Committed r168083: &lt;http://trac.webkit.org/changeset/168083&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1005649</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-04-30 21:20:48 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1006454</commentid>
    <comment_count>7</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2014-05-03 20:19:00 -0700</bug_when>
    <thetext>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.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>230306</attachid>
            <date>2014-04-28 10:39:08 -0700</date>
            <delta_ts>2014-04-30 21:20:44 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-132286-20140428193845.patch</filename>
            <type>text/plain</type>
            <size>1172</size>
            <attacher name="Carlos Alberto Lopez Perez">clopez</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTY3ODg4CmRpZmYgLS1naXQgYS9Ub29scy9DaGFuZ2VMb2cg
Yi9Ub29scy9DaGFuZ2VMb2cKaW5kZXggMjY5ZDMxZjVjNzgyYWE3NWJjYzYxZTM3MzY2MGM2MDkz
ZmJiZWYyNS4uYjY5ODkwZTg0Njg3NThkZmQ2MjliMGYxMmFjMWFjNTcwMmE4M2VlYSAxMDA2NDQK
LS0tIGEvVG9vbHMvQ2hhbmdlTG9nCisrKyBiL1Rvb2xzL0NoYW5nZUxvZwpAQCAtMSwzICsxLDEz
IEBACisyMDE0LTA0LTI4ICBDYXJsb3MgQWxiZXJ0byBMb3BleiBQZXJleiAgPGNsb3BlekBpZ2Fs
aWEuY29tPgorCisgICAgICAgIEtlcm5lbCBzeXNjdGwgaW50ZXJmYWNlIGh3LmFjdGl2ZWNwdSBk
b24ndCBleGlzdHMgb24gTGludXguCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3No
b3dfYnVnLmNnaT9pZD0xMzIyODYKKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMh
KS4KKworICAgICAgICAqIFNjcmlwdHMvcnVuLWpzYy1zdHJlc3MtdGVzdHM6IFJlZGlyZWN0IHN0
ZGVyciB0byBudWxsIHdoZW4KKyAgICAgICAgY2FsbGluZyBzeXNjdGwgb3ZlciBody5hY3RpdmVj
cHUKKwogMjAxNC0wNC0yNyAgSm9vbmdodW4gUGFyayAgPGpoNzE4LnBhcmtAc2Ftc3VuZy5jb20+
CiAKICAgICAgICAgW0VGTF0gUmVtb3ZlIGluZGV4ZWREQidzIGRlcGVuZGVuY3kgb24gbGV2ZWxk
YiBhbmQgZGlzYWJsZSBpbmRleGVkREIKZGlmZiAtLWdpdCBhL1Rvb2xzL1NjcmlwdHMvcnVuLWpz
Yy1zdHJlc3MtdGVzdHMgYi9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