Skip to content
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
5 changes: 5 additions & 0 deletions libcontainer/intelrdt/intelrdt.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,11 @@ func (m *IntelRdtManager) GetPath() string {

// Returns statistics for Intel RDT
func (m *IntelRdtManager) GetStats() (*Stats, error) {
// If intelRdt is not specified in config
if m.Config.IntelRdt == nil {
return nil, nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the calling code handle a nil, nil return or will it panic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crosbymichael

Does the calling code handle a nil, nil return or will it panic?

It will not panic. In caller linuxContainer.Stats(): libcontainer.Stats.IntelRdtStats will be assigned to nil when intelRdtManager.GetStats() returns nil, nil.
And in events command, the caller convertLibcontainerStats() will handle the case when libcontainer.Stats.IntelRdtStats = nil

}

m.mu.Lock()
defer m.mu.Unlock()
stats := NewStats()
Expand Down