[sysprof/wip/chergert/sysprof-3] sysprofd: fix error path and add some logging



commit e33bb2a2abff237b7ac020381fecea13f7ccc81e
Author: Christian Hergert <chergert redhat com>
Date:   Wed May 8 21:36:17 2019 -0700

    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 c215134..8c5263a 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 ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]