Commit 7d4210d
Fix "Unknown Processor" on Windows if WMIC is not present (#2749)
* allow MosCpuDetector to run on .NET 5+
* Revert "allow MosCpuDetector to run on .NET 5+"
This reverts commit 495855a.
* add WmiLightCpu Detector
* Fix WmicCpuDetector being chosen if not available
* enable NativeAOT
* simplify IsApplicable
* Update spacing of SupportedOsPlatform attribute
Co-authored-by: Tim Cassell <[email protected]>
* Revert "Fix WmicCpuDetector being chosen if not available"
This reverts commit 5972f77.
* add WMIC deprecation remarks
* remove WmiLight code
* update WmiCpuInfoParser to return null if Processor Name isn't detected
* remove WmiLightCpuDetector reference from WindowsCpuDetector
* Update WmicCpuInfoParser.cs
* check if wmicOutput is null or empty instead
* add PowershellWmiCpuDetector (parser still not complete)
* return null if there's no version of powershell installed
* fix Powershell 7+ check
Co-authored-by: Tim Cassell <[email protected]>
* rework search statement given that regex isn't supported
* add parser code
* add PowershellWmiCpuDetector to WindowsCpuDetector
* rename variable to lower case
* improve checking of latest powershell 7+ version
* use explicit typing
* fix frequency addition issue
* revert to how WMIC parser handles processor frequency
* add string is null or empty check to WmiCpuDetector
* invoke Powershell as "PowerShell" if the file isn't found
* add nominal Frequency detection and improve max frequency detection
* fix issue with detecting latest Powershell
* update comment
* Update PowershellWmiCpuDetector.cs
* refactor Powershell locating code to PowershellLocator
* simplify frequency checks
* Create PowershellWmiParserTests.cs
* fix null being returned when object is expected.
* rename test
* simplify max frequency check
Co-authored-by: Tim Cassell <[email protected]>
* use """ for string in parser test
* Update PowershellWmiCpuInfoParserTests.cs
* reduce indentation with """
* remove unnecessary test info
* move string null check to caller
* add nominal frequency support for MosCpuDetector
* Update src/BenchmarkDotNet/Detectors/Cpu/Windows/PowershellWmiCpuDetector.cs
Co-authored-by: Tim Cassell <[email protected]>
* remove nullability of parser
Co-authored-by: Tim Cassell <[email protected]>
* check if tempMaxFrequency > 0 before assignment
Co-authored-by: Tim Cassell <[email protected]>
* remove nullability of WmicCpuInfoParser
* use file scoped namespace
* use double instead of int
* add null check to LinuxCpuDetector
* change nullability of LinuxCpuParser
* update LinuxCpuInfoParser nominal and max frequency detection
* Update LinuxCpuInfoParser.cs
* fix nullability check
* simplify nominal frequency comparison
Co-authored-by: Tim Cassell <[email protected]>
* add null check to macOS
* don't accept null string from detector
* fix LinuxCpuInfo parser test issues and improve robustness of Linux Cpu checks
* fix Powershell Wmi Parser parsing issues
* fix .net framework cpu parsing issue
* do implicit conversion to double from uint
---------
Co-authored-by: Tim Cassell <[email protected]>1 parent ffce52e commit 7d4210d
File tree
14 files changed
+444
-45
lines changed- src/BenchmarkDotNet
- Detectors/Cpu
- Linux
- Windows
- macOS
- Helpers
- tests/BenchmarkDotNet.Tests/Detectors/Cpu
14 files changed
+444
-45
lines changedLines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
Lines changed: 60 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
| |||
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
31 | | - | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
36 | | - | |
| 39 | + | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
| |||
51 | 55 | | |
52 | 56 | | |
53 | 57 | | |
54 | | - | |
| 58 | + | |
| 59 | + | |
55 | 60 | | |
56 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
57 | 90 | | |
58 | 91 | | |
59 | 92 | | |
60 | 93 | | |
61 | | - | |
| 94 | + | |
62 | 95 | | |
63 | 96 | | |
64 | 97 | | |
| |||
70 | 103 | | |
71 | 104 | | |
72 | 105 | | |
73 | | - | |
74 | | - | |
| 106 | + | |
| 107 | + | |
75 | 108 | | |
76 | 109 | | |
77 | 110 | | |
| |||
82 | 115 | | |
83 | 116 | | |
84 | 117 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | 118 | | |
90 | 119 | | |
91 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
92 | 137 | | |
93 | 138 | | |
94 | 139 | | |
95 | 140 | | |
96 | 141 | | |
97 | 142 | | |
98 | | - | |
99 | | - | |
| 143 | + | |
| 144 | + | |
100 | 145 | | |
101 | 146 | | |
102 | 147 | | |
| |||
107 | 152 | | |
108 | 153 | | |
109 | 154 | | |
110 | | - | |
| 155 | + | |
111 | 156 | | |
112 | 157 | | |
113 | 158 | | |
| |||
Lines changed: 18 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
44 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
45 | 53 | | |
46 | 54 | | |
47 | 55 | | |
48 | 56 | | |
49 | 57 | | |
50 | | - | |
51 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
52 | 63 | | |
53 | 64 | | |
54 | 65 | | |
| |||
57 | 68 | | |
58 | 69 | | |
59 | 70 | | |
60 | | - | |
61 | | - | |
| 71 | + | |
| 72 | + | |
62 | 73 | | |
63 | 74 | | |
64 | 75 | | |
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
Lines changed: 67 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
0 commit comments