diff options
Diffstat (limited to 'src/Daemon')
-rw-r--r-- | src/Daemon/CommLayerServerDBus.cpp | 13 | ||||
-rw-r--r-- | src/Daemon/CrashWatcher.cpp | 3 | ||||
-rw-r--r-- | src/Daemon/Daemon.cpp | 3 | ||||
-rw-r--r-- | src/Daemon/MiddleWare.cpp | 22 |
4 files changed, 30 insertions, 11 deletions
diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp index c3cef3b5..051a4b28 100644 --- a/src/Daemon/CommLayerServerDBus.cpp +++ b/src/Daemon/CommLayerServerDBus.cpp @@ -363,6 +363,7 @@ void CCommLayerServerDBus::Crash(const std::string& progname, const std::string& DBUS_TYPE_STRING, &c_progname, DBUS_TYPE_STRING, &c_uid, DBUS_TYPE_INVALID); + VERB2 log("Sending signal Crash('%s','%s')", c_progname, c_uid); send_flush_and_unref(msg); } @@ -373,28 +374,35 @@ void CCommLayerServerDBus::AnalyzeComplete(const map_crash_report_t& arg1) DBusMessageIter out_iter; dbus_message_iter_init_append(msg, &out_iter); store_val(&out_iter, arg1); + VERB2 log("Sending signal AnalyzeComplete([%d elements])", (int)arg1.size()); send_flush_and_unref(msg); } void CCommLayerServerDBus::JobDone(const char* pDest, uint64_t job_id) { DBusMessage* msg = new_signal_msg("JobDone"); - /* TODO: if (!dbus_message_set_destination(msg, pDest) die_out_of_memory(); */ + /* send unicast dbus signal */ + if (!dbus_message_set_destination(msg, pDest)) + die_out_of_memory(); dbus_message_append_args(msg, DBUS_TYPE_STRING, &pDest, /* TODO: redundant parameter, remove from API */ DBUS_TYPE_UINT64, &job_id, DBUS_TYPE_INVALID); + VERB2 log("Sending signal JobDone('%s',%llx)", pDest, (unsigned long long)job_id); send_flush_and_unref(msg); } void CCommLayerServerDBus::JobStarted(const char* pDest, uint64_t job_id) { DBusMessage* msg = new_signal_msg("JobStarted"); - /* TODO: if (!dbus_message_set_destination(msg, pDest) die_out_of_memory(); */ + /* send unicast dbus signal */ + if (!dbus_message_set_destination(msg, pDest)) + die_out_of_memory(); dbus_message_append_args(msg, DBUS_TYPE_STRING, &pDest, /* TODO: redundant parameter, remove from API */ DBUS_TYPE_UINT64, &job_id, DBUS_TYPE_INVALID); + VERB2 log("Sending signal JobStarted('%s',%llx)", pDest, (unsigned long long)job_id); send_flush_and_unref(msg); } @@ -419,6 +427,7 @@ void CCommLayerServerDBus::Update(const std::string& pMessage, uint64_t job_id) send_flush_and_unref(msg); } +/* TODO: one Warning()? */ void CCommLayerServerDBus::Warning(const std::string& pMessage) { DBusMessage* msg = new_signal_msg("Warning"); diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp index 06afabda..1b17af69 100644 --- a/src/Daemon/CrashWatcher.cpp +++ b/src/Daemon/CrashWatcher.cpp @@ -142,6 +142,7 @@ static void *create_report(void *arg) pthread_mutex_lock(&g_pJobsMutex); g_pending_jobs[std::string(thread_data->UID)][uint64_t(thread_data->thread_id)] = crashReport; pthread_mutex_unlock(&g_pJobsMutex); + g_pCommLayer->JobDone(thread_data->dest, uint64_t(thread_data->thread_id)); } catch (CABRTException& e) @@ -179,7 +180,7 @@ uint64_t CreateReport_t(const char* pUUID, const char* pUID, const char* pSender free(thread_data->dest); free(thread_data); /* The only reason this may happen is system-wide resource starvation, - * or ulimit is exceeded (someoune floods us with CreateReport() dbus calls?) + * or ulimit is exceeded (someone floods us with CreateReport() dbus calls?) */ error_msg("cannot create thread"); return 0; diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index fc28e8b3..149b2bda 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -503,7 +503,8 @@ static gboolean handle_event_cb(GIOChannel *gio, GIOCondition condition, gpointe /* ignore lock files and such */ if (!(event->mask & IN_ISDIR)) { - VERB3 log("File '%s' creation detected, ignoring", name); + // Happens all the time during normal run + //VERB3 log("File '%s' creation detected, ignoring", name); continue; } diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index e6c9187c..4f499d68 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -173,33 +173,42 @@ mw_result_t CreateCrashReport(const std::string& pUUID, const std::string& pUID, map_crash_report_t& pCrashReport) { - CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase); - database_row_t row; - database->Connect(); - row = database->GetUUIDData(pUUID, pUID); - database->DisConnect(); - CDebugDump dd; + VERB2 log("CreateCrashReport('%s','%',result)", pUUID.c_str(), pUID.c_str()); + database_row_t row; + if (pUUID != "") + { + CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase); + database->Connect(); + row = database->GetUUIDData(pUUID, pUID); + database->DisConnect(); + } if (pUUID == "" || row.m_sUUID != pUUID) { warn_client("CreateCrashReport(): UUID '"+pUUID+"' is not in database."); return MW_IN_DB_ERROR; } + CDebugDump dd; try { std::string analyzer; std::string gUUID; + VERB3 log(" LoadText(FILENAME_ANALYZER,'%s')", row.m_sDebugDumpDir.c_str()); dd.Open(row.m_sDebugDumpDir); dd.LoadText(FILENAME_ANALYZER, analyzer); dd.Close(); + VERB3 log(" CreateReport('%s')", analyzer.c_str()); CreateReport(analyzer, row.m_sDebugDumpDir); gUUID = GetGlobalUUID(analyzer, row.m_sDebugDumpDir); + VERB3 log(" GetGlobalUUID:'%s'", gUUID.c_str()); + VERB3 log(" RunAnalyzerActions"); RunAnalyzerActions(analyzer, row.m_sDebugDumpDir); + VERB3 log(" DebugDumpToCrashReport"); DebugDumpToCrashReport(row.m_sDebugDumpDir, pCrashReport); add_crash_data_to_crash_report(pCrashReport, CD_UUID, CD_TXT, CD_ISNOTEDITABLE, gUUID); @@ -245,7 +254,6 @@ void RunAction(const std::string& pActionDir, warn_client("RunAction(): " + e.what()); update_client("Execution of '"+pPluginName+"' was not successful: " + e.what()); } - } void RunActionsAndReporters(const std::string& pDebugDumpDir) |