GitHub user kiszk opened a pull request:
https://github.com/apache/spark/pull/12411
[SPARK-14656][Core] Fix Benchmark.getPorcessorName() always return "Unknown
processor" on Linux
## What changes were proposed in this pull request?
This PR returns correct processor name in ```/proc/cpuinfo``` on Linux from
```Benchmark.getPorcessorName()```. Now, this return ```Unknown processor```.
Since ```Utils.executeAndGetOutput(Seq("which", "grep"))``` return
```/bin/grep\n```, it is failed to execute ```/bin/grep\n```. This PR strips
```\n``` at the end of the line.
Before applying this PR
````
Java HotSpot(TM) 64-Bit Server VM 1.8.0_66-b17 on Linux
2.6.32-504.el6.x86_64
Unknown processor
back-to-back filter: Best/Avg Time(ms) Rate(M/s) Per
Row(ns) Relative
-------------------------------------------------------------------------------------------
Dataset 472 / 503 21.2
47.2 1.0X
DataFrame 51 / 58 198.0
5.1 9.3X
RDD 189 / 211 52.8
18.9 2.5X
````
After applying this PR
```
Java HotSpot(TM) 64-Bit Server VM 1.8.0_66-b17 on Linux
2.6.32-504.el6.x86_64
Intel(R) Xeon(R) CPU E5-2667 v2 @ 3.30GHz
back-to-back filter: Best/Avg Time(ms) Rate(M/s) Per
Row(ns) Relative
-------------------------------------------------------------------------------------------
Dataset 490 / 502 20.4
49.0 1.0X
DataFrame 55 / 61 183.4
5.5 9.0X
RDD 210 / 237 47.7
21.0 2.3X
```
## How was this patch tested?
Run Benchmark programs on Linux by hand
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/kiszk/spark SPARK-14656
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/12411.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #12411
----
commit a3dbb2a00914ac26723521decae7af0599acd7d7
Author: Kazuaki Ishizaki <[email protected]>
Date: 2016-04-15T08:55:41Z
strip LF at the line end of a result of 'which' to corretly execute 'grep'
commit b6ea54e0185413fc3e09cb364564b5a4c27a6f68
Author: Kazuaki Ishizaki <[email protected]>
Date: 2016-04-15T09:10:45Z
strip LF at the line end of a result of 'grep'
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]