plugin-manager: new debug logs to help track probing issues
This commit is contained in:
@@ -203,21 +203,42 @@ port_probe_context_finished (PortProbeContext *port_probe_ctx)
|
|||||||
/* Remove us from the list of running probes */
|
/* Remove us from the list of running probes */
|
||||||
g_assert (g_list_find (ctx->running_probes, port_probe_ctx) != NULL);
|
g_assert (g_list_find (ctx->running_probes, port_probe_ctx) != NULL);
|
||||||
ctx->running_probes = g_list_remove (ctx->running_probes, port_probe_ctx);
|
ctx->running_probes = g_list_remove (ctx->running_probes, port_probe_ctx);
|
||||||
port_probe_context_free (port_probe_ctx);
|
|
||||||
|
|
||||||
/* If there are running probes around, wait for them to finish */
|
/* If there are running probes around, wait for them to finish */
|
||||||
if (ctx->running_probes != NULL)
|
if (ctx->running_probes != NULL) {
|
||||||
return;
|
GList *l;
|
||||||
|
GString *s = NULL;
|
||||||
|
guint i = 0;
|
||||||
|
|
||||||
|
for (l = ctx->running_probes; l; l = g_list_next (l)) {
|
||||||
|
const gchar *portname = g_udev_device_get_name (((PortProbeContext *)l->data)->port);
|
||||||
|
|
||||||
|
if (!s)
|
||||||
|
s = g_string_new (portname);
|
||||||
|
else
|
||||||
|
g_string_append_printf (s, ", %s", portname);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
mm_dbg ("(Plugin Manager) '%s' port probe finished, still %u running probes in this device (%s)",
|
||||||
|
g_udev_device_get_name (port_probe_ctx->port), i, s->str);
|
||||||
|
g_string_free (s, TRUE);
|
||||||
|
}
|
||||||
/* If we didn't use the minimum probing time, wait for it to finish */
|
/* If we didn't use the minimum probing time, wait for it to finish */
|
||||||
if (ctx->timeout_id > 0)
|
else if (ctx->timeout_id > 0) {
|
||||||
return;
|
mm_dbg ("(Plugin Manager) '%s' port probe finished, last one in device, but minimum probing time not consumed yet",
|
||||||
|
g_udev_device_get_name (port_probe_ctx->port));
|
||||||
|
} else {
|
||||||
|
mm_dbg ("(Plugin Manager) '%s' port probe finished, last one in device",
|
||||||
|
g_udev_device_get_name (port_probe_ctx->port));
|
||||||
/* If we just finished the last running probe, we can now finish the device
|
/* If we just finished the last running probe, we can now finish the device
|
||||||
* support check */
|
* support check */
|
||||||
find_device_support_context_complete_and_free (ctx);
|
find_device_support_context_complete_and_free (ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
port_probe_context_free (port_probe_ctx);
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
deferred_support_check_idle (PortProbeContext *port_probe_ctx)
|
deferred_support_check_idle (PortProbeContext *port_probe_ctx)
|
||||||
{
|
{
|
||||||
@@ -539,8 +560,10 @@ min_probing_timeout_cb (FindDeviceSupportContext *ctx)
|
|||||||
ctx->timeout_id = 0;
|
ctx->timeout_id = 0;
|
||||||
|
|
||||||
/* If there are no running probes around, we're free to finish */
|
/* If there are no running probes around, we're free to finish */
|
||||||
if (ctx->running_probes == NULL)
|
if (ctx->running_probes == NULL) {
|
||||||
|
mm_dbg ("(Plugin Manager) Minimum probing time consumed and no more ports to probe");
|
||||||
find_device_support_context_complete_and_free (ctx);
|
find_device_support_context_complete_and_free (ctx);
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user