dump_systemstate: Dump additional files and applications output 31/217031/6
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Tue, 5 Nov 2019 13:15:51 +0000 (14:15 +0100)
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>
Fri, 22 Nov 2019 16:38:55 +0000 (17:38 +0100)
Change-Id: I2c1348a25f7da30c5a177489eb4e57aed5f730ea

packaging/crash-worker.spec
src/dump_systemstate/CMakeLists.txt
src/dump_systemstate/dump_systemstate.c
src/dump_systemstate/files.conf.example
src/dump_systemstate/files/10-crash-worker.conf [new file with mode: 0644]
src/dump_systemstate/programs.conf.example
src/dump_systemstate/programs/10-crash-worker.conf [new file with mode: 0644]

index 148e3f4..4a5e9ac 100644 (file)
@@ -165,7 +165,9 @@ mkdir -p %{buildroot}%{crash_temp}
 %attr(0750,crash_worker,crash_worker) %{_bindir}/crash-manager
 %attr(0750,crash_worker,crash_worker) %{_bindir}/dump_systemstate
 %{_sysconfdir}/dump_systemstate.conf.d/files/files.conf.example
+%{_sysconfdir}/dump_systemstate.conf.d/files/10-crash-worker.conf
 %{_sysconfdir}/dump_systemstate.conf.d/programs/programs.conf.example
+%{_sysconfdir}/dump_systemstate.conf.d/programs/10-crash-worker.conf
 %{_libexecdir}/crash-stack
 %{_libexecdir}/crash-popup-launch
 %{_libexecdir}/crash-notify-send
index 7c3fa21..d659aa4 100755 (executable)
@@ -34,6 +34,12 @@ INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/src/${PROJECT_NAME}/files.conf.example
                           DESTINATION ${DUMP_SYSTEMSTATE_CONFIG_DIR_PATH}/files
                           PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/src/${PROJECT_NAME}/files/10-crash-worker.conf
+                          DESTINATION ${DUMP_SYSTEMSTATE_CONFIG_DIR_PATH}/files
+                          PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/src/${PROJECT_NAME}/programs.conf.example
                           DESTINATION ${DUMP_SYSTEMSTATE_CONFIG_DIR_PATH}/programs
                           PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/src/${PROJECT_NAME}/programs/10-crash-worker.conf
+                          DESTINATION ${DUMP_SYSTEMSTATE_CONFIG_DIR_PATH}/programs
+                          PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
index 9a0c3ef..46f11f3 100644 (file)
@@ -191,6 +191,14 @@ int main(int argc, char *argv[])
                char *du_args[] = {"/bin/du", "-ah", "/opt", "--exclude=/opt/usr", NULL};
                spawn_wait_checked(du_args, NULL);
        }
+
+       dpercent = get_disk_used_percent("/tmp");
+       if (80 < dpercent) {
+               fprintf_fd(out_fd, "\n==== tmp usage detail - %d%% (/bin/du -h /tmp)\n", dpercent);
+               char *du_args[] = {"/bin/du", "-h", "/tmp", NULL};
+               spawn_wait_checked(du_args, NULL);
+       }
+
        fprintf_fd(out_fd, "\n==== System timezone (ls -al /opt/etc/localtime)\n");
        char *ls_args[] = {"/bin/ls", "-al", "/opt/etc/localtime", NULL};
        spawn_wait_checked(ls_args, NULL);
index 92d5f22..e8c73c2 100644 (file)
@@ -1,3 +1,9 @@
+# Please consider prefixing config names with numbers (NN-) if you need order
+# to be preserved.
+#
+# Crash-worker reserves number 00-19 for its purpose. Please add files
+# with number > 20.
+
 [UNIQUE_ID_KEY]
 title=header line that gets printed (path gets appended too)
 path=/path/to/the/file
diff --git a/src/dump_systemstate/files/10-crash-worker.conf b/src/dump_systemstate/files/10-crash-worker.conf
new file mode 100644 (file)
index 0000000..6c723e6
--- /dev/null
@@ -0,0 +1,7 @@
+[VMSTAT]
+title=Virtual Memory statistics
+path=/proc/vmstat
+
+[KERNEL_LOCKS]
+title=Kernel lock
+path=/proc/locks
index 8e26083..a1782bf 100644 (file)
@@ -1,3 +1,5 @@
+# See files.conf.example for note about file naming and ordering.
+
 [UNIQUE_ID_KEY]
 title=header line describing the program (will be printed alongside env, path and args)
 path=/path/to/the/program/executable
diff --git a/src/dump_systemstate/programs/10-crash-worker.conf b/src/dump_systemstate/programs/10-crash-worker.conf
new file mode 100644 (file)
index 0000000..67c5f58
--- /dev/null
@@ -0,0 +1,4 @@
+[IPC]
+title=System IPC facilities
+path=/usr/bin/ipcs
+args=-a