Getting per-thread CPU time on *BSD

Thomas Schatzl thomas.schatzl at oracle.com
Mon Jun 23 07:46:49 UTC 2025


Hi Harald,

   thanks for your effort!

On 21.06.25 14:03, Harald Eilertsen wrote:
> Hi,
> 
> A quick update on my part.
> 
> I have figured out how to get both user time and user+sys time on
> FreeBSD.
> 
> https://urldefense.com/v3/__https://git.anduin.net/haraldei/bsd-thread-time-example__;!!ACWV5N9M2RV99hQ!KBbaClb29ZBzy6EdTYhJCvZr14QJva2hOK77xk4iHj9UsZiM0q2WpJzM2-Yy0rIrpBA6ueo4LvMJJ90zr-K7IDN-PeWZ-p-s$
> 
> This is quite similar to the OpenBSD code by Kurt Miller that was
> already in the BSD port tree. I have a local patch based on that

I did not know somebody maintained the BSD port outside of mainline. 
That may make the issue more complicated.

> which replace the existing FreeBSD code with combined code for OpenBSD
> and FreeBSD. I will need help from someone to add support for NetBSD,
> though.
> 
> I'm a bit unsure about what to do next however. Do you want me to submit
> the changes to the OpenJDK mainline repo? It won't in itself fix BSD
> support for OpenJDK, but could be one of the many steps on the way.

I would go that way if possible and try to keep mainline up to date. 
However if mainline does not build/work at all, then this effort would 
probably just contribute to more untested code.

Unfortunately I do not know the exact state of the BSD ports.

> 
> In any case, it should be safe to go on with whatever needs you have for
> this information, we are able to provide it on the BSD's as well.
> 

Thanks again. Thomas


More information about the bsd-port-dev mailing list