From 867ba38efefb98ad0a0b09f5f91312866cf6d5dd Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 19 Jan 2021 17:41:53 +0100 Subject: [PATCH] events: simplify some conversion functions Signed-off-by: Sebastiaan van Stijn --- events.go | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/events.go b/events.go index e749d519d..709e13cf9 100644 --- a/events.go +++ b/events.go @@ -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 }