Page MenuHomeFreeBSD

Fix common.probes.t_dtrace_contrib.tst_probestar_d timeout issue
ClosedPublic

Authored by lwhsu on Jul 20 2017, 2:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 23, 5:46 AM
Unknown Object (File)
Sat, Mar 23, 5:46 AM
Unknown Object (File)
Sat, Mar 23, 5:46 AM
Unknown Object (File)
Sat, Mar 23, 5:46 AM
Unknown Object (File)
Sat, Mar 23, 5:46 AM
Unknown Object (File)
Sat, Mar 23, 5:46 AM
Unknown Object (File)
Sat, Mar 23, 5:33 AM
Unknown Object (File)
Mar 15 2024, 6:14 PM
Subscribers

Details

Summary

This test timeout on a quiet system. Because there is nobody triggers
syscall::*wait*:entry probe while test execution.

Add a simple program calls sigwaitinfo(2), it sleeps for 1 second at begining
because current dtest script doesn't support execute a program after invoking
dtrace script.

Test Plan

cd /usr/tests/cddl/usr.sbin/dtrace/common/probes && kyua debug t_dtrace_contrib:tst_probestar_d

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 10610
Build 11015: arc lint + arc unit

Event Timeline

cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.c
27–29

style(9): sort headers.

32

Use void.

38–39

These should both be cast to void to quiet warnings from coverity.

45

style(9): wrap the return value in parentheses.

cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.c
32

Do you mean main (void) or void main(int argc, char *argv[])?

I suppose former because we do return 0/1 in main.

cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.c
43

The test harness will first start the program, and then invoke dtrace, passing the PID of the new process as an argument. The harness will also take care of killing the process after dtrace exits.

The sleep(1) will probably be enough time for dtrace to attach, but it's racy - what if the system is loaded and it takes more than a second to start dtrace? I think it would be more robust if the test program called sigtimedwait() once per second in an infinite loop.

cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.c
32

Yes, the arguments list for main should be void. This eliminates a -Wunused warning.

cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.c
43

I was also thinking the same thing, but I wanted to test all the stars in the case (*wait*) so I chose sigwaitinfo(2) here. In my plan is fixing these timeout issues first to reduce test time, and modify dtest to enable executing a post-action while test. How do you think?

cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.c
43

Well, you're still verifying that the last "*" matches the empty string.

I don't quite understand your proposal. What kind of post-action are you proposing for this case?

cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.c
38–39

style(9): no spaces between (void) cast and sig....

43

I don't understand either comment to be frank:

  1. lwhsu: what do you mean by "executing a post-action while test"?
  2. markj: where is lwhsu still verifying that the last "*" matches the empty string?
  • Change to call sigtimedwait(2)
  • style(9) fix
cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.c
43

@markj : verifying last * matches the empty string -- makes sense. I changed it to sigtimedwait(2) and simply ignore return value.
@ngie , @markj : I mean we can probably change dtest script, and let it supports doing a test like this:

  1. executing dtrace, keep the pid
  2. executing other program / script
  3. check the dtrace output and return value
  4. recycle (kill) the auxiliary script

The change looks good to me at least. Thanks!

This revision is now accepted and ready to land.Jul 25 2017, 10:26 AM
This revision was automatically updated to reflect the committed changes.