From cf1562d0a54fa61b4fbbff9518ad03cc4a954d75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geyslan=20Greg=C3=B3rio?= Date: Thu, 26 Sep 2024 16:53:53 -0300 Subject: [PATCH] fix(ebpf): try to assert only when it is not nil The normalizeTimeArg function was not checking if the value was nil before asserting it as an uint64. This also adds the type to the error message. --- pkg/ebpf/processor_funcs.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/ebpf/processor_funcs.go b/pkg/ebpf/processor_funcs.go index 32cd03db0772..253b16fd5116 100644 --- a/pkg/ebpf/processor_funcs.go +++ b/pkg/ebpf/processor_funcs.go @@ -361,9 +361,13 @@ func (t *Tracee) normalizeTimeArg(argNames ...string) func(event *trace.Event) e if arg == nil { return errfmt.Errorf("couldn't find argument %s of event %s", argName, event.EventName) } + if arg.Value == nil { + continue + } + argTime, ok := arg.Value.(uint64) if !ok { - return errfmt.Errorf("argument %s of event %s is not of type uint64", argName, event.EventName) + return errfmt.Errorf("argument %s of event %s is not uint64, it is %T", argName, event.EventName, arg.Value) } arg.Value = time.BootToEpochNS(argTime) }