protocol-native, client: dump current connections on every new incoming connection 84/250484/7
authorSeungbae Shin <seungbae.shin@samsung.com>
Mon, 28 Dec 2020 07:44:25 +0000 (16:44 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Tue, 5 Oct 2021 02:01:02 +0000 (11:01 +0900)
[Version] 13.0-35
[Issue Type] Debugging

Change-Id: I4078d1f7c8da1d4afbe4f472298aaf7f184c62e6

packaging/pulseaudio.spec
src/pulsecore/client.c
src/pulsecore/client.h
src/pulsecore/protocol-native.c
src/pulsecore/protocol-native.h

index ffff57a..fc319a7 100644 (file)
@@ -3,7 +3,7 @@
 Name:             pulseaudio
 Summary:          Improved Linux sound server
 Version:          13.0
-Release:          34
+Release:          35
 Group:            Multimedia/Audio
 License:          LGPL-2.1
 URL:              http://pulseaudio.org
index 2e6af47..ae5f608 100644 (file)
@@ -139,6 +139,19 @@ void pa_client_update_proplist(pa_client *c, pa_update_mode_t mode, pa_proplist
     pa_subscription_post(c->core, PA_SUBSCRIPTION_EVENT_CLIENT|PA_SUBSCRIPTION_EVENT_CHANGE, c->index);
 }
 
+#ifdef __TIZEN__
+void pa_client_dump_status(pa_client *c) {
+    pa_assert(c);
+
+    pa_log_info(_("\t#%u, %s, %s(%s)"),
+           c->index, pa_strnull(c->driver),
+           pa_strnull(pa_proplist_gets(c->proplist, PA_PROP_APPLICATION_PROCESS_BINARY)),
+           pa_strnull(pa_proplist_gets(c->proplist, PA_PROP_APPLICATION_PROCESS_ID)));
+
+    /* ToDo : dump connection time */
+}
+#endif
+
 void pa_client_send_event(pa_client *c, const char *event, pa_proplist *data) {
     pa_proplist *pl = NULL;
     pa_client_send_event_hook_data hook_data;
index eb8173d..ffd19bf 100644 (file)
@@ -71,6 +71,9 @@ void pa_client_kill(pa_client *c);
 void pa_client_set_name(pa_client *c, const char *name);
 
 void pa_client_update_proplist(pa_client *c, pa_update_mode_t mode, pa_proplist *p);
+#ifdef __TIZEN__
+void pa_client_dump_status(pa_client *c);
+#endif
 
 void pa_client_send_event(pa_client *c, const char *event, pa_proplist *data);
 
index acc74b4..7cf7b01 100644 (file)
@@ -5392,6 +5392,20 @@ static void auth_timeout(pa_mainloop_api*m, pa_time_event *e, const struct timev
     }
 }
 
+#ifdef __TIZEN__
+void pa_native_protocol_dump_connections(pa_native_protocol *p) {
+    pa_native_connection *c = NULL;
+    void *state = NULL;
+
+    pa_assert(p);
+
+    pa_log_info("Dump status of current connections(%u)", pa_idxset_size(p->connections));
+
+    while ((c = pa_idxset_iterate(p->connections, &state, NULL)))
+        pa_client_dump_status(c->client);
+}
+#endif
+
 void pa_native_protocol_connect(pa_native_protocol *p, pa_iochannel *io, pa_native_options *o) {
     pa_native_connection *c;
     char pname[128];
@@ -5402,6 +5416,10 @@ void pa_native_protocol_connect(pa_native_protocol *p, pa_iochannel *io, pa_nati
     pa_assert(io);
     pa_assert(o);
 
+#ifdef __TIZEN__
+    pa_native_protocol_dump_connections(p);
+#endif
+
     if (pa_idxset_size(p->connections)+1 > MAX_CONNECTIONS) {
         pa_log_warn("Warning! Too many connections (%u), dropping incoming connection.", MAX_CONNECTIONS);
         pa_iochannel_free(io);
index 0347fdf..30cf623 100644 (file)
@@ -85,4 +85,8 @@ pa_native_options* pa_native_options_ref(pa_native_options *o);
 void pa_native_options_unref(pa_native_options *o);
 int pa_native_options_parse(pa_native_options *o, pa_core *c, pa_modargs *ma);
 
+#ifdef __TIZEN__
+void pa_native_protocol_dump_connections(pa_native_protocol *p);
+#endif
+
 #endif