fingerprinting: log FW query time (#27880)

* Update car_helpers.py

* put in carParams

* bumpcereal

* rename

* bump cereal

* add cached

* bump cereal

* just add to fingerprinted event
pull/29623/head
Shane Smiskol 2 years ago committed by GitHub
parent 465a72a87d
commit ae2a6537b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      selfdrive/car/car_helpers.py

@ -1,4 +1,5 @@
import os
import time
from typing import Callable, Dict, List, Optional, Tuple
from cereal import car
@ -125,6 +126,7 @@ def fingerprint(logcan, sendcan, num_pandas):
ecu_rx_addrs = set()
params = Params()
start_time = time.monotonic()
if not skip_fw_query:
# Vin query only reliably works through OBDII
bus = 1
@ -165,6 +167,8 @@ def fingerprint(logcan, sendcan, num_pandas):
set_obd_multiplexing(params, False)
params.put_bool("FirmwareQueryDone", True)
fw_query_time = time.monotonic() - start_time
# CAN fingerprint
# drain CAN socket so we get the latest messages
messaging.drain_sock_raw(logcan)
@ -185,7 +189,7 @@ def fingerprint(logcan, sendcan, num_pandas):
cloudlog.event("fingerprinted", car_fingerprint=car_fingerprint, source=source, fuzzy=not exact_match, cached=cached,
fw_count=len(car_fw), ecu_responses=list(ecu_rx_addrs), vin_rx_addr=vin_rx_addr, fingerprints=finger,
error=True)
fw_query_time=fw_query_time, error=True)
return car_fingerprint, finger, vin, car_fw, source, exact_match

Loading…
Cancel
Save