Page MenuHomeFreeBSD

usr.sbin/pmcstat: return non-zero if the launched command fails
Needs RevisionPublic

Authored by arichardson on Oct 12 2022, 4:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 26, 10:01 PM
Unknown Object (File)
Apr 19 2024, 8:06 AM
Unknown Object (File)
Feb 19 2024, 12:42 PM
Unknown Object (File)
Dec 21 2023, 3:25 PM
Unknown Object (File)
Dec 20 2023, 8:16 AM
Unknown Object (File)
Dec 19 2023, 4:43 PM
Unknown Object (File)
Oct 30 2023, 3:26 PM
Unknown Object (File)
Oct 30 2023, 9:11 AM
Subscribers

Details

Summary

Previously pmcstat would return a success return code even if the process
that it launched crashed or returned a failure code. Returning a non-zero
exit code means that we can more easily detect if a benchmark did not
run as expected even when running it under pmcstat.

While it might make sense to propagate the exit code/signal via pmcstat,
I believe returning EX_IOERR if the child process fails should
be sufficient.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 47799
Build 44686: arc lint + arc unit

Event Timeline

While it might make sense to propagate the exit code/signal via pmcstat, I believe returning EX_IOERR if the child process fails should be sufficient.

I think it probably does; it looks like that's what ktrace does, for instance. Do you know what Linux perf does?

I don't object if you think this is best; I think returning EX_IOERR is better than EX_OK if the child reports failure anyhow.

While it might make sense to propagate the exit code/signal via pmcstat, I believe returning EX_IOERR if the child process fails should be sufficient.

I think it probably does; it looks like that's what ktrace does, for instance. Do you know what Linux perf does?

I don't object if you think this is best; I think returning EX_IOERR is better than EX_OK if the child reports failure anyhow.

It looks like perf stat passes through the exit code, so I'll do the same here.

emaste requested changes to this revision.Mar 21 2023, 4:29 PM

@arichardson plans to change this to return the child's exit code

This revision now requires changes to proceed.Mar 21 2023, 4:29 PM