Skip to content

Commit 534b6a4

Browse files
authored
types/trace: add u8 type support to UnmarshalJson (#2312)
UnmarshalJson isn't supporting u8 type currently, even though it is used by the `do_sigaction` event. Add support to it and to other types names missing.
1 parent 4ff5914 commit 534b6a4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

types/trace/trace.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,18 @@ func (arg *Argument) UnmarshalJSON(b []byte) error {
155155
return err
156156
}
157157
arg.Value = tmp
158-
case "unsigned short", "old_uid_t", "old_gid_t", "umode_t":
158+
case "unsigned short", "old_uid_t", "old_gid_t", "umode_t", "u16", "uint16":
159159
tmp, err := strconv.ParseUint(num.String(), 10, 16)
160160
if err != nil {
161161
return err
162162
}
163163
arg.Value = uint16(tmp)
164+
case "u8", "uint8":
165+
tmp, err := strconv.ParseUint(num.String(), 10, 8)
166+
if err != nil {
167+
return err
168+
}
169+
arg.Value = uint8(tmp)
164170
default:
165171
return fmt.Errorf("unrecognized argument type")
166172
}

0 commit comments

Comments
 (0)