| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -20,12 +20,12 @@ from openpilot.selfdrive.selfdrived.events import Events, ET | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					from openpilot.selfdrive.selfdrived.state import StateMachine | 
					 | 
					 | 
					 | 
					from openpilot.selfdrive.selfdrived.state import StateMachine | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					from openpilot.selfdrive.selfdrived.alertmanager import AlertManager, set_offroad_alert | 
					 | 
					 | 
					 | 
					from openpilot.selfdrive.selfdrived.alertmanager import AlertManager, set_offroad_alert | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					from openpilot.system.hardware import HARDWARE | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					from openpilot.system.version import get_build_metadata | 
					 | 
					 | 
					 | 
					from openpilot.system.version import get_build_metadata | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					REPLAY = "REPLAY" in os.environ | 
					 | 
					 | 
					 | 
					REPLAY = "REPLAY" in os.environ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					SIMULATION = "SIMULATION" in os.environ | 
					 | 
					 | 
					 | 
					SIMULATION = "SIMULATION" in os.environ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					TESTING_CLOSET = "TESTING_CLOSET" in os.environ | 
					 | 
					 | 
					 | 
					TESTING_CLOSET = "TESTING_CLOSET" in os.environ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					IGNORE_PROCESSES = {"loggerd", "encoderd", "statsd"} | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					LONGITUDINAL_PERSONALITY_MAP = {v: k for k, v in log.LongitudinalPersonality.schema.enumerants.items()} | 
					 | 
					 | 
					 | 
					LONGITUDINAL_PERSONALITY_MAP = {v: k for k, v in log.LongitudinalPersonality.schema.enumerants.items()} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					ThermalStatus = log.DeviceState.ThermalStatus | 
					 | 
					 | 
					 | 
					ThermalStatus = log.DeviceState.ThermalStatus | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -115,6 +115,12 @@ class SelfdriveD: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    self.state_machine = StateMachine() | 
					 | 
					 | 
					 | 
					    self.state_machine = StateMachine() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    self.rk = Ratekeeper(100, print_delay_threshold=None) | 
					 | 
					 | 
					 | 
					    self.rk = Ratekeeper(100, print_delay_threshold=None) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    # some comma three with NVMe experience NVMe dropouts mid-drive that | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    # cause loggerd to crash on write, so ignore it only on that platform | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    self.ignored_processes = set() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    if HARDWARE.get_device_type() == 'tici' and os.path.exists('/dev/nvme0'): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      self.ignored_processes = {'loggerd', } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    # Determine startup event | 
					 | 
					 | 
					 | 
					    # Determine startup event | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    self.startup_event = EventName.startup if build_metadata.openpilot.comma_remote and build_metadata.tested_channel else EventName.startupMaster | 
					 | 
					 | 
					 | 
					    self.startup_event = EventName.startup if build_metadata.openpilot.comma_remote and build_metadata.tested_channel else EventName.startupMaster | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if not car_recognized: | 
					 | 
					 | 
					 | 
					    if not car_recognized: | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -258,7 +264,7 @@ class SelfdriveD: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      if not_running != self.not_running_prev: | 
					 | 
					 | 
					 | 
					      if not_running != self.not_running_prev: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        cloudlog.event("process_not_running", not_running=not_running, error=True) | 
					 | 
					 | 
					 | 
					        cloudlog.event("process_not_running", not_running=not_running, error=True) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      self.not_running_prev = not_running | 
					 | 
					 | 
					 | 
					      self.not_running_prev = not_running | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if self.sm.recv_frame['managerState'] and (not_running - IGNORE_PROCESSES): | 
					 | 
					 | 
					 | 
					    if self.sm.recv_frame['managerState'] and (not_running - self.ignored_processes): | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      self.events.add(EventName.processNotRunning) | 
					 | 
					 | 
					 | 
					      self.events.add(EventName.processNotRunning) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    else: | 
					 | 
					 | 
					 | 
					    else: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      if not SIMULATION and not self.rk.lagging: | 
					 | 
					 | 
					 | 
					      if not SIMULATION and not self.rk.lagging: | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |