Skip to content

Commit

Permalink
sys/linux: fix perf_event_attr layout
Browse files Browse the repository at this point in the history
  • Loading branch information
dvyukov committed Mar 6, 2018
1 parent c9af7e5 commit 2814d6b
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 26 deletions.
10 changes: 5 additions & 5 deletions executor/syscalls_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#if defined(__i386__) || 0
#define GOARCH "386"
#define SYZ_REVISION "438ceebbeee4b8331ecafae07e85a8079120816c"
#define SYZ_REVISION "02189651b6bef08854c7e471445f7d13d0a03603"
#define SYZ_PAGE_SIZE 4096
#define SYZ_NUM_PAGES 4096
#define SYZ_DATA_OFFSET 536870912
Expand Down Expand Up @@ -1615,7 +1615,7 @@ call_t syscalls[] = {

#if defined(__x86_64__) || 0
#define GOARCH "amd64"
#define SYZ_REVISION "00ff1c6d3a163fa16b597ce6edab9c4956129d09"
#define SYZ_REVISION "88804cf99067322549285d5a9d0d860fe4e266af"
#define SYZ_PAGE_SIZE 4096
#define SYZ_NUM_PAGES 4096
#define SYZ_DATA_OFFSET 536870912
Expand Down Expand Up @@ -3280,7 +3280,7 @@ call_t syscalls[] = {

#if defined(__arm__) || 0
#define GOARCH "arm"
#define SYZ_REVISION "5a1569893cefa812603d4f4627986d19ddff1708"
#define SYZ_REVISION "18403624cd7d4ff75fbee0a23bd49cb08934311f"
#define SYZ_PAGE_SIZE 4096
#define SYZ_NUM_PAGES 4096
#define SYZ_DATA_OFFSET 536870912
Expand Down Expand Up @@ -4896,7 +4896,7 @@ call_t syscalls[] = {

#if defined(__aarch64__) || 0
#define GOARCH "arm64"
#define SYZ_REVISION "c468a4ea718d49a30529c85ce2ffe57859d18d1c"
#define SYZ_REVISION "705baefddd0b12b031b62c88dea4b2bde73b1dd9"
#define SYZ_PAGE_SIZE 4096
#define SYZ_NUM_PAGES 4096
#define SYZ_DATA_OFFSET 536870912
Expand Down Expand Up @@ -6490,7 +6490,7 @@ call_t syscalls[] = {

#if defined(__ppc64__) || defined(__PPC64__) || defined(__powerpc64__) || 0
#define GOARCH "ppc64le"
#define SYZ_REVISION "b7dc281161fc5fcef8cef3878a5dd2dbbd7c45d5"
#define SYZ_REVISION "4016a25f76026c14fbae9073386e98195c06a349"
#define SYZ_PAGE_SIZE 4096
#define SYZ_NUM_PAGES 4096
#define SYZ_DATA_OFFSET 536870912
Expand Down
7 changes: 3 additions & 4 deletions sys/linux/386.go
Original file line number Diff line number Diff line change
Expand Up @@ -7344,7 +7344,7 @@ var structDescs_386 = []*KeyedStruct{
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "config1", TypeSize: 8}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "config2", TypeSize: 8}}},
}}},
{Key: StructKey{Name: "perf_event_attr"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "perf_event_attr", TypeSize: 120}, Fields: []Type{
{Key: StructKey{Name: "perf_event_attr"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "perf_event_attr", TypeSize: 112}, Fields: []Type{
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "perf_event_type", FldName: "type", TypeSize: 4}}, Vals: []uint64{0, 1, 2, 3, 4, 5}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", TypeSize: 4}}, Buf: "parent"},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "config0", TypeSize: 1}}},
Expand Down Expand Up @@ -7389,9 +7389,8 @@ var structDescs_386 = []*KeyedStruct{
&UnionType{Key: StructKey{Name: "perf_bp_config"}, FldName: "bp_config"},
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "perf_branch_sample_type", FldName: "branch_sample_type", TypeSize: 8}}, Vals: []uint64{1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "sample_regs_user", TypeSize: 8}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "sample_stack_user", TypeSize: 8}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "sample_stack_user", TypeSize: 4}}},
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "clock_type", FldName: "clockid", TypeSize: 4}}, Vals: []uint64{0, 5, 1, 6, 4, 7, 2, 3}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "sample_regs_intr", TypeSize: 8}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "aux_watermark", TypeSize: 4}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "sample_max_stack", TypeSize: 2}}},
Expand Down Expand Up @@ -25078,4 +25077,4 @@ var consts_386 = []ConstValue{
{Name: "bpf_insn_load_imm_dw", Value: 24},
}

const revision_386 = "438ceebbeee4b8331ecafae07e85a8079120816c"
const revision_386 = "02189651b6bef08854c7e471445f7d13d0a03603"
7 changes: 3 additions & 4 deletions sys/linux/amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -7499,7 +7499,7 @@ var structDescs_amd64 = []*KeyedStruct{
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "config1", TypeSize: 8}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "config2", TypeSize: 8}}},
}}},
{Key: StructKey{Name: "perf_event_attr"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "perf_event_attr", TypeSize: 120}, Fields: []Type{
{Key: StructKey{Name: "perf_event_attr"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "perf_event_attr", TypeSize: 112}, Fields: []Type{
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "perf_event_type", FldName: "type", TypeSize: 4}}, Vals: []uint64{0, 1, 2, 3, 4, 5}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", TypeSize: 4}}, Buf: "parent"},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "config0", TypeSize: 1}}},
Expand Down Expand Up @@ -7544,9 +7544,8 @@ var structDescs_amd64 = []*KeyedStruct{
&UnionType{Key: StructKey{Name: "perf_bp_config"}, FldName: "bp_config"},
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "perf_branch_sample_type", FldName: "branch_sample_type", TypeSize: 8}}, Vals: []uint64{1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "sample_regs_user", TypeSize: 8}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "sample_stack_user", TypeSize: 8}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "sample_stack_user", TypeSize: 4}}},
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "clock_type", FldName: "clockid", TypeSize: 4}}, Vals: []uint64{0, 5, 1, 6, 4, 7, 2, 3}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "sample_regs_intr", TypeSize: 8}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "aux_watermark", TypeSize: 4}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "sample_max_stack", TypeSize: 2}}},
Expand Down Expand Up @@ -25695,4 +25694,4 @@ var consts_amd64 = []ConstValue{
{Name: "bpf_insn_load_imm_dw", Value: 24},
}

const revision_amd64 = "00ff1c6d3a163fa16b597ce6edab9c4956129d09"
const revision_amd64 = "88804cf99067322549285d5a9d0d860fe4e266af"
7 changes: 3 additions & 4 deletions sys/linux/arm.go
Original file line number Diff line number Diff line change
Expand Up @@ -7167,7 +7167,7 @@ var structDescs_arm = []*KeyedStruct{
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "config1", TypeSize: 8}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "config2", TypeSize: 8}}},
}}},
{Key: StructKey{Name: "perf_event_attr"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "perf_event_attr", TypeSize: 120}, Fields: []Type{
{Key: StructKey{Name: "perf_event_attr"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "perf_event_attr", TypeSize: 112}, Fields: []Type{
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "perf_event_type", FldName: "type", TypeSize: 4}}, Vals: []uint64{0, 1, 2, 3, 4, 5}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", TypeSize: 4}}, Buf: "parent"},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "config0", TypeSize: 1}}},
Expand Down Expand Up @@ -7212,9 +7212,8 @@ var structDescs_arm = []*KeyedStruct{
&UnionType{Key: StructKey{Name: "perf_bp_config"}, FldName: "bp_config"},
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "perf_branch_sample_type", FldName: "branch_sample_type", TypeSize: 8}}, Vals: []uint64{1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "sample_regs_user", TypeSize: 8}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "sample_stack_user", TypeSize: 8}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "sample_stack_user", TypeSize: 4}}},
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "clock_type", FldName: "clockid", TypeSize: 4}}, Vals: []uint64{0, 5, 1, 6, 4, 7, 2, 3}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "sample_regs_intr", TypeSize: 8}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "aux_watermark", TypeSize: 4}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "sample_max_stack", TypeSize: 2}}},
Expand Down Expand Up @@ -24855,4 +24854,4 @@ var consts_arm = []ConstValue{
{Name: "bpf_insn_load_imm_dw", Value: 24},
}

const revision_arm = "5a1569893cefa812603d4f4627986d19ddff1708"
const revision_arm = "18403624cd7d4ff75fbee0a23bd49cb08934311f"
7 changes: 3 additions & 4 deletions sys/linux/arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -7304,7 +7304,7 @@ var structDescs_arm64 = []*KeyedStruct{
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "config1", TypeSize: 8}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "config2", TypeSize: 8}}},
}}},
{Key: StructKey{Name: "perf_event_attr"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "perf_event_attr", TypeSize: 120}, Fields: []Type{
{Key: StructKey{Name: "perf_event_attr"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "perf_event_attr", TypeSize: 112}, Fields: []Type{
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "perf_event_type", FldName: "type", TypeSize: 4}}, Vals: []uint64{0, 1, 2, 3, 4, 5}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", TypeSize: 4}}, Buf: "parent"},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "config0", TypeSize: 1}}},
Expand Down Expand Up @@ -7349,9 +7349,8 @@ var structDescs_arm64 = []*KeyedStruct{
&UnionType{Key: StructKey{Name: "perf_bp_config"}, FldName: "bp_config"},
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "perf_branch_sample_type", FldName: "branch_sample_type", TypeSize: 8}}, Vals: []uint64{1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "sample_regs_user", TypeSize: 8}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "sample_stack_user", TypeSize: 8}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "sample_stack_user", TypeSize: 4}}},
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "clock_type", FldName: "clockid", TypeSize: 4}}, Vals: []uint64{0, 5, 1, 6, 4, 7, 2, 3}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "sample_regs_intr", TypeSize: 8}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "aux_watermark", TypeSize: 4}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "sample_max_stack", TypeSize: 2}}},
Expand Down Expand Up @@ -25077,4 +25076,4 @@ var consts_arm64 = []ConstValue{
{Name: "bpf_insn_load_imm_dw", Value: 24},
}

const revision_arm64 = "c468a4ea718d49a30529c85ce2ffe57859d18d1c"
const revision_arm64 = "705baefddd0b12b031b62c88dea4b2bde73b1dd9"
2 changes: 1 addition & 1 deletion sys/linux/perf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ perf_event_attr {
bp_config perf_bp_config
branch_sample_type flags[perf_branch_sample_type, int64]
sample_regs_user int64
sample_stack_user int64
sample_stack_user int32
clockid flags[clock_type, int32]
sample_regs_intr int64
aux_watermark int32
Expand Down
7 changes: 3 additions & 4 deletions sys/linux/ppc64le.go
Original file line number Diff line number Diff line change
Expand Up @@ -7259,7 +7259,7 @@ var structDescs_ppc64le = []*KeyedStruct{
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "config1", TypeSize: 8}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "config2", TypeSize: 8}}},
}}},
{Key: StructKey{Name: "perf_event_attr"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "perf_event_attr", TypeSize: 120}, Fields: []Type{
{Key: StructKey{Name: "perf_event_attr"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "perf_event_attr", TypeSize: 112}, Fields: []Type{
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "perf_event_type", FldName: "type", TypeSize: 4}}, Vals: []uint64{0, 1, 2, 3, 4, 5}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", TypeSize: 4}}, Buf: "parent"},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "config0", TypeSize: 1}}},
Expand Down Expand Up @@ -7304,9 +7304,8 @@ var structDescs_ppc64le = []*KeyedStruct{
&UnionType{Key: StructKey{Name: "perf_bp_config"}, FldName: "bp_config"},
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "perf_branch_sample_type", FldName: "branch_sample_type", TypeSize: 8}}, Vals: []uint64{1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "sample_regs_user", TypeSize: 8}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "sample_stack_user", TypeSize: 8}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "sample_stack_user", TypeSize: 4}}},
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "clock_type", FldName: "clockid", TypeSize: 4}}, Vals: []uint64{0, 5, 1, 6, 4, 7, 2, 3}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "sample_regs_intr", TypeSize: 8}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "aux_watermark", TypeSize: 4}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "sample_max_stack", TypeSize: 2}}},
Expand Down Expand Up @@ -24839,4 +24838,4 @@ var consts_ppc64le = []ConstValue{
{Name: "bpf_insn_load_imm_dw", Value: 24},
}

const revision_ppc64le = "b7dc281161fc5fcef8cef3878a5dd2dbbd7c45d5"
const revision_ppc64le = "4016a25f76026c14fbae9073386e98195c06a349"

0 comments on commit 2814d6b

Please sign in to comment.