From 196b28e311b4a36fa6cb827affea5b45218dd1de Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Fri, 20 Mar 2020 15:59:48 -0700 Subject: [PATCH] fix androidLogEntry socket name --- cereal | 2 +- selfdrive/debug/filter_log_message.py | 21 ++++++++++----------- selfdrive/logcatd/logcatd.cc | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/cereal b/cereal index 6511990644..df82a53c16 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit 6511990644c5a133518b88d0cdaec089d216f607 +Subproject commit df82a53c1669d4ca41d3090fa976c2c1860f1dab diff --git a/selfdrive/debug/filter_log_message.py b/selfdrive/debug/filter_log_message.py index 98efad383c..f7e3ec0e25 100755 --- a/selfdrive/debug/filter_log_message.py +++ b/selfdrive/debug/filter_log_message.py @@ -23,20 +23,19 @@ if __name__ == "__main__": parser.add_argument("socket", type=str, nargs='*', help="socket name") args = parser.parse_args() - if args.addr != "127.0.0.1": - os.environ["ZMQ"] = "1" - messaging.context = messaging.Context() - - poller = messaging.Poller() - sock = messaging.sub_sock("logMessage", poller, addr=args.addr) + sm = messaging.SubMaster(['logMessage', 'androidLogEntry'], addr=args.addr) min_level = LEVELS[args.level] while True: - polld = poller.poll(1000) - for sock in polld: - evt = messaging.recv_one(sock) - log = json.loads(evt.logMessage) + sm.update() + if sm.updated['logMessage']: + t = sm.logMonoTime['logMessage'] + log = json.loads(sm['logMessage']) if log['levelnum'] >= min_level: - print(f"[{evt.logMonoTime / 1e9:.6f}] {log['filename']}:{log.get('lineno', '')} - {log.get('funcname', '')}: {log['msg']}") + print(f"[{t / 1e9:.6f}] {log['filename']}:{log.get('lineno', '')} - {log.get('funcname', '')}: {log['msg']}") + if sm.updated['androidLogEntry']: + t = sm.logMonoTime['androidLogEntry'] + print(f"[{t / 1e9:.6f}] - ") + print(sm['androidLogEntry']) diff --git a/selfdrive/logcatd/logcatd.cc b/selfdrive/logcatd/logcatd.cc index 81fafb71d0..c5a64f7100 100644 --- a/selfdrive/logcatd/logcatd.cc +++ b/selfdrive/logcatd/logcatd.cc @@ -29,7 +29,7 @@ int main() { assert(kernel_logger); Context * c = Context::create(); - PubSocket * androidLog = PubSocket::create(c, "androidLog"); + PubSocket * androidLog = PubSocket::create(c, "androidLogEntry"); assert(androidLog != NULL); while (1) {