nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: prometheus/procfs
Pull request #461 (2022-07-17 16:29:07)

add processor field for /proc/[pid]/stat
When analysing performance issue, it is useful to know process run on which cpu.


Signed-off-by: peter wang wangbo.red@gmail.com


Patch:
diff --git a/proc_stat.go b/proc_stat.go
index 06c556e..b278eb2 100644
--- a/proc_stat.go
+++ b/proc_stat.go
@@ -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,


Test patch:
diff --git a/proc_stat_test.go b/proc_stat_test.go
index 8be1e13..8abd67f 100644
--- a/proc_stat_test.go
+++ b/proc_stat_test.go
@@ -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},
 	} {
Repository: prometheus/procfs
Pull request #573 (2023-09-20 10:02:06)

Fixup nfs naming
Fix golangci-lint revive naming issues.


Patch:
diff --git a/nfs/nfs.go b/nfs/nfs.go
index c0d3a11..ebc0598 100644
--- a/nfs/nfs.go
+++ b/nfs/nfs.go
@@ -246,8 +246,8 @@ type V4Ops struct {
 	SaveFH             uint64
 	SecInfo            uint64
 	SetAttr            uint64
-	SetClientId        uint64
-	SetClientIdConfirm uint64
+	SetClientID        uint64
+	SetClientIDConfirm uint64
 	Verify             uint64
 	Write              uint64
 	RelLockOwner       uint64
diff --git a/nfs/parse.go b/nfs/parse.go
index 15f8c35..76e74cb 100644
--- a/nfs/parse.go
+++ b/nfs/parse.go
@@ -314,8 +314,8 @@ func parseV4Ops(v []uint64) (V4Ops, error) {
 		SaveFH:             v[33],
 		SecInfo:            v[34],
 		SetAttr:            v[35],
-		SetClientId:        v[36],
-		SetClientIdConfirm: v[37],
+		SetClientID:        v[36],
+		SetClientIDConfirm: v[37],
 		Verify:             v[38],
 		Write:              v[39],
 		RelLockOwner:       v40,


Test patch:
diff --git a/nfs/parse_nfsd_test.go b/nfs/parse_nfsd_test.go
index 449eba2..0d9d94c 100644
--- a/nfs/parse_nfsd_test.go
+++ b/nfs/parse_nfsd_test.go
@@ -169,8 +169,8 @@ proc4ops 72 0 0 0 1098 2 0 0 0 0 8179 5896 0 0 0 0 5900 0 0 2 0 2 0 9609 0 2 150
 					SaveFH:             0,
 					SecInfo:            0,
 					SetAttr:            0,
-					SetClientId:        3,
-					SetClientIdConfirm: 3,
+					SetClientID:        3,
+					SetClientIDConfirm: 3,
 					Verify:             0,
 					Write:              0,
 					RelLockOwner:       0,
@@ -312,8 +312,8 @@ proc4ops 40 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
 					SaveFH:             0,
 					SecInfo:            0,
 					SetAttr:            0,
-					SetClientId:        0,
-					SetClientIdConfirm: 0,
+					SetClientID:        0,
+					SetClientIDConfirm: 0,
 					Verify:             0,
 					Write:              0,
 					RelLockOwner:       0,
@@ -456,8 +456,8 @@ proc4ops 59 0 0 0 18112 8341 0 0 0 3239 71595 11834 0 0 0 0 107097 0 0 8344 0 51
 					SaveFH:             8344,
 					SecInfo:            0,
 					SetAttr:            0,
-					SetClientId:        134,
-					SetClientIdConfirm: 134,
+					SetClientID:        134,
+					SetClientIDConfirm: 134,
 					Verify:             0,
 					Write:              0,
 					RelLockOwner:       0,
@@ -599,8 +599,8 @@ proc4ops 39 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
 					SaveFH:             0,
 					SecInfo:            0,
 					SetAttr:            0,
-					SetClientId:        0,
-					SetClientIdConfirm: 0,
+					SetClientID:        0,
+					SetClientIDConfirm: 0,
 					Verify:             0,
 					Write:              39,
 					RelLockOwner:       0,