selfdrive package

Subpackages

Submodules

selfdrive.logmessaged module

selfdrive.logmessaged.main() NoReturn[source]

selfdrive.rtshield module

selfdrive.rtshield.main() NoReturn[source]

selfdrive.sentry module

Install exception handler for process crash.

class selfdrive.sentry.SentryProject(value)[source]

Bases: enum.Enum

An enumeration.

SELFDRIVE = 'https://6f3c7076c1e14b2aa10f5dde6dda0cc4@o33823.ingest.sentry.io/77924'
SELFDRIVE_NATIVE = 'https://3e4b586ed21a4479ad5d85083b639bc6@o33823.ingest.sentry.io/157615'
selfdrive.sentry.capture_exception(*args, **kwargs) None[source]
selfdrive.sentry.init(project: selfdrive.sentry.SentryProject) None[source]
selfdrive.sentry.report_tombstone(fn: str, message: str, contents: str) None[source]
selfdrive.sentry.set_tag(key: str, value: str) None[source]

selfdrive.statsd module

class selfdrive.statsd.METRIC_TYPE[source]

Bases: object

GAUGE = 'g'
SAMPLE = 'sa'
class selfdrive.statsd.StatLog[source]

Bases: object

connect() None[source]
gauge(name: str, value: float) None[source]
sample(name: str, value: float)[source]
selfdrive.statsd.main() NoReturn[source]

selfdrive.swaglog module

class selfdrive.swaglog.SwaglogRotatingFileHandler(base_filename, interval=60, max_bytes=262144, backup_count=2500, encoding=None)[source]

Bases: logging.handlers.BaseRotatingHandler

doRollover()[source]
get_existing_logfiles()[source]
shouldRollover(record)[source]
class selfdrive.swaglog.UnixDomainSocketHandler(formatter)[source]

Bases: logging.Handler

connect()[source]
emit(record)[source]

Do whatever it takes to actually log the specified logging record.

This version is intended to be implemented by subclasses and so raises a NotImplementedError.

selfdrive.swaglog.add_file_handler(log)[source]

Function to add the file log handler to swaglog. This can be used to store logs when logmessaged is not running.

selfdrive.swaglog.get_file_handler()[source]

selfdrive.timezoned module

selfdrive.timezoned.main() NoReturn[source]
selfdrive.timezoned.set_timezone(valid_timezones, timezone)[source]

selfdrive.tombstoned module

selfdrive.tombstoned.clear_apport_folder()[source]
selfdrive.tombstoned.get_apport_stacktrace(fn)[source]
selfdrive.tombstoned.get_tombstones()[source]

Returns list of (filename, ctime) for all tombstones in /data/tombstones and apport crashlogs in /var/crash

selfdrive.tombstoned.main() NoReturn[source]
selfdrive.tombstoned.report_tombstone_android(fn)[source]
selfdrive.tombstoned.report_tombstone_apport(fn)[source]
selfdrive.tombstoned.safe_fn(s)[source]

selfdrive.updated module

class selfdrive.updated.WaitTimeHelper(proc)[source]

Bases: object

graceful_shutdown(signum: int, frame) None[source]
sleep(t: float) None[source]
update_now(signum: int, frame) None[source]
selfdrive.updated.check_for_update() Tuple[bool, bool][source]
selfdrive.updated.check_git_fetch_result(fetch_txt: str) bool[source]
selfdrive.updated.dismount_overlay() None[source]
selfdrive.updated.fetch_update(wait_helper: selfdrive.updated.WaitTimeHelper) bool[source]
selfdrive.updated.finalize_update() None[source]

Take the current OverlayFS merged view and finalize a copy outside of OverlayFS, ready to be swapped-in at BASEDIR. Copy using shutil.copytree

selfdrive.updated.handle_agnos_update(wait_helper: selfdrive.updated.WaitTimeHelper) None[source]
selfdrive.updated.handle_neos_update(wait_helper: selfdrive.updated.WaitTimeHelper) None[source]
selfdrive.updated.init_overlay() None[source]
selfdrive.updated.main() None[source]
selfdrive.updated.run(cmd: List[str], cwd: Optional[str] = None, low_priority: bool = False)[source]
selfdrive.updated.set_consistent_flag(consistent: bool) None[source]
selfdrive.updated.set_params(new_version: bool, failed_count: int, exception: Optional[str]) None[source]
selfdrive.updated.setup_git_options(cwd: str) None[source]

selfdrive.version module

selfdrive.version.cache(user_function, /)[source]
selfdrive.version.get_branch(default: Optional[str] = None) Optional[str][source]
selfdrive.version.get_commit(branch: str = 'HEAD', default: Optional[str] = None) Optional[str][source]
selfdrive.version.get_normalized_origin(default: Optional[str] = None) Optional[str][source]
selfdrive.version.get_origin(default: Optional[str] = None) Optional[str][source]
selfdrive.version.get_short_branch(default: Optional[str] = None) Optional[str][source]
selfdrive.version.get_short_version() str[source]
selfdrive.version.get_version() str[source]
selfdrive.version.is_comma_remote() bool[source]
selfdrive.version.is_dirty() bool[source]
selfdrive.version.is_prebuilt() bool[source]
selfdrive.version.is_tested_branch() bool[source]
selfdrive.version.run_cmd(cmd: List[str]) str[source]
selfdrive.version.run_cmd_default(cmd: List[str], default: Optional[str] = None) Optional[str][source]

Module contents