Skip to content

Commit

Permalink
Allow 4 byte map values for perf_event_array
Browse files Browse the repository at this point in the history
In 010dc16 the check was added for 8 byte values, which doesn't work for oomkill:

```
Error attaching exporter: error validating maps for config "oomkill": value size for map "oom_kills_total" is not expected 8 bytes (u64), it is 4 bytes
```
  • Loading branch information
bobrik committed Nov 16, 2023
1 parent 8d94942 commit 0835c84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ func validateMaps(module *libbpfgo.Module, cfg config.Config) error {
maps := []string{}

for _, counter := range cfg.Metrics.Counters {
if counter.Name != "" {
if counter.Name != "" && !counter.PerfEventArray {
maps = append(maps, counter.Name)
}
}
Expand Down

0 comments on commit 0835c84

Please sign in to comment.