Comments (10)
We could probably generate the constant in x/sys/Unix and then not worry about it. Easier to push it upstream since the build infrastructure is there.
from procfs.
(And yes, I know that procfs did originally query for the value, but it was replaced with a constant for "reasons")
When this was last looked at, all supported platforms used 100.
from procfs.
The node_exporter
was not designed to run in containers, it is a host system level tool.
from procfs.
So we removed it as the necessary cgo dependency forced too much overhead in crossbuilds. Could we come up with a simple solution here, like defining the constant in per architecture files and use build flags?
from procfs.
@SuperQ LX zones should be considered to be similar to full VMs rather than linux containers. We're not talking about LXC or Docker here.
from procfs.
Could we come up with a simple solution here, like defining the constant in per architecture files and use build flags?
The setup here is sufficiently weird that the setting may not be the one we expect for the architecture.
Which architecture is this?
from procfs.
I should have said per operating system files
. It seems SmartOS will just be recognized as Solaris
in golang, and I don't know whether all Solaris variants use USER_HZ=1000.
We could re-introduce C code for the syscall in something like user_hz_solaris.go
and continue to use the hardcoded value in user_hz.go
.
@zegelin Do you know how to query for the USER_HZ value in solaris?
from procfs.
USER_HZ
is a Linux thing, Solaris doesn't have it.
from procfs.
Oh, now I see the issue I guess. From the perspective of the program running in the LX zone, the OS will be Linux.
I'm very hesitant of introducing a C dependency just for that exception. @zegelin Does LX provide any hint about the environment we could query for without a systemcall?
from procfs.
Which architecture is this?
x86_64
@grobie
Exactly. Processes running in a LX zone think they are running on Linux even though the host is actually Solaris.
Does LX provide any hint about the environment we could query for without a systemcall?
There is a sysctl that returns:
kernel.osrelease = BrandZ virtual linux
LX emulates /proc
:
# cat /proc/sys/kernel/osrelease
BrandZ virtual linux
from procfs.
Related Issues (20)
- strings.TrimRight is used instead of TrimSuffix HOT 1
- Use Go 1.20+ Error Wrapping
- Release v0.10.0 does not build with GOOS=windows + GOARCH=amd64 HOT 1
- Slice bound out of range on filterOfflineCPUs HOT 4
- CPU vulnerability reporting from sysfs is broken
- Codespell CI job is broken HOT 6
- netstat.go: File handler leak HOT 2
- Infiniband: could not get ARP entries: failed to parse ARP entry HOT 2
- Couldn't parse \"/proc/stat\": bufio.Scanner: token too long HOT 4
- Export mdstat parsing function HOT 6
- No longer compiles on plan9 HOT 3
- code comment error HOT 1
- parseMemInfo() ignores unit, leading to incorrect results from /proc/meminfo HOT 4
- Unknown NFSd metric line "wdeleg_getattr" on kernel 6.6-rc1 HOT 2
- Add the Scorecard Action to monitor procfs' security posture HOT 2
- procfs has data consistency issues when reading /proc/net/tcp HOT 3
- Feature request: procfs TotalFileDescriptorsLen HOT 4
- CmdLine does not parse argv[i] with whitespace correctly HOT 1
- open /proc/stat: too many open files HOT 2
- procfs still unable to collect IB counters
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from procfs.