Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add processor field for /proc/[pid]/stat #461

Merged
merged 1 commit into from
Dec 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add processor field for /proc/[pid]/stat
Signed-off-by: peter wang <wangbo.red@gmail.com>
xixiliguo committed Jul 17, 2022

Verified

This commit was signed with the committer’s verified signature.
DylanTinianov Dylan Tinianov
commit c66e798b9747108851db2cb03f932a67c6ebd5ee
4 changes: 3 additions & 1 deletion proc_stat.go
Original file line number Diff line number Diff line change
@@ -102,6 +102,8 @@ type ProcStat struct {
RSS int
// Soft limit in bytes on the rss of the process.
RSSLimit uint64
// CPU number last executed on.
Processor uint
// Real-time scheduling priority, a number in the range 1 to 99 for processes
// scheduled under a real-time policy, or 0, for non-real-time processes.
RTPriority uint
@@ -184,7 +186,7 @@ func (p Proc) Stat() (ProcStat, error) {
&ignoreUint64,
&ignoreUint64,
&ignoreInt64,
&ignoreInt64,
&s.Processor,
&s.RTPriority,
&s.Policy,
&s.DelayAcctBlkIOTicks,
1 change: 1 addition & 0 deletions proc_stat_test.go
Original file line number Diff line number Diff line change
@@ -68,6 +68,7 @@ func TestProcStat(t *testing.T) {
want uint
have uint
}{
{name: "processor", want: 0, have: s.Processor},
{name: "rt_priority", want: 0, have: s.RTPriority},
{name: "policy", want: 0, have: s.Policy},
} {