aboutsummaryrefslogtreecommitdiffstats
path: root/sys/akaros/gen
Commit message (Collapse)AuthorAgeFilesLines
* all: remove akaros supportDmitry Vyukov2024-04-151-6/+0
| | | | | | | Akaros support is unused, it was shutdown on syzbot for a while, the akaros development seems to be frozen for years as well. We have a bunch of hacks for Akaros since it supported only super old gcc and haven't supported Go. Remove it.
* sys: commit empty source filesDmitry Vyukov2021-04-211-0/+6
| | | | | | Commit empty files into generated packages, so that the tree is buildable even w/o generated files and Go tools continue to work.
* Makefile: generate descriptions on-the-flyDmitry Vyukov2020-04-302-1966/+0
| | | | | | | | | | | | | | | | | | Checking in the generated descriptions files makes few things simpler, but causes pain for pull requests: (1) PRs that touch descriptions _always_ conflict, (2) PRs are large and harder to review, (3) people sometimes forget to add auto-generated files. The proposed way does not require us to hardcode lots of dependencies in the Makefile (which is nice) and seem to work. Let's see how it works. The main contributor-visible consequence is that the auto-generated files do not need to be checked-in now. Credit for figuring the Makefile magic goes to @melver. Fixes #1291
* pkg/compiler: deduplicate Types in descriptionsDmitry Vyukov2020-04-261-1058/+1488
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add prog.Ref Type that serves as a proxy for real types and allows to deduplicate Types in generated descriptions. The Ref type is effectively an index in an array of types. Just before serialization pkg/compiler replaces real types with the Ref types and prepares corresponding array of real types. When a Target is registered in prog package, we do the opposite operation and replace Ref's with the corresponding real types. This brings improvements across the board: compiler memory consumption is reduced by 15%, test building time by 25%, descriptions size by 33%. Before: $ du -h sys/linux/gen 54M sys/linux/gen $ time GOMAXPROCS=1 go test -p=1 -c ./prog real 0m54.200s real 0m53.883s $ time GOMAXPROCS=1 go install -p=1 ./tools/syz-execprog real 0m27.911s real 0m27.767s $ TIME="%e %P %M" GOMAXPROCS=1 time go tool compile ./sys/linux/gen 20.59 100% 3200016 20.97 100% 3445976 20.25 100% 3209684 After: $ du -h sys/linux/gen 36M sys/linux/gen $ time GOMAXPROCS=1 go test -p=1 -c ./prog real 0m42.290s real 0m43.230s $ time GOMAXPROCS=1 go install -p=1 ./tools/syz-execprog real 0m24.337s real 0m24.727s $ TIME="%e %P %M" GOMAXPROCS=1 time go tool compile ./sys/linux/gen 19.11 100% 2764952 19.66 100% 2787624 19.35 100% 2749376 Update #1580
* prog: remove unused ResourceDesc.TypeDmitry Vyukov2020-01-261-3/+3
|
* pkg/serializer: do not write field names if it won't save spaceDmitry Vyukov2020-01-261-376/+376
| | | | | | | If we are going to write all values, don't write field names. This only increases size of generated files. The change reduces size of generated files by 5.8% (62870496-59410354=3460142 bytes saved).
* pkg/compiler: don't mark flags with 0 as bitmaskDmitry Vyukov2020-01-181-4/+4
| | | | | | | They can't be a bitmask. This fixes important cases of "0, 1" and "0, 1, 2" flags. Fix some descriptions that added 0 to bitmasks explicitly (we should do it automatically instead).
* pkg/compiler: sort flags valuesDmitry Vyukov2020-01-181-9/+9
| | | | | | Will simplify runtime analysis of flags. Also just no reason to make it more deterministic and avoid unnecessary diffs in future if values are reordered.
* pkg/compiler: define fileoff templatePaul Chaignon2019-11-011-7/+7
| | | | Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
* .golangci.yml: add codeanalysis build tagDmitry Vyukov2019-05-151-1/+2
| | | | | | | | | Using a build tag to exclude files for golangci-lint reduces memory consumption (it does not parse them). The naive attempt with skip-dirs did not work. So add codeanalysis build tag and use it in auto-generated files. Update #977
* sys/akaros: rename syscall argumentDmitry Vyukov2019-05-141-2/+2
| | | | In preparation for making syscall a reserved name.
* pkg/compiler: generate complex len targetsDmitry Vyukov2019-05-141-180/+180
| | | | Change the generated format for len type to support multiple path elements.
* pkg/compiler: make buffer alias to ptr[array[int8]]Dmitry Vyukov2019-04-011-5/+5
| | | | | | | | | | | Ptr type has special handling of direction (pointers are always input). But buffer type missed this special case all the time. Make buffer less special by aliasing to the ptr[array[int8]] type. As the result buffer type can't have optional trailing "opt" attribute because we don't have such support for templates yet. Change such cases to use ptr type directly. Fixes #1097
* pkg/csource: use 0 for missing syscall argsDmitry Vyukov2018-12-271-8/+8
| | | | | | | | | | | | | | We don't specify trailing unused args for some syscalls (e.g. ioctl that does not use its arg). Executor always filled tailing unsed args with 0's but pkg/csource didn't. Some such syscalls actually check that the unsed arg is 0 and as the result failed with C repro. We could statically check and eliminate all such cases, but it turns out the warning fires in 1500+ cases: https://gist.githubusercontent.com/dvyukov/e59ba1d9a211ee32fa0ba94fab86a943/raw/a3ace5a63f7281f0298f51ea9842ead1e4713418/gistfile1.txt So instead fill such args with 0's in pkg/csource too.
* sys/linux: add syz_execute_funcDmitry Vyukov2018-08-301-1/+4
| | | | | | The function executes random code. Update #310
* sys/akaros: remove /dev/consDmitry Vyukov2018-08-021-15/+1
| | | | Presumably it causes corrupted console output.
* Makefile: don't compile all targets into target binariesDmitry Vyukov2018-08-022-2/+9
| | | | | | | | | | Currently target binaries contain support for all OS/arch combinations. However, obviously a fuchsia target binary won't test windows. For target binaries we need support only for a single target (with the exception of 386/arm target in amd64/arm64 binaries). So compile in only _the_ target into target binaries. This reduces akaros/amd64 fuzzer binary from 33 to 7 MB and execprog from 28 to 2 MB.
* sys/akaros: add a bunch of global files for akarosDmitry Vyukov2018-07-161-1/+1009
|
* sys/akaros: fix signatures of file syscallsDmitry Vyukov2018-07-161-19/+39
| | | | Most of them differ and accept path length and/or pid.
* sys/akaros: disable init_arsc syscallDmitry Vyukov2018-07-161-3/+1
| | | | It unconditionally crashes kernel now.
* sys/akaros: add all syscallsDmitry Vyukov2018-07-061-54/+280
|
* prog: detect when flags are a bitmaskDmitry Vyukov2018-06-301-12/+12
|
* sys: mark output resources as optDmitry Vyukov2018-06-181-2/+2
| | | | | Mark output resources as opt in preparation for more precise constructor calculation.
* sys: move generate files to separate packagesDmitry Vyukov2018-05-051-0/+287
Move generated files to gen subdir. This allows to: 1. Rebuild init.go without rebuilding generated code. 2. Excluding generated files from gometalinter checking. This makes faster and consume less memory. Update #538