[PATCH]: pd_print_cpu_info/bsd display minimal info

Thomas Stüfe thomas.stuefe at gmail.com
Tue May 21 09:36:32 UTC 2019


(Redirecting to hs-runtime and bsd-port-dev and pasting the diff for
convenience)

# HG changeset patch
# User David Carlier <dcarlier at afilias.info>
# Date 1558430500 0
#      Tue May 21 09:21:40 2019 +0000
# Node ID b7c0ab0c591133c52014b7473acbe8ec9daf73ef
# Parent  566fbca8a89093c5f15157115d70a265aaf28bee
hotspot/bsd: pd_print_cpu_info, display minmal information

diff -r 566fbca8a890 -r b7c0ab0c5911 src/hotspot/os/bsd/os_bsd.cpp
--- a/src/hotspot/os/bsd/os_bsd.cpp Mon May 20 18:18:42 2019 -0700
+++ b/src/hotspot/os/bsd/os_bsd.cpp Tue May 21 09:21:40 2019 +0000
@@ -1568,6 +1568,13 @@

 void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) {
   // Nothing to do for now.
+  char model[100];
+  size_t size = sizeof(model);
+  int mib[] = { CTL_HW, HW_MODEL };
+  if (sysctl(mib, 2, model, &size, NULL, 0) == 0) {
+    st->print("model name: %s", model);
+    st->cr();
+  }
 }

 void os::get_summary_cpu_info(char* buf, size_t buflen) {

On Tue, May 21, 2019 at 11:33 AM David CARLIER <devnexen at gmail.com> wrote:

> Hi,
>
> here a little patch proposal to improve slightly the BSD support.
>
> Thanks.
>
> Kind regards.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/bsd-port-dev/attachments/20190521/e882f860/attachment.html>


More information about the bsd-port-dev mailing list