From e0cb14697bbc45a3f26b8126b0975337340ef0ab Mon Sep 17 00:00:00 2001 From: Changgyu Choi Date: Tue, 15 Feb 2022 15:46:12 +0900 Subject: [PATCH] Add new features into boot sequence app info This patch adds socket-ready, terminated timestamp and status message. socket-ready: The timestamp when the app socket was ready. termianted: The timestamp when the app was terminated. status-message: The message if the sub status of app is fail. Change-Id: I8cd3414f1ba79ebd6ca3a12387cc3a0723b6335c Signed-off-by: Changgyu Choi --- include/aul_key.h | 22 +++++++++++-- tool/aulctl/boot_sequence/app_info.cc | 36 +++++++++++++++++++++- tool/aulctl/boot_sequence/app_info.hh | 12 ++++++++ tool/aulctl/boot_sequence/boot_sequence_manager.cc | 4 ++- tool/aulctl/operation/status_all_operation.cc | 9 ++++++ tool/aulctl/operation/status_once_operation.cc | 9 ++++++ 6 files changed, 88 insertions(+), 4 deletions(-) diff --git a/include/aul_key.h b/include/aul_key.h index 54524a0..5ae560e 100644 --- a/include/aul_key.h +++ b/include/aul_key.h @@ -905,13 +905,31 @@ #define AUL_K_TIMEOUT "__AUL_TIMEOUT__" /** - * @brief Definition for AUL: The begin timestamp of boot sequence app's start. + * @brief Definition for AUL: The begin timestamp of boot sequence app start. * @since_tizen 7.0 */ #define AUL_K_BEGIN_TIMESTAMP "__AUL_BEGIN_TIMESTAMP__" /** - * @brief Definition for AUL: The end timestamp of boot sequence app's start. + * @brief Definition for AUL: The end timestamp of boot sequence app start. * @since_tizen 7.0 */ #define AUL_K_END_TIMESTAMP "__AUL_END_TIMESTAMP__" + +/** + * @brief Definition for AUL: The socket ready timestamp of boot sequence app. + * @since_tizen 7.0 + */ +#define AUL_K_SOCKET_READY_TIMESTAMP "__AUL_SOCKET_READY_TIMESTAMP__" + +/** + * @brief Definition for AUL: The terminated timestamp of boot sequence app. + * @since_tizen 7.0 + */ +#define AUL_K_TERMINATED_TIMESTAMP "__AUL_TERMINATED_TIMESTAMP__" + +/** + * @brief Definition for AUL: The status message of boot sequence app. + * @since_tizen 7.0 + */ +#define AUL_K_STATUS_MSG "__AUL_STATUS_MSG__" diff --git a/tool/aulctl/boot_sequence/app_info.cc b/tool/aulctl/boot_sequence/app_info.cc index 046846b..481912b 100644 --- a/tool/aulctl/boot_sequence/app_info.cc +++ b/tool/aulctl/boot_sequence/app_info.cc @@ -144,6 +144,24 @@ AppInfo::Builder& AppInfo::Builder::SetEndTimestamp( return *this; } +AppInfo::Builder& AppInfo::Builder::SetSocketReadyTimestamp( + const tizen_base::Bundle& args) { + socket_ready_timestamp_ = args.GetString(AUL_K_SOCKET_READY_TIMESTAMP); + return *this; +} + +AppInfo::Builder& AppInfo::Builder::SetTerminatedTimestamp( + const tizen_base::Bundle& args) { + terminated_timestamp_ = args.GetString(AUL_K_TERMINATED_TIMESTAMP); + return *this; +} + +AppInfo::Builder& AppInfo::Builder::SetStatusMessage( + const tizen_base::Bundle& args) { + status_msg_ = args.GetString(AUL_K_STATUS_MSG); + return *this; +} + AppInfo* AppInfo::Builder::Build() const { return new (std::nothrow) AppInfo( std::move(appid_), @@ -158,6 +176,9 @@ AppInfo* AppInfo::Builder::Build() const { std::move(sub_state_), std::move(begin_timestamp_), std::move(end_timestamp_), + std::move(socket_ready_timestamp_), + std::move(terminated_timestamp_), + std::move(status_msg_), background_launch_, wait_until_ready_, timeout_); @@ -169,6 +190,8 @@ AppInfo::AppInfo(std::string appid, uid_t uid, int priority, tizen_base::Bundle args, std::string active_state, std::string sub_state, std::string begin_timestamp, std::string end_timestamp, + std::string socket_ready_timestamp, std::string terminated_timestamp, + std::string status_msg, bool background_launch, bool wait_until_ready, unsigned int timeout) : appid_(std::move(appid)), uid_(uid), @@ -182,9 +205,12 @@ AppInfo::AppInfo(std::string appid, uid_t uid, int priority, sub_state_(std::move(sub_state)), begin_timestamp_(std::move(begin_timestamp)), end_timestamp_(std::move(end_timestamp)), + socket_ready_timestamp_(std::move(socket_ready_timestamp)), + terminated_timestamp_(std::move(terminated_timestamp)), background_launch_(background_launch), wait_until_ready_(wait_until_ready), - timeout_(timeout) { + timeout_(timeout), + status_msg_(std::move(status_msg)) { if (background_launch_) { args_.Delete(K_BG_LAUNCH); args_.Add(K_BG_LAUNCH, "enable"); @@ -271,6 +297,14 @@ const std::string& AppInfo::GetEndTimestamp() const { return end_timestamp_; } +const std::string& AppInfo::GetSocketReadyTimestamp() const { + return socket_ready_timestamp_; +} + +const std::string& AppInfo::GetTerminatedTimestamp() const { + return terminated_timestamp_; +} + const std::string& AppInfo::GetStatusMessage() const { return status_msg_; } diff --git a/tool/aulctl/boot_sequence/app_info.hh b/tool/aulctl/boot_sequence/app_info.hh index 924bad9..3fe44dd 100644 --- a/tool/aulctl/boot_sequence/app_info.hh +++ b/tool/aulctl/boot_sequence/app_info.hh @@ -48,6 +48,9 @@ class AppInfo { Builder& SetSubState(const tizen_base::Bundle& args); Builder& SetBeginTimestamp(const tizen_base::Bundle& args); Builder& SetEndTimestamp(const tizen_base::Bundle& args); + Builder& SetSocketReadyTimestamp(const tizen_base::Bundle& args); + Builder& SetTerminatedTimestamp(const tizen_base::Bundle& args); + Builder& SetStatusMessage(const tizen_base::Bundle& args); AppInfo* Build() const; @@ -64,9 +67,12 @@ class AppInfo { std::string sub_state_; std::string begin_timestamp_; std::string end_timestamp_; + std::string socket_ready_timestamp_; + std::string terminated_timestamp_; bool background_launch_; bool wait_until_ready_; unsigned int timeout_; + std::string status_msg_; }; AppInfo(std::string appid, uid_t uid, int priority, @@ -75,6 +81,8 @@ class AppInfo { tizen_base::Bundle args, std::string active_state, std::string sub_state, std::string begin_timestamp, std::string end_timestamp, + std::string status_msg, + std::string socket_ready_timestamp, std::string terminated_timestamp, bool background_launch, bool wait_until_ready, unsigned int timeout); const std::string& GetAppId() const; @@ -101,6 +109,8 @@ class AppInfo { const std::string& GetSubState() const; const std::string& GetBeginTimestamp() const; const std::string& GetEndTimestamp() const; + const std::string& GetSocketReadyTimestamp() const; + const std::string& GetTerminatedTimestamp() const; const std::string& GetStatusMessage() const; private: @@ -117,6 +127,8 @@ class AppInfo { std::string sub_state_; std::string begin_timestamp_; std::string end_timestamp_; + std::string socket_ready_timestamp_; + std::string terminated_timestamp_; bool background_launch_; bool wait_until_ready_; unsigned int timeout_; diff --git a/tool/aulctl/boot_sequence/boot_sequence_manager.cc b/tool/aulctl/boot_sequence/boot_sequence_manager.cc index 4e394f9..3720da0 100644 --- a/tool/aulctl/boot_sequence/boot_sequence_manager.cc +++ b/tool/aulctl/boot_sequence/boot_sequence_manager.cc @@ -42,7 +42,9 @@ AppInfoPtr BootSequenceManager::CreateAppInfoFromBundle(tizen_base::Bundle b) { .SetActiveState(b) .SetSubState(b) .SetBeginTimestamp(b) - .SetEndTimestamp(b); + .SetEndTimestamp(b) + .SetSocketReadyTimestamp(b) + .SetTerminatedTimestamp(b); return std::shared_ptr(builder.Build()); } diff --git a/tool/aulctl/operation/status_all_operation.cc b/tool/aulctl/operation/status_all_operation.cc index 7232f26..6579685 100644 --- a/tool/aulctl/operation/status_all_operation.cc +++ b/tool/aulctl/operation/status_all_operation.cc @@ -42,6 +42,8 @@ bool StatusAllOperation::Process() { std::cout << "status: " << app->GetActiveState() << std::endl; std::cout << "sub status: " << app->GetSubState() << std::endl; + if (app->GetSubState() == "fail") + std::cout << " message: " << app->GetStatusMessage() << std::endl; aul_app_context_h context; int ret = aul_app_context_create(app->GetAppId().c_str(), &context); @@ -58,6 +60,13 @@ bool StatusAllOperation::Process() { std::cout << "begin: " << app->GetBeginTimestamp() << std::endl; std::cout << "end: " << app->GetEndTimestamp() << std::endl; + + std::cout << "started time: " << app->GetSocketReadyTimestamp() + << std::endl; + + std::cout << "termiated time: " << app->GetTerminatedTimestamp() + << std::endl; + std::cout << "requires: "; for (auto& appid : app->RequiresGet()) std::cout << appid << " "; diff --git a/tool/aulctl/operation/status_once_operation.cc b/tool/aulctl/operation/status_once_operation.cc index 5ec0d86..a2b3b3d 100644 --- a/tool/aulctl/operation/status_once_operation.cc +++ b/tool/aulctl/operation/status_once_operation.cc @@ -46,6 +46,8 @@ bool StatusOnceOperation::Process() { std::cout << "status: " << app->GetActiveState() << std::endl; std::cout << "sub status: " << app->GetSubState() << std::endl; + if (app->GetSubState() == "fail") + std::cout << " message: " << app->GetStatusMessage() << std::endl; aul_app_context_h context; int ret = aul_app_context_create(app->GetAppId().c_str(), &context); @@ -62,6 +64,13 @@ bool StatusOnceOperation::Process() { std::cout << "begin: " << app->GetBeginTimestamp() << std::endl; std::cout << "end: " << app->GetEndTimestamp() << std::endl; + + std::cout << "started time: " << app->GetSocketReadyTimestamp() + << std::endl; + + std::cout << "termiated time: " << app->GetTerminatedTimestamp() + << std::endl; + std::cout << "requires: "; for (auto& appid : app->RequiresGet()) std::cout << appid << " "; -- 2.7.4