aboutsummaryrefslogtreecommitdiff
path: root/src/internal/sysinfo/sysinfo.go
AgeCommit message (Collapse)Author
2024-05-07internal/sysinfo: rename osCpuInfoName to osCPUInfoNameTobias Klauser
Follow https://go.dev/wiki/CodeReviewComments#initialisms Change-Id: Ie7418cebb0eda130e7db5bc91475a4a4012192dc Reviewed-on: https://go-review.googlesource.com/c/go/+/583716 Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-03internal/sysinfo: use sync.OnceValue for CPUNameTobias Klauser
Change-Id: I0f3ae97f2bd5ff3f533c5bf4570a8cda8b92b16a Reviewed-on: https://go-review.googlesource.com/c/go/+/582836 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
2023-08-17internal/sysinfo: print cpu type from cpuinfo when internal cpu name is ↵Guoqi Chen
empty on Linux Supports all linux operating systems. currently tested on x86, mips64le and loong64. Example output: $ go test -bench=.* goos: linux goarch: loong64 pkg: runtime cpu: Loongson-3A5000-HV @ 2500.00MHz BenchmarkSemTable/OneAddrCollision/n=1000 19261 62302 ns/op ... Change-Id: I02db12d70c11327e4625bb6e59f30dfaf37c2db0 Reviewed-on: https://go-review.googlesource.com/c/go/+/508735 Reviewed-by: Meidan Li <limeidan@loongson.cn> Reviewed-by: Russ Cox <rsc@golang.org> TryBot-Bypass: Russ Cox <rsc@golang.org> Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Russ Cox <rsc@golang.org>
2020-10-20testing: print cpu type as label for benchmarksMartin Möhrmann
Supports 386 and amd64 architectures on all operating systems. Example output: $ go test -bench=.* goos: darwin goarch: amd64 pkg: strconv cpu: Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz BenchmarkAtof64Decimal-4 24431032 46.8 ns/op ... As the displayed CPU information is only used for information purposes it is lazily initialized when needed using the new internal/sysinfo package. This allows internal/cpu to stay without dependencies and avoid initialization costs when the CPU information is not needed as the new code to query the CPU name in internal/cpu can be dead code eliminated if not used. Fixes #39214 Change-Id: I77ae5c5d2fed6b28fa78dd45075f9f0a6a7f1bfd Reviewed-on: https://go-review.googlesource.com/c/go/+/263804 Trust: Martin Möhrmann <moehrmann@google.com> Reviewed-by: Keith Randall <khr@golang.org>