 8c30ab492c
			
		
	
	
		8c30ab492c
		
	
	
	
	
		
			
			Lockdep complaints are never good, so check for them in the kernel messages, not just for warnings and bugs. Signed-hostap: Johannes Berg <johannes.berg@intel.com>
		
			
				
	
	
		
			31 lines
		
	
	
	
		
			841 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
	
		
			841 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| # kernel message checker module
 | |
| #
 | |
| # Copyright (c) 2013, Intel Corporation
 | |
| #
 | |
| # Author: Johannes Berg <johannes@sipsolutions.net>
 | |
| #
 | |
| # This software may be distributed under the terms of the BSD license.
 | |
| # See README for more details.
 | |
| #
 | |
| """
 | |
| Tests for kernel messages to find if there were any issues in them.
 | |
| """
 | |
| 
 | |
| import re
 | |
| 
 | |
| lockdep_messages = [
 | |
|   'possible circular locking dependency',
 | |
|   '.*-safe -> .*unsafe lock order detected',
 | |
|   'possible recursive locking detected',
 | |
|   'inconsistent lock state',
 | |
|   'possible irq lock inversion dependency',
 | |
|   'suspicious RCU usage',
 | |
| ]
 | |
| lockdep = r'(\[\s*)?INFO: (%s)' % ('|'.join(lockdep_messages), )
 | |
| issue = re.compile('(\[[0-9 .]*\] )?(WARNING:|BUG:|%s).*' % lockdep)
 | |
| 
 | |
| def check_kernel(logfile):
 | |
|     for line in open(logfile, 'r'):
 | |
|         if issue.match(line):
 | |
|             return False
 | |
|     return True
 |