New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add proc type #94
Add proc type #94
Conversation
@@ -55,6 +55,8 @@ rest of the type-options are type-specific: | |||
"bytesize": similar to "len", but always denotes the size in bytes, type-options: | |||
argname of the object | |||
"vma": a pointer to a set of pages (used as input for mmap/munmap/mremap/madvise) | |||
"proc": per process int, type-options: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please extend this description. It is very non-obvious type. I doubt that anybody expect me and you understand what it does.
A usage example may help.
Please write some meaningful commit description. There are people who read them. |
@@ -732,6 +730,8 @@ func (r *randGen) generateArg(s *state, typ sys.Type) (arg *Arg, calls []*Call) | |||
v = r.randRangeInt(a.RangeBegin, a.RangeEnd) | |||
} | |||
return constArg(a, v), nil | |||
case *sys.ProcType: | |||
return constArg(a, r.rand(int(a.ValuesPerProc) - 1)), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why "- 1"? Does not look correct to me. Should crash if ValuesPerProc==1.
if valuesStartInt >= (1 << (size * 8)) { | ||
failf("values starting from '%v' overflow desired type of size '%v'", valuesStartInt, size) | ||
} | ||
if valuesStartInt + 16 * valuesPerProcInt >= (1 << (size * 8)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alex uses 20 procs. Let's make the max 32. And check that procs parameter <= 32 in config package.
@@ -156,10 +156,10 @@ func (env *Env) Close() error { | |||
// failed: true if executor has detected a kernel bug | |||
// hanged: program hanged and was killed | |||
// err0: failed to start process, or executor has detected a logical error | |||
func (env *Env) Exec(p *prog.Prog) (output []byte, cov [][]uint32, errnos []int, failed, hanged bool, err0 error) { | |||
func (env *Env) Exec(p *prog.Prog, pid int) (output []byte, cov [][]uint32, errnos []int, failed, hanged bool, err0 error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pid should be an argument to ipc.MakeEnv.
We've discussed that we may need to pass pid to executor to setup network card, etc.
MakeEnv looks like the right place for pid long term.
All done. Note, that the old way to generate ports is still used when generating inaddrs. |
looks good to me |
No description provided.