aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2019-07-26 10:29:11 +0200
committerDmitry Vyukov <dvyukov@google.com>2019-07-26 10:29:36 +0200
commitcf49ed5769e95e2146c56883ebc957b22713381a (patch)
tree573a3997d46332dc2a89fe3f65d7c5606ebf2b15 /sys
parent091bb0070faa61066041adf59b088a7a873a480d (diff)
prog: don't minimize ProcType to 0
Default value for ProcType is 0 (same for all PID's). Usually 0 either does not make sense at all or make different PIDs collide (since we use ProcType to separate value ranges for different PIDs). So don't change ProcType to 0 unless the type is explicitly marked as opt (in that case we will also generate 0 anyway).
Diffstat (limited to 'sys')
-rw-r--r--sys/test/gen/64.go7
-rw-r--r--sys/test/test.txt4
-rw-r--r--sys/test/test_64.const1
3 files changed, 11 insertions, 1 deletions
diff --git a/sys/test/gen/64.go b/sys/test/gen/64.go
index 00cba243f..b6f1b0bee 100644
--- a/sys/test/gen/64.go
+++ b/sys/test/gen/64.go
@@ -637,6 +637,10 @@ var syscalls_64 = []*Syscall{
{Name: "foo$fmt5", CallName: "foo", MissingArgs: 1, Args: []Type{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "a", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "struct$fmt0"}}},
}},
+ {Name: "minimize$0", CallName: "minimize", Args: []Type{
+ &ProcType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "proc", FldName: "a0", TypeSize: 8}}, ValuesStart: 10, ValuesPerProc: 2},
+ &ProcType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "proc", FldName: "a1", TypeSize: 8, IsOptional: true}}, ValuesStart: 10, ValuesPerProc: 2},
+ }},
{Name: "mutate0", CallName: "mutate0"},
{Name: "mutate1", CallName: "mutate1"},
{Name: "mutate2", CallName: "mutate2"},
@@ -1018,6 +1022,7 @@ var consts_64 = []ConstValue{
{Name: "IPPROTO_UDP", Value: 17},
{Name: "SYS_fallback"},
{Name: "SYS_foo"},
+ {Name: "SYS_minimize"},
{Name: "SYS_mutate0"},
{Name: "SYS_mutate1"},
{Name: "SYS_mutate2"},
@@ -1034,4 +1039,4 @@ var consts_64 = []ConstValue{
{Name: "SYS_unsupported"},
}
-const revision_64 = "74c87d08a1f72c38c85e889813b60823a1e5755c"
+const revision_64 = "8c0a50a6c63e5bd297e9f6421864685e1fd7dc96"
diff --git a/sys/test/test.txt b/sys/test/test.txt
index a087dd47f..51be5d49b 100644
--- a/sys/test/test.txt
+++ b/sys/test/test.txt
@@ -736,6 +736,10 @@ mutate8(a0 proc[100, 4, opt])
open_flags = 0xabababababababab, 0xcdcdcdcdcdcdcdcd
+# Minimization tests.
+
+minimize$0(a0 proc[10, 2], a1 proc[10, 2, opt])
+
# Serialization tests.
serialize0(a ptr[in, serialize0_struct])
diff --git a/sys/test/test_64.const b/sys/test/test_64.const
index 97e3a80b8..f5ed8a6a6 100644
--- a/sys/test/test_64.const
+++ b/sys/test/test_64.const
@@ -8,6 +8,7 @@ SYS_mutate5 = 0
SYS_mutate6 = 0
SYS_mutate7 = 0
SYS_mutate8 = 0
+SYS_minimize = 0
SYS_serialize0 = 0
SYS_serialize1 = 0
SYS_test = 0