summaryrefslogtreecommitdiff
path: root/spa/plugins/bluez5
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2019-05-30 13:01:15 +0200
committerWim Taymans <wtaymans@redhat.com>2019-05-30 13:01:15 +0200
commitc8cbb7e322e88167c6ffd6818ee5a0328345f37f (patch)
tree850866b37b1789656b916c59a2704179b6a5a5f4 /spa/plugins/bluez5
parent9785d998213fdb32a91c9d22c214f22b72d74120 (diff)
bluez5: improve debug
Diffstat (limited to 'spa/plugins/bluez5')
-rw-r--r--spa/plugins/bluez5/bluez5-device.c11
-rw-r--r--spa/plugins/bluez5/bluez5-monitor.c17
2 files changed, 16 insertions, 12 deletions
diff --git a/spa/plugins/bluez5/bluez5-device.c b/spa/plugins/bluez5/bluez5-device.c
index 0976d8e1..63cd72c1 100644
--- a/spa/plugins/bluez5/bluez5-device.c
+++ b/spa/plugins/bluez5/bluez5-device.c
@@ -79,14 +79,17 @@ static int emit_source_node(struct impl *this)
enum spa_bt_profile profile = SPA_BT_PROFILE_NULL;
if (device->connected_profiles & SPA_BT_PROFILE_A2DP_SOURCE) {
- spa_log_info(this->log, "A2DP (source) profile found");
+ spa_log_info(this->log, "device %p: A2DP (source) profile found",
+ device);
profile = SPA_BT_PROFILE_A2DP_SOURCE;
} else if (device->connected_profiles & SPA_BT_PROFILE_HSP_HS) {
- spa_log_info(this->log, "HSP (source) profile found (Not implemented yet)");
+ spa_log_info(this->log, "device %p: HSP (source) profile found (Not implemented yet)",
+ device);
profile = SPA_BT_PROFILE_HSP_HS;
return -ENODEV;
} else if (device->connected_profiles & SPA_BT_PROFILE_HFP_HF) {
- spa_log_info(this->log, "HFP (source) profile found (Not implemented yet)");
+ spa_log_info(this->log, "device %p: HFP (source) profile found (Not implemented yet)",
+ device);
profile = SPA_BT_PROFILE_HFP_HF;
return -ENODEV;
}
@@ -116,7 +119,7 @@ static int emit_source_node(struct impl *this)
}
}
- spa_log_info (this->log, "bluez5 source nodes emitted");
+ spa_log_info (this->log, "device %p: bluez5 source nodes emitted", device);
return 0;
}
diff --git a/spa/plugins/bluez5/bluez5-monitor.c b/spa/plugins/bluez5/bluez5-monitor.c
index 5eb25898..8960d366 100644
--- a/spa/plugins/bluez5/bluez5-monitor.c
+++ b/spa/plugins/bluez5/bluez5-monitor.c
@@ -545,7 +545,8 @@ static void device_timer_event(struct spa_source *source)
if (read(source->fd, &exp, sizeof(uint64_t)) != sizeof(uint64_t))
spa_log_warn(monitor->log, "error reading timerfd: %s", strerror(errno));
- spa_log_debug(monitor->log, "timeout %08x %08x", device->profiles, device->connected_profiles);
+ spa_log_debug(monitor->log, "device %p: timeout %08x %08x",
+ device, device->profiles, device->connected_profiles);
device_add(device->monitor, device);
}
@@ -555,7 +556,7 @@ static int device_start_timer(struct spa_bt_device *device)
struct spa_bt_monitor *monitor = device->monitor;
struct itimerspec ts;
- spa_log_debug(monitor->log, "start timer");
+ spa_log_debug(monitor->log, "device %p: start timer", device);
if (device->timer.data == NULL) {
device->timer.data = device;
device->timer.func = device_timer_event;
@@ -580,7 +581,7 @@ static int device_stop_timer(struct spa_bt_device *device)
if (device->timer.data == NULL)
return 0;
- spa_log_debug(monitor->log, "stop timer");
+ spa_log_debug(monitor->log, "device %p: stop timer", device);
spa_loop_remove_source(monitor->main_loop, &device->timer);
ts.it_value.tv_sec = 0;
ts.it_value.tv_nsec = 0;
@@ -602,8 +603,8 @@ static int device_check_profiles(struct spa_bt_device *device, bool force)
if (connected_profiles & SPA_BT_PROFILE_HEADSET_AUDIO_GATEWAY)
connected_profiles |= SPA_BT_PROFILE_HEADSET_AUDIO_GATEWAY;
- spa_log_debug(monitor->log, "profiles %08x %08x %d",
- device->profiles, connected_profiles, device->added);
+ spa_log_debug(monitor->log, "device %p: profiles %08x %08x %d",
+ device, device->profiles, connected_profiles, device->added);
if (connected_profiles == 0) {
if (device->added) {
@@ -1441,7 +1442,7 @@ static int sco_do_accept(struct spa_bt_transport *t)
memset(&addr, 0, sizeof(addr));
optlen = sizeof(addr);
- spa_log_info(monitor->log, "doing accept");
+ spa_log_info(monitor->log, "transport %p: doing accept", t);
sock = accept(td->sco.fd, (struct sockaddr *) &addr, &optlen);
if (sock < 0) {
if (errno != EAGAIN)
@@ -1497,7 +1498,7 @@ static int sco_do_connect(struct spa_bt_transport *t)
addr.sco_family = AF_BLUETOOTH;
bacpy(&addr.sco_bdaddr, &dst);
- spa_log_info(monitor->log, "doing connect");
+ spa_log_info(monitor->log, "transport %p: doing connect", t);
err = connect(sock, (struct sockaddr *) &addr, len);
if (err < 0 && !(errno == EAGAIN || errno == EINPROGRESS)) {
spa_log_error(monitor->log, "connect(): %s", strerror(errno));
@@ -1613,7 +1614,7 @@ static int sco_listen(struct spa_bt_transport *t)
goto fail_close;
}
- spa_log_info(monitor->log, "doing listen");
+ spa_log_info(monitor->log, "transport %p: doing listen", t);
if (listen(sock, 1) < 0) {
spa_log_error(monitor->log, "listen(): %m");
goto fail_close;