From 49f9cbb5670565c7ddbc78768ff0ec14d99269eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 4 Dec 2019 20:14:16 +0100 Subject: [PATCH 091/181] fpi-ssm: Improve debugging of SSM using driver infos Always mention the driver that is triggering it --- libfprint/fpi-ssm.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/libfprint/fpi-ssm.c b/libfprint/fpi-ssm.c index 96336e1..8b3e4bd 100644 --- a/libfprint/fpi-ssm.c +++ b/libfprint/fpi-ssm.c @@ -278,7 +278,8 @@ fpi_ssm_free (FpiSsm *machine) static void __ssm_call_handler (FpiSsm *machine) { - fp_dbg ("%s entering state %d", machine->name, machine->cur_state); + fp_dbg ("[%s] %s entering state %d", fp_device_get_driver (machine->dev), + machine->name, machine->cur_state); machine->handler (machine, machine->dev); } @@ -356,9 +357,11 @@ fpi_ssm_mark_completed (FpiSsm *machine) machine->completed = TRUE; if (machine->error) - fp_dbg ("%s completed with error: %s", machine->name, machine->error->message); + fp_dbg ("[%s] %s completed with error: %s", fp_device_get_driver (machine->dev), + machine->name, machine->error->message); else - fp_dbg ("%s completed successfully", machine->name); + fp_dbg ("[%s] %s completed successfully", fp_device_get_driver (machine->dev), + machine->name); if (machine->callback) { GError *error = machine->error ? g_error_copy (machine->error) : NULL; @@ -421,12 +424,15 @@ fpi_ssm_mark_failed (FpiSsm *machine, GError *error) g_assert (error); if (machine->error) { - fp_warn ("SSM already has an error set, ignoring new error %s", error->message); + fp_warn ("[%s] SSM %s already has an error set, ignoring new error %s", + fp_device_get_driver (machine->dev), machine->name, error->message); g_error_free (error); return; } - fp_dbg ("SSM failed in state %d with error: %s", machine->cur_state, error->message); + fp_dbg ("[%s] SSM %s failed in state %d with error: %s", + fp_device_get_driver (machine->dev), machine->name, + machine->cur_state, error->message); machine->error = g_steal_pointer (&error); fpi_ssm_mark_completed (machine); } -- 2.24.1