diff --git a/OOMAnalyser.html b/OOMAnalyser.html index 37168da..6ffa735 100644 --- a/OOMAnalyser.html +++ b/OOMAnalyser.html @@ -66,6 +66,47 @@ width: 100%; } + .pstable__table--noborder * { + border: none; + text-align: right; + background-color: unset; + padding-left: 5px; + padding-right: 5px; + table-layout: auto; + white-space: nowrap; + } + .pstable__table--noborder thead { + font-weight: bold; + } + + /* Align last both columns to left in the process table */ + .pstable__table--noborder td:nth-of-type(9) { + text-align: left; + } + .pstable__table--noborder td:nth-of-type(10) { + text-align: left; + } + + .js-pstable__killedproc--bgcolor { + background-color: #FFD2D2; + } + .js-pstable__triggerproc--bgcolor { + background-color: #FEEFB3; + } + + .pstable__row-pid--width { + width: 4ch; + } + .pstable__row-numeric--width { + width: 6ch; + } + .pstable__row-pages--width { + width: 12ch; + } + .pstable__row-oom-score-adj--width { + width: 16ch; + } + th { font-weight: bold; font-size: large; @@ -582,12 +623,29 @@ function goBack() { - Process Table + Process Table - -

+            
+                
+                    
+                        
+                            
+                            
+                            
+                            
+                            
+                            
+                            
+                            
+                            
+                            
+                        
+                    
+                    
+                    
+                
piduidtgidtotal_vmrssnr_ptesswapentsoom_score_adjname
@@ -684,6 +742,7 @@ function goBack() {
  • Add a textual summary of the analysis
  • Fix calculation of requested memory in kBytes
  • Fix issue that prevents units from being copied
  • +
  • Show additional information in process table
  • ...
  • diff --git a/OOMAnalyser.py b/OOMAnalyser.py index 26cd141..148c7f7 100644 --- a/OOMAnalyser.py +++ b/OOMAnalyser.py @@ -337,11 +337,6 @@ class OOMAnalyser(object): r')?', re.MULTILINE) - REC_PROCESS_TABLE = re.compile( - r'^\[ pid \].*(?:\n)' - r'(^(\[[ \d]+.+)(?:\n))+', - re.MULTILINE) - REC_PROCESS_LINE = re.compile( r'^\[(?P[ \d]+)\]\s+(?P\d+)\s+(?P\d+)\s+(?P\d+)\s+(?P\d+)\s+' r'(?P\d+)\s+(?P\d+)\s+(?P-?\d+)\s+(?P.+)\s*') @@ -464,12 +459,9 @@ class OOMAnalyser(object): gd = match.groupdict() self.results.update(match.groupdict()) - for groupname, rec in [('mem_node_info', self.REC_MEM_NODEINFO), - ('process_table', self.REC_PROCESS_TABLE), - ]: - match = rec.search(self.oom_entity.text) - if match: - self.results[groupname] = match.group() + match = self.REC_MEM_NODEINFO.search(self.oom_entity.text) + if match: + self.results['mem_node_info'] = match.group() self.results['hardware_info'] = self._extract_block_from_next_pos('Hardware name:') @@ -599,6 +591,7 @@ class OOMAnalyser(object): except: error('Converting process parameter "{}={}" to integer failed'.format(item, process[item])) + converted['name'] = process['name'] pid_int = int(pid_str) del ps[pid_str] ps[pid_int] = converted @@ -955,6 +948,45 @@ Killed process 6576 (java) total-vm:33914892kB, anon-rss:20629004kB, file-rss:0k toc_content.innerHTML = new_toc + def update_process_table(self): + """ + Re-create the process table with additional information + """ + new_table = '' + table_content = document.getElementById('process_table') + + for pid in self.oom_details['_processes'].keys(): + if pid == self.oom_details['trigger_proc_pid']: + comment = 'trigger process' + css_class = 'class="js-pstable__triggerproc--bgcolor"' + # css_class = 'class="js-pstable__killedproc--bgcolor"' + elif pid == self.oom_details['killed_proc_pid']: + comment = 'killed process' + css_class = 'class="js-pstable__killedproc--bgcolor"' + else: + comment = '' + css_class = '' + process = self.oom_details['_processes'][pid] + line = """ + + {} + {} + {} + {} + {} + {} + {} + {} + {} + {} + + """.format(css_class, pid, process['uid'], process['tgid'], process['total_vm_pages'], process['rss_pages'], + process['nr_ptes_pages'], process['swapents_pages'], process['oom_score_adj'], process['name'], + comment) + new_table += line + + table_content.innerHTML = new_table + def set_HTML_defaults(self, clean_oom=True): """Reset the HTML document but don't clean elements""" if clean_oom: @@ -977,6 +1009,11 @@ Killed process 6576 (java) total-vm:33914892kB, anon-rss:20629004kB, file-rss:0k while element.firstChild: element.removeChild(element.firstChild) + # clear process table + element = document.getElementById('process_table') + while element.firstChild: + element.removeChild(element.firstChild) + # remove svg charts for element_id in ('svg_swap', 'svg_ram'): element = document.getElementById(element_id) @@ -1153,6 +1190,9 @@ Killed process 6576 (java) total-vm:33914892kB, anon-rss:20629004kB, file-rss:0k continue self._set_item(item) + # generate process table + self.update_process_table() + # generate swap usage diagram svg_swap = self.svg_generate_bar_chart( ('Swap Used', self.oom_details['swap_used_kb']),