RFR : 8217786: Provide virtualization related info in the hs_error file on linux s390x

Baesken, Matthias matthias.baesken at sap.com
Mon Jan 28 11:28:36 UTC 2019


Hi Thomas ,  at first  I wanted to do such a generic solution   (function that gets  the path to the file   + a pattern list);  but then I thought that such generic solutions are often not liked in OpenJDK.
But let’s see what others think ,  I am open to go for a more generic approach .

Best regards, Matthias


From: Thomas Stüfe <thomas.stuefe at gmail.com>
Sent: Montag, 28. Januar 2019 11:39
To: Baesken, Matthias <matthias.baesken at sap.com>
Cc: hotspot-dev at openjdk.java.net
Subject: Re: RFR : 8217786: Provide virtualization related info in the hs_error file on linux s390x

Hi Matthias,

I would reformulate the _scan_and_print_sysinfo_file() function in linux code to be more generic, e.g. by handing down some sort of matching condition. In its simplest form this can be one or a collection of keywords, for example:

--

// keywords_to_match - NULL terminated array of keywords
static bool print_matching_lines_from_sysinfo_file(outputStream* st, const char* keywords_to_match[]) {
..

  int i = 0;
  while (keywords_to_match[i]) {
   if (strstr(line, keywords_to_match[i]) == line) print line;
   i ++
 }
}

and call this on s390 with:
#ifdef s390
const char* kw[] = { "LPAR", "CPU", "VM", NULL };
#endif
print_matching_lines_from_sysinfo_file  (st, kw);

---

That way this coding can be easliy reused on other architectures.

Alternatively, I would fan out the coding for Linux to the cpu specific files (os_linux_<cpu>.cpp) and leave all but s390 empty. But I am personally not fond of those many empty functions.

Cheers, Thomas



On Mon, Jan 28, 2019 at 9:49 AM Baesken, Matthias <matthias.baesken at sap.com<mailto:matthias.baesken at sap.com>> wrote:
Hello, please review  this change ; it adds  virtualization related info in the hs_error file on linux s390x .

On linux s390x, we usually  (always?)   run in virtualized environments (LPAR and/or z/VM / KVM ).

It is helpful for instance in support cases to get some information about the virtualized environment in the hs_error file .
A lot of info can be taken from the /proc/sysinfo file on linux s390x .


Bug/webrev :

https://bugs.openjdk.java.net/browse/JDK-8217786


http://cr.openjdk.java.net/~mbaesken/webrevs/8217786.1/



Best regards, Matthias


More information about the hotspot-dev mailing list