Skip to content

Commit b191896

Browse files
author
Pavel Safonov
committed
better logging
1 parent 0921bf5 commit b191896

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

pkg/pin.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,9 @@ func (x *PinState) PinLoad(ctx *Context) error {
395395

396396
assignedCount := node.assignCores(ctx, procInfo)
397397
if assignedCount != cpuCount {
398-
log.Warningf("PinState PinLoad, node.assignCores failed, assignedCount = %d need cpuCount = %d", assignedCount, cpuCount)
398+
vmName, _ := parseVmName(procInfo.ProcInfo.Cmd)
399+
nodeState := node.StateString()
400+
log.Warningf("PinState PinLoad, node.assignCores failed, assignedCount = %d need cpuCount = %d, vmName = %s, %s", assignedCount, cpuCount, vmName, nodeState)
399401
}
400402
}
401403

pkg/pool.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package pkg
22

33
import (
4+
"fmt"
45
"github.com/pnsafonov/pind/pkg/config"
56
"github.com/pnsafonov/pind/pkg/http_api"
67
"github.com/pnsafonov/pind/pkg/numa"
@@ -193,6 +194,13 @@ func getAvailableCoresCount(map0 map[int]*PoolCore) int {
193194
return count
194195
}
195196

197+
func (x *PoolNodeInfo) StateString() string {
198+
l0 := len(x.LoadFree)
199+
l1 := len(x.LoadUsed)
200+
l2 := l0 + l1
201+
return fmt.Sprintf("node %d, free = %d, load = %d, total = %d", x.Index, l0, l1, l2)
202+
}
203+
196204
func (x *PoolNodeInfo) assignCores(ctx *Context, proc *PinProc) int {
197205
node := x
198206
noSelected := ctx.Config.Service.PinCoresAlgo.NotSelected

0 commit comments

Comments
 (0)