From 4a6f7324c18dccfb0f32b145a6b4e1d93eceb4cc Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Wed, 8 May 2019 21:36:17 -0700 Subject: [PATCH] sysprofd: fix error path and add some logging --- src/sysprofd/ipc-service-impl.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/sysprofd/ipc-service-impl.c b/src/sysprofd/ipc-service-impl.c index c2151343..8c5263ad 100644 --- a/src/sysprofd/ipc-service-impl.c +++ b/src/sysprofd/ipc-service-impl.c @@ -51,6 +51,8 @@ ipc_service_impl_handle_list_processes (IpcService *service, g_assert (IPC_IS_SERVICE_IMPL (service)); g_assert (G_IS_DBUS_METHOD_INVOCATION (invocation)); + g_message ("ListProcesses()"); + if (!(dir = g_dir_open ("/proc/", 0, NULL))) { g_dbus_method_invocation_return_error (g_steal_pointer (&invocation), @@ -99,6 +101,8 @@ ipc_service_impl_handle_get_proc_file (IpcService *service, g_assert (IPC_IS_SERVICE_IMPL (service)); g_assert (G_IS_DBUS_METHOD_INVOCATION (invocation)); + g_message ("GetProcFile(%s)", path); + canon = g_canonicalize_filename (path, "/proc/"); if (!g_str_has_prefix (canon, "/proc/")) @@ -168,6 +172,8 @@ ipc_service_impl_handle_perf_event_open (IpcService *service, g_assert (IPC_IS_SERVICE_IMPL (service)); g_assert (G_IS_DBUS_METHOD_INVOCATION (invocation)); + g_message ("PerfEventOpen(pid=%d, cpu=%d)", pid, cpu); + if (pid < -1 || cpu < -1) { g_dbus_method_invocation_return_error (g_steal_pointer (&invocation), @@ -307,6 +313,7 @@ ipc_service_impl_handle_perf_event_open (IpcService *service, G_DBUS_ERROR_FAILED, "Failed to open perf event stream: %s", g_strerror (errno)); + return TRUE; } fd_list = g_unix_fd_list_new ();