| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -3,6 +3,8 @@ import bz2 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import math | 
					 | 
					 | 
					 | 
					import math | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import json | 
					 | 
					 | 
					 | 
					import json | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import os | 
					 | 
					 | 
					 | 
					import os | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					import pathlib | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					import psutil | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import shutil | 
					 | 
					 | 
					 | 
					import shutil | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import subprocess | 
					 | 
					 | 
					 | 
					import subprocess | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import time | 
					 | 
					 | 
					 | 
					import time | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -151,6 +153,8 @@ class TestOnroad(unittest.TestCase): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      cls.segments = cls.segments[:-1] | 
					 | 
					 | 
					 | 
					      cls.segments = cls.segments[:-1] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    finally: | 
					 | 
					 | 
					 | 
					    finally: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      cls.gpu_procs = {psutil.Process(int(f.name)).name() for f in pathlib.Path('/sys/devices/virtual/kgsl/kgsl/proc/').iterdir() if f.is_dir()} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      if proc is not None: | 
					 | 
					 | 
					 | 
					      if proc is not None: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        proc.terminate() | 
					 | 
					 | 
					 | 
					        proc.terminate() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if proc.wait(60) is None: | 
					 | 
					 | 
					 | 
					        if proc.wait(60) is None: | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -296,6 +300,9 @@ class TestOnroad(unittest.TestCase): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    # expected to go up while the MSGQ buffers fill up | 
					 | 
					 | 
					 | 
					    # expected to go up while the MSGQ buffers fill up | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    self.assertLessEqual(max(mems) - min(mems), 3.0) | 
					 | 
					 | 
					 | 
					    self.assertLessEqual(max(mems) - min(mems), 3.0) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  def test_gpu_usage(self): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    self.assertEqual(self.gpu_procs, {"weston", "_ui", "mapsd", "camerad", "selfdrive.modeld.modeld"}) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  def test_camera_processing_time(self): | 
					 | 
					 | 
					 | 
					  def test_camera_processing_time(self): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    result = "\n" | 
					 | 
					 | 
					 | 
					    result = "\n" | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    result += "------------------------------------------------\n" | 
					 | 
					 | 
					 | 
					    result += "------------------------------------------------\n" | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |