Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pkg/aflow/action/kernel/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ func buildKernel(ctx *aflow.Context, args buildArgs) (buildResult, error) {
image := filepath.FromSlash(build.LinuxKernelImage(targets.AMD64))
makeArgs := build.LinuxMakeArgs(target, targets.DefaultLLVMCompiler, targets.DefaultLLVMLinker,
"ccache", dir, runtime.NumCPU())
compileCommnads := "compile_commands.json"
makeArgs = append(makeArgs, path.Base(image), compileCommnads)
if _, err := osutil.RunCmd(time.Hour, args.KernelSrc, "make", makeArgs...); err != nil {
return aflow.FlowError(err)
const compileCommands = "compile_commands.json"
makeArgs = append(makeArgs, "-s", path.Base(image), compileCommands)
if out, err := osutil.RunCmd(time.Hour, args.KernelSrc, "make", makeArgs...); err != nil {
return aflow.FlowError(fmt.Errorf("make failed: %w\n%s", err, out))
}
// Remove main intermediate build files, we don't need them anymore
// and they take lots of space. But keep generated source files.
keepFiles := map[string]bool{
image: true,
target.KernelObject: true,
compileCommnads: true,
compileCommands: true,
}
return filepath.WalkDir(dir, func(path string, d fs.DirEntry, err error) error {
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions tools/syz-aflow/aflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ func run(ctx context.Context, model, flowName, inputFile, workdir string, cacheS
}

func onEvent(span *trajectory.Span) error {
if span.Error != "" {
// We do not want to print error twice (once here and once in main).
// So we ignore those events.
return nil
}
log.Printf("%v", span)
return nil
}
Expand Down
Loading