summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarol Lewandowski <k.lewandowsk@samsung.com>2019-09-30 13:25:28 +0000
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>2019-09-30 13:25:28 +0000
commit202c1dba7ca703918bd4acde38cd003b84b08cb3 (patch)
treee9758b9ab97a0a9e798e2ff8aa573655d4c5aa97
parent3def86e983862dc17fd179c106d25611f03ab9d2 (diff)
parentca6479c4e2d7623b79984a87f051eab09bf0443c (diff)
downloadcrash-worker-202c1dba7ca703918bd4acde38cd003b84b08cb3.tar.gz
crash-worker-202c1dba7ca703918bd4acde38cd003b84b08cb3.tar.bz2
crash-worker-202c1dba7ca703918bd4acde38cd003b84b08cb3.zip
Merge "Separate log_dump from crash-worker" into tizen
-rw-r--r--CMakeLists.txt4
-rw-r--r--packaging/crash-worker.manifest1
-rw-r--r--packaging/crash-worker.spec32
-rw-r--r--packaging/log_dump.manifest8
-rw-r--r--packaging/log_dump.spec62
-rw-r--r--src/log_dump/CMakeLists.txt15
6 files changed, 80 insertions, 42 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index df5c180..630e1aa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,10 +18,6 @@ ENDIF("${SYS_ASSERT}" STREQUAL "ON")
ADD_SUBDIRECTORY(src/crash-stack)
ADD_SUBDIRECTORY(src/dump_systemstate)
-IF("${LOG_DUMP}" STREQUAL "ON")
- ADD_SUBDIRECTORY(src/log_dump)
-ENDIF()
-
IF("${LIVEDUMPER}" STREQUAL "ON")
ADD_SUBDIRECTORY(src/livedumper)
ENDIF()
diff --git a/packaging/crash-worker.manifest b/packaging/crash-worker.manifest
index c6cdebc..25bee3e 100644
--- a/packaging/crash-worker.manifest
+++ b/packaging/crash-worker.manifest
@@ -5,6 +5,5 @@
<assign>
<filesystem path="/usr/bin/dump_systemstate" label="System" exec_label="System"/>
<filesystem path="/usr/bin/crash-manager" label="System" exec_label="System"/>
- <filesystem path="/usr/bin/log_dump" label="System" exec_label="System"/>
</assign>
</manifest>
diff --git a/packaging/crash-worker.spec b/packaging/crash-worker.spec
index baa227e..2d550a9 100644
--- a/packaging/crash-worker.spec
+++ b/packaging/crash-worker.spec
@@ -2,13 +2,11 @@
%define on_off() %{expand:%%{?with_%{1}:ON}%%{!?with_%{1}:OFF}}
%define _with_tests on
-%define _with_logdump on
%define _with_livedumper on
%define _with_crashservice on
%bcond_with doc
%bcond_with sys_assert
%bcond_with tests
-%bcond_with logdump
%bcond_with livedumper
%bcond_with crashservice
@@ -97,10 +95,6 @@ Summary: Livedumper allows to dump core of live process
#Debug mode path - existence of file at path below mean that core file should be generated
%define debugmode_path %{TZ_SYS_ETC}/.debugmode
-#Path for log_dump module
-%define crash_all_log %{TZ_SYS_ALLLOGS}
-%define crash_dump_gen %{TZ_SYS_DUMPGEN}
-
%define upgrade_script_path %{TZ_SYS_RO_SHARE}/upgrade/scripts
%build
@@ -134,14 +128,12 @@ export CFLAGS+=" -Werror"
-DMINICOREDUMPER_BIN_PATH=%{_sbindir}/minicoredumper \
-DMINICOREDUMPER_CONFIG_PATH=%{_sysconfdir}/minicoredumper/minicoredumper.cfg.json \
-DLIVEDUMPER_BIN_PATH=%{_bindir}/livedumper \
- -DLOG_DUMP_BIN_PATH=%{_bindir}/log_dump \
-DDUMP_SYSTEMSTATE_BIN_PATH=%{_bindir}/dump_systemstate \
-DCRASH_STACK_BIN_PATH=%{_libexecdir}/crash-stack \
-DCRASH_POPUP_BIN_PATH=%{_libexecdir}/crash-popup-launch \
-DCRASH_NOTIFY_BIN_PATH=%{_libexecdir}/crash-notify-send \
-DCRASH_TESTS_PATH=%{_libdir}/crash-worker-tests \
-DSYS_ASSERT=%{on_off sys_assert} \
- -DLOG_DUMP=%{on_off logdump} \
-DLIVEDUMPER=%{on_off livedumper} \
-DCRASH_SERVICE=%{on_off crashservice} \
-DUPGRADE_SCRIPT_PATH=%{upgrade_script_path} \
@@ -160,14 +152,6 @@ mkdir -p %{buildroot}%{crash_root_path}
mkdir -p %{buildroot}%{crash_path}
mkdir -p %{buildroot}%{crash_temp}
-# log_dump dir
-%if %{with logdump}
-mkdir -p %{buildroot}%{crash_all_log}
-mkdir -p %{buildroot}%{crash_dump_gen}
-cp dump_scripts/* %{buildroot}%{crash_dump_gen}
-chmod 755 %{buildroot}%{crash_dump_gen}/*
-%endif
-
%post
%if %{with sys_assert}
if [ ! -d /.build ]; then
@@ -186,13 +170,6 @@ fi
/usr/bin/chsmack -a "System" -t %{crash_path}
/usr/bin/chsmack -a "System" -t %{crash_temp}
-%if %{with logdump}
-/usr/bin/chsmack -a "System" -t %{crash_dump_gen}
-/usr/bin/chsmack -a "System" -t %{crash_dump_gen}/module.d
-/usr/bin/chsmack -a "System::Shared" -t %{crash_all_log}
-/usr/bin/chsmack -a "_" %{crash_dump_gen}/module.d/*
-%endif
-
%postun
%if %{with sys_assert}
orig="%{_libdir}/libsys-assert.so"
@@ -227,15 +204,6 @@ sed -i "/${pattern}/D" %{_sysconfdir}/ld.so.preload
%{_libdir}/libcrash-service.so.*
%endif
-%if %{with logdump}
-%dir %{crash_all_log}
-%{crash_dump_gen}/*
-%attr(-,root,root) %{_unitdir}/log_dump.service
-%attr(-,root,root) %{_sysconfdir}/dbus-1/system.d/log_dump.conf
-%attr(-,root,root) %{_datadir}/dbus-1/system-services/org.tizen.system.crash.service
-%attr(0750,system_fw,system_fw) %{_bindir}/log_dump
-%endif
-
%if %{with sys_assert}
%{_libdir}/libsys-assert.so
%{_sysconfdir}/tmpfiles.d/sys-assert.conf
diff --git a/packaging/log_dump.manifest b/packaging/log_dump.manifest
new file mode 100644
index 0000000..a340d2e
--- /dev/null
+++ b/packaging/log_dump.manifest
@@ -0,0 +1,8 @@
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+ <assign>
+ <filesystem path="/usr/bin/log_dump" label="System" exec_label="System"/>
+ </assign>
+</manifest>
diff --git a/packaging/log_dump.spec b/packaging/log_dump.spec
new file mode 100644
index 0000000..ce97c0b
--- /dev/null
+++ b/packaging/log_dump.spec
@@ -0,0 +1,62 @@
+Name: log_dump
+Summary: log_dump
+Version: 5.5.19
+Release: 1
+Group: Framework/system
+License: Apache-2.0 and BSD
+Source0: %{name}-%{version}.tar.gz
+Source1001: log_dump.manifest
+Requires: crash-worker
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(libtzplatform-config)
+BuildRequires: pkgconfig(iniparser)
+BuildRequires: pkgconfig(capi-system-info)
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: cmake
+BuildRequires: pkgconfig(pkgmgr-info)
+
+%description
+log_dump
+
+%prep
+%setup -q
+
+%define crash_root_path %{TZ_SYS_CRASH_ROOT}
+%define crash_all_log %{TZ_SYS_ALLLOGS}
+%define crash_dump_gen %{TZ_SYS_DUMPGEN}
+
+%build
+cp %{SOURCE1001} .
+
+%cmake src/log_dump/ \
+ -DCRASH_ROOT_PATH=%{crash_root_path} \
+ -DDUMP_SYSTEMSTATE_BIN_PATH=%{_bindir}/dump_systemstate \
+ -DCRASH_MANAGER_CONFIG_PATH=%{_sysconfdir}/crash-manager.conf
+
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+mkdir -p %{buildroot}%{crash_all_log}
+mkdir -p %{buildroot}%{crash_dump_gen}
+cp dump_scripts/* %{buildroot}%{crash_dump_gen}
+chmod 755 %{buildroot}%{crash_dump_gen}/*
+
+%post
+/usr/bin/chsmack -a "System" -t %{crash_dump_gen}
+/usr/bin/chsmack -a "System" -t %{crash_dump_gen}/module.d
+/usr/bin/chsmack -a "System::Shared" -t %{crash_all_log}
+/usr/bin/chsmack -a "_" %{crash_dump_gen}/module.d/*
+
+%files
+%license LICENSE
+%manifest log_dump.manifest
+%dir %{crash_all_log}
+%{crash_dump_gen}/*
+%attr(-,root,root) %{_unitdir}/log_dump.service
+%attr(-,root,root) %{_sysconfdir}/dbus-1/system.d/log_dump.conf
+%attr(-,root,root) %{_datadir}/dbus-1/system-services/org.tizen.system.crash.service
+%attr(0750,system_fw,system_fw) %{_bindir}/log_dump
+
+
diff --git a/src/log_dump/CMakeLists.txt b/src/log_dump/CMakeLists.txt
index a7446a2..cc91ea5 100644
--- a/src/log_dump/CMakeLists.txt
+++ b/src/log_dump/CMakeLists.txt
@@ -1,13 +1,18 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(log_dump C)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)
+ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/../../include ${CMAKE_SOURCE_DIR}/../../include)
+ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE=1)
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/../../include/)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/../)
+
SET(LOG_DUMP_SRCS
log_dump.c
dbus-handler.c
- ${CMAKE_SOURCE_DIR}/src/shared/util.c
- ${CMAKE_SOURCE_DIR}/src/shared/spawn.c
- ${CMAKE_SOURCE_DIR}/src/shared/config.c
+ ${CMAKE_SOURCE_DIR}/../shared/util.c
+ ${CMAKE_SOURCE_DIR}/../shared/spawn.c
+ ${CMAKE_SOURCE_DIR}/../shared/config.c
)
INCLUDE(FindPkgConfig)
@@ -19,7 +24,7 @@ pkg_check_modules(log_dump_pkgs REQUIRED
gio-2.0
)
-INCLUDE(${CMAKE_SOURCE_DIR}/cmake/ProcessM4.cmake)
+INCLUDE(${CMAKE_SOURCE_DIR}/../../cmake/ProcessM4.cmake)
FOREACH(flag ${log_dump_pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")