Commit Graph

306 Commits

Author SHA1 Message Date
Adeeb Shihadeh
ef2106ebd2 move lock clearing to uploader (#23826)
* move lock clearing to uploader

* test case
old-commit-hash: 3243d1a81e
2022-02-22 22:30:11 -08:00
Willem Melching
5517800a59 omx encoder: move writing into thread (#23771)
* omx encoder: move writing to separate thread

* fix include

* pop

* log buffers sizes

* split copy and write
old-commit-hash: 2f00271ce6
2022-02-22 13:02:50 +01:00
Willem Melching
d4f372cfd7 Update raw_logger/framereader to new new ffmpeg api (#23799)
* Update raw_logger/framereader to new new ffmpeg api

* Can be removed now

* Handled by avcodec_free_context

* handle EAGAIN and clean up
old-commit-hash: 724bab8ef3
2022-02-21 16:39:32 +01:00
Willem Melching
a7fa889605 improve logging around uploading (#23750)
* improve logging around uploading

* use int

* use raw

* duplicate
old-commit-hash: 7765bc2166
2022-02-11 12:58:41 +01:00
Shane Smiskol
85b57ccbfc scons: fix duplicate environments with test flag (#23702)
* fix duplicate environments when built with --test

* lib

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: e5005b8f44
2022-02-06 14:08:02 -08:00
Adeeb Shihadeh
1c4b6e38e9 loggerd: less error logging
old-commit-hash: 652ef27a72
2022-01-24 21:15:14 -08:00
Dean Lee
5752972827 RawLogger: downscale qcamera before encoding (#23607)
old-commit-hash: a4fefdcb94
2022-01-24 13:41:44 -08:00
Ryan
0dbb4fb3b0 Add more type hinting (#23595)
* Add more type hinting.

* Revert joystick_alert changes.

* Add typing to statsd.

* Update selfdrive/statsd.py

* Update selfdrive/test/test_fingerprints.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: aa9e635311
2022-01-21 15:11:16 -08:00
Willem Melching
962201fff1 Ensure controlsd can engage again in process replay (#23556)
* hacks to make process replay engage again

* dont change that

* enable engagement check again

* chmod +x

* first working regen

* proper logMonoTime

* fix video framerate consistency

* mpc is valid again

* proper alive checks

* revert loggerd change

* ensure engaged in regen, fix managerState, peripheralState

* ubloxRaw is unused

* add submaster config for gm

* regen all services we can run without HW

* fix loggerd

* loggerd: matroska without the extension

* update ref
old-commit-hash: d3d10e014a
2022-01-21 13:13:34 +01:00
Dean Lee
75a22388c7 loggerd: make test_loggerd.py run on PC (#23574)
* run on PC

* set frameId

* remove todo

* rawlogger: remove suffix mkv

* remove unused import PC

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 22d43211d9
2022-01-19 13:55:02 -08:00
Robbe Derks
323febbf37 Statsd (#23413)
* device side of statsd

* need to start it

* enable in manager

* add sleep

* cleanup

* remove aggregates for now and standardize on industry terms

* manager needs main

* need to have a try/except

* atomic_write_on_fs_tmp does not work

* cleaner

* use dump

Co-authored-by: Willem Melching <willem.melching@gmail.com>

* one file at a time

* limit amount of files

* move to influx line protocol and cleanup

* needs to be a list

* fix timezone bug

* actually rate limit

* add to release

* normalized origin

* also log deviceType

* more stats

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 1b49ce6ec4
2022-01-10 15:21:48 +01:00
Ewout ter Hoeven
f206ebd054 Pyupgrade 3.6: Update syntax with Python 3.6+ features (#23305)
Updated Python code with Python 3.6+ features:
- utf-8 encoding is now the default (PEP 3120)
- Replace list comprehensions by Generator Expressions (PEP 289)
- Replace yield loop by yield from (PEP 380)
- Remove the (object) subclass when defining a class
- Replace the IOError alias by OSError (PEP 3151)
- Define sets with curly braces {} instead of set()
- Remove "r" parameter from open function, which is default

Co-Authored-By: Adeeb Shihadeh <8762862+adeebshihadeh@users.noreply.github.com>
Co-Authored-By: GregorKikelj <96022003+GregorKikelj@users.noreply.github.com>

Co-authored-by: Adeeb Shihadeh <8762862+adeebshihadeh@users.noreply.github.com>
Co-authored-by: GregorKikelj <96022003+GregorKikelj@users.noreply.github.com>
old-commit-hash: 332f568a82
2021-12-24 11:18:39 -08:00
Ewout ter Hoeven
a962365292 Convert format strings strings to f-strings (#23241)
* Convert all text strings to f-strings

Reformats all the text from the old "%-formatted" and .format(...) format to the newer f-string format, as defined in PEP 498. This requires Python 3.6+.

Flynt 0.69 was used to reformat the strings. 120 f-strings were created in 51 files.

F-strings are in general more readable, concise and performant. See also: https://www.python.org/dev/peps/pep-0498/#rationale

* revert pyextra changes

* revert ublox.py

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 55390d273f
2021-12-16 14:58:17 +01:00
Dean Lee
01eb405677 put logcat in bootlog (#23217)
* put logcat in boot log

* continue

* use std::unique_ptr

* Revert "use std::unique_ptr"

This reverts commit c671f8ca7160691791bade508c4a8eb5cdb73fb8.
old-commit-hash: f042962933
2021-12-14 11:54:54 -08:00
Dean Lee
3e72a81dac Use std::unique_ptr to manage memory (#23168)
* use unique_ptr

* trigger ci

* move down loggerdstate
old-commit-hash: 4aa291c406
2021-12-13 14:16:53 +01:00
Dean Lee
a88eb06773 RawLogger: fix wrong pts (#23205)
old-commit-hash: cfad1f35e8
2021-12-13 11:46:52 +01:00
Dean Lee
dd7c226097 util: move all functions into util namespace (#23203)
old-commit-hash: 9decd3d8a2
2021-12-12 14:42:23 -08:00
Adeeb Shihadeh
916c2ed588 loggerd: fix delayed exit from main thread
old-commit-hash: 5f36b48199
2021-12-07 18:22:00 -08:00
Willem Melching
e7bf88f29f Remove Raw Upload toggle (#23143)
* Remove Raw Upload toggle

* fix tests
old-commit-hash: 2e0c73fc0c
2021-12-07 11:25:40 +01:00
Adeeb Shihadeh
1ca1d7a673 increase loggerd per-cycle service limit to 200
old-commit-hash: f71a03f967
2021-12-06 22:08:17 -08:00
Adeeb Shihadeh
f8146db9b9 loggerd: don't let a single service clog up the main thread
old-commit-hash: baf1a77ca2
2021-12-06 19:31:11 -08:00
Dean Lee
1473ec97da LogCameraInfo: remove unused variables (#23142)
old-commit-hash: ddc612e9f6
2021-12-06 14:25:28 +01:00
Dean Lee
3ba7f99688 move struct LogCameraInfo into loggerd.h (#23129)
old-commit-hash: 480fb54926
2021-12-04 21:08:55 -08:00
grekiki
9e4cc1f7ff Python: Replace more lists with generators (#23116)
* Replace lists with generators v2

* Replace set with {}

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* Replace more set() with {}

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 6951b3271d
2021-12-03 22:57:19 -08:00
Dean Lee
9b0fcaeb84 rename yuv streams (#23071)
* rename yuv streams

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 348d2d2b0d
2021-11-29 18:14:59 -08:00
Willem Melching
28dd415759 Do not run code on version.py import (#23063)
* Do not run code on version.py import

* fix athena
old-commit-hash: f7c46c6949
2021-11-29 19:38:55 +01:00
Willem Melching
3b8daea061 Clear loggerd locks once on boot (#23060)
* add test for clear_locks

* move to bootlog

* simplify test
old-commit-hash: a2f32fd3e1
2021-11-29 12:30:28 +01:00
Dean Lee
7f0beef092 loggerd: add test case for trigger_rotate (#23038)
* test rotate

* remove global LoggerdState
old-commit-hash: 1d323e0fd6
2021-11-26 14:53:09 +01:00
Dean Lee
c1ef2b7493 loggerd: add test case for sync_encoders (#23020)
old-commit-hash: b5eb02181c
2021-11-24 13:34:16 -08:00
Dean Lee
987f87cc0e loggerd: split loggerd.cc into three files
old-commit-hash: 75dd0d6296
2021-11-23 17:53:49 -08:00
Adeeb Shihadeh
44568de155 faster jenkins (#22973)
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: e13630dfee
2021-11-18 23:43:09 -08:00
Willem Melching
9399b6ae61 uploader: switch to upload_url v1.4 (#22966)
old-commit-hash: 23a1f47817
2021-11-18 16:23:50 +01:00
Willem Melching
425349a55c swaglog.py: respect LOGPRINT env variable (#22950)
* swaglog.py: respect LOGPRINT env variable

* only change handler that prints

* keep usefull manager prints

* only print running list

* revert process changes

* fix test
old-commit-hash: 77b334a698
2021-11-18 16:05:06 +01:00
Adeeb Shihadeh
35bfdce477 loggerd: trigger rotate on frame id instead of frame count (#22848)
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: ea761cbbd5
2021-11-13 15:38:10 -08:00
Willem Melching
669ed5ff2b Put journal and nvme stats in bootlog (#22849)
* Run commands and put output in bootlog

* log nvme

* fix indent

* cereal without event

* use regular array
old-commit-hash: fa0cbe5d40
2021-11-10 16:07:22 +01:00
Dean Lee
48ed0e129e loggerd/RawLogger: fix memory leak in encode_frame (#22826)
old-commit-hash: 0bd9aed82c
2021-11-08 15:27:51 -08:00
Willem Melching
19deb98bc3 wshadow: fix comma three build
old-commit-hash: 45c506bb17
2021-11-02 17:27:34 +01:00
Mayfield
43e1903073 enable wshadow (#22756)
* enable wshadow (#22714)

* fix replay

* more build fixes

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 5246f0231e
2021-11-02 17:08:53 +01:00
Dean Lee
a031b938b0 replay: improve segment download and merge (#22654)
* no-cache mode

* fix test cases build error

* space

* don't create cache dir in no-cache mode

* fix errors in test cases

* no_local_cache_

* set the number of connections by chunk_size

* use size_t instead of int64_t

* add test case for no-cache mode

* rename variables

* fix SIGSEGV

* cleanup

* faster decompressBZ2

* always decompress bz2

* add test cases

* prepare for python interface

* fix test cases build error

* continue

* camera_replay: cache remote file

* protected inheritance

* single option name

* TODO

* test_case for LogReader&FrameReader

* fix wrong require

* test case for FileReader

* cleanup test

* test:fix wrong filename

* check cached file's checksum

* fix mkdir permissions err

cleanup filereader

* remove initialize libav network libraries.

dd

* abort all loading if one failed

* cleanup tests

* use threadpool to limit concurrent downloads

* cache more segments

* merge 3 segments for replay

* one segment uses about 100M of memory

* use segments_need_merge.size()

* shutdown

* fix stuck if exit replay  before keyboard thread started

* load one segment at a time

* small cleanup

* cleanup filereader

* space

* tiny cleanup

* merge master

* cleanup test cases

* use util:create_directories

* cleanup framereader
old-commit-hash: 2b4a477fbc
2021-11-01 11:55:56 +01:00
Dean Lee
ebffd5f3ad util: add safe write functions (#22160)
* add safe write functions

* log error

* bzfile safe_fopen&safe_flush

* update test_case

* trigger ci

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 652c42da2c
2021-10-29 13:23:31 +02:00
Dean Lee
0afe7d74bc util: add new function create_directories with unit tests (#21871)
* util::create_directories

* check bool ret

* don't assume mask

* rename with_umask to no_umask

* remove umask

* rebase master

* rebase master

* 0755
old-commit-hash: 1f39d8cee6
2021-10-29 12:27:35 +02:00
Dean Lee
c401d7aff3 loggerd: fix concurrency issues in sync encoders (#22590)
* sync_encoders

* add variable camera_synced

* cleanup
old-commit-hash: 18caf3535b
2021-10-29 12:21:02 +02:00
Adeeb Shihadeh
bb7751fdb0 don't set core affinity on PC (#22706)
old-commit-hash: 5b331fd6f5
2021-10-26 21:51:46 -07:00
Willem Melching
0f77dd4506 loggerd: set encodeIdx.valid if frame id is correct (#22634)
* loggerd: set encodeIdx.valid if frame id is correct

* check valid flag in test

* test cleanup

* bump cereal
old-commit-hash: 89f311714c
2021-10-26 16:00:43 +02:00
Adeeb Shihadeh
b773f6711c loggerd: always run encoders (#22649)
* loggerd: always run encoders

* fix raw logger

* bump loggerd cpu usage
old-commit-hash: 76bd932cf5
2021-10-21 16:37:03 -07:00
Adeeb Shihadeh
25cfa2b65a tici: affine loggerd to efficiency cores (#22581)
old-commit-hash: 84de248fa7
2021-10-18 13:21:24 -07:00
Dean Lee
66ca3985c9 replay : move utility functions into separate file (#22414)
* move functions into util

* read bz2 into stream

* pre-decompress log in the download thread

* cleanup logreader

* cache sha256 path

* use readBZ2file in test_logger

* Revert "cache sha256 path"

This reverts commit 60459d3ea09a2c80f4560cf95b1ce7d6af59f06d.

* use macro

* use ostringstream

* cleanup readBZ2File

* move precise_nano_sleep into util
old-commit-hash: d28b98c602
2021-10-04 15:39:59 +02:00
Robbe Derks
0cf0485912 small typo
old-commit-hash: 3ccf712ac9
2021-09-24 10:23:41 +02:00
Adeeb Shihadeh
c0356ffe9b add log docs
old-commit-hash: 0f8c6f130b
2021-09-23 14:41:35 -07:00
ntegan1
d508125f35 Upload when on ethernet (#22188)
in addition to when on wifi

Co-authored-by: ntegan <nick@egan.gg>
old-commit-hash: 54b5972cf6
2021-09-10 12:05:12 -07:00