mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
events: simplify some conversion functions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -196,29 +196,17 @@ func convertMemoryEntry(c cgroups.MemoryData) types.MemoryEntry {
|
||||
func convertBlkioEntry(c []cgroups.BlkioStatEntry) []types.BlkioEntry {
|
||||
var out []types.BlkioEntry
|
||||
for _, e := range c {
|
||||
out = append(out, types.BlkioEntry{
|
||||
Major: e.Major,
|
||||
Minor: e.Minor,
|
||||
Op: e.Op,
|
||||
Value: e.Value,
|
||||
})
|
||||
out = append(out, types.BlkioEntry(e))
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func convertL3CacheInfo(i *intelrdt.L3CacheInfo) *types.L3CacheInfo {
|
||||
return &types.L3CacheInfo{
|
||||
CbmMask: i.CbmMask,
|
||||
MinCbmBits: i.MinCbmBits,
|
||||
NumClosids: i.NumClosids,
|
||||
}
|
||||
ci := types.L3CacheInfo(*i)
|
||||
return &ci
|
||||
}
|
||||
|
||||
func convertMemBwInfo(i *intelrdt.MemBwInfo) *types.MemBwInfo {
|
||||
return &types.MemBwInfo{
|
||||
BandwidthGran: i.BandwidthGran,
|
||||
DelayLinear: i.DelayLinear,
|
||||
MinBandwidth: i.MinBandwidth,
|
||||
NumClosids: i.NumClosids,
|
||||
}
|
||||
mi := types.MemBwInfo(*i)
|
||||
return &mi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user