72
73 File f = new File(hs_err_file);
74 if (!f.exists()) {
75 throw new RuntimeException("hs_err_pid file missing at "
76 + f.getAbsolutePath() + ".\n");
77 }
78
79 System.out.println("Found hs_err_pid file. Scanning...");
80
81 FileInputStream fis = new FileInputStream(f);
82 BufferedReader br = new BufferedReader(new InputStreamReader(fis));
83 String line = null;
84
85 Pattern [] pattern = new Pattern[] {
86 // The "Current thread" line should show a hazard ptr and
87 // a nested hazard ptr:
88 Pattern.compile("Current thread .* _threads_hazard_ptr=0x[0-9A-Fa-f][0-9A-Fa-f]*, _nested_threads_hazard_ptr_cnt=1, _nested_threads_hazard_ptrs=0x.*"),
89 // We should have a section of Threads class SMR info:
90 Pattern.compile("Threads class SMR info:"),
91 // We should have one nested ThreadsListHandle:
92 Pattern.compile(".*, _smr_nested_thread_list_max=1"),
93 // The current thread (marked with '=>') in the threads list
94 // should show a hazard ptr:
95 Pattern.compile("=>.* JavaThread \"main\" .*_threads_hazard_ptr=0x[0-9A-Fa-f][0-9A-Fa-f]*, _nested_threads_hazard_ptr_cnt=1, _nested_threads_hazard_ptrs=0x.*"),
96 };
97 int currentPattern = 0;
98
99 String lastLine = null;
100 while ((line = br.readLine()) != null) {
101 if (currentPattern < pattern.length) {
102 if (pattern[currentPattern].matcher(line).matches()) {
103 System.out.println("Found: " + line + ".");
104 currentPattern++;
105 }
106 }
107 lastLine = line;
108 }
109 br.close();
110
111 if (currentPattern < pattern.length) {
112 throw new RuntimeException("hs_err_pid file incomplete (first missing pattern: " + currentPattern + ")");
|
72
73 File f = new File(hs_err_file);
74 if (!f.exists()) {
75 throw new RuntimeException("hs_err_pid file missing at "
76 + f.getAbsolutePath() + ".\n");
77 }
78
79 System.out.println("Found hs_err_pid file. Scanning...");
80
81 FileInputStream fis = new FileInputStream(f);
82 BufferedReader br = new BufferedReader(new InputStreamReader(fis));
83 String line = null;
84
85 Pattern [] pattern = new Pattern[] {
86 // The "Current thread" line should show a hazard ptr and
87 // a nested hazard ptr:
88 Pattern.compile("Current thread .* _threads_hazard_ptr=0x[0-9A-Fa-f][0-9A-Fa-f]*, _nested_threads_hazard_ptr_cnt=1, _nested_threads_hazard_ptrs=0x.*"),
89 // We should have a section of Threads class SMR info:
90 Pattern.compile("Threads class SMR info:"),
91 // We should have one nested ThreadsListHandle:
92 Pattern.compile(".*, _nested_thread_list_max=1"),
93 // The current thread (marked with '=>') in the threads list
94 // should show a hazard ptr:
95 Pattern.compile("=>.* JavaThread \"main\" .*_threads_hazard_ptr=0x[0-9A-Fa-f][0-9A-Fa-f]*, _nested_threads_hazard_ptr_cnt=1, _nested_threads_hazard_ptrs=0x.*"),
96 };
97 int currentPattern = 0;
98
99 String lastLine = null;
100 while ((line = br.readLine()) != null) {
101 if (currentPattern < pattern.length) {
102 if (pattern[currentPattern].matcher(line).matches()) {
103 System.out.println("Found: " + line + ".");
104 currentPattern++;
105 }
106 }
107 lastLine = line;
108 }
109 br.close();
110
111 if (currentPattern < pattern.length) {
112 throw new RuntimeException("hs_err_pid file incomplete (first missing pattern: " + currentPattern + ")");
|