namespace common {
namespace {
+
void PrintProfileTime(const char* step, const struct timespec& start) {
struct timespec end;
clock_gettime(CLOCK_REALTIME, &end);
} // namespace
void PrintProfileLog(const char* func, const char* tag) {
- LOGGER(DEBUG) << "[PROF] [" << utils::GetCurrentMilliSeconds() << "] "
- << func << ":" << tag;
+ LOGGER_RAW(DLOG_DEBUG, LOGGER_TAG)
+ << "[PROF] [" << utils::GetCurrentMilliSeconds() << "] "
+ << func << ":" << tag;
}
ScopeProfile::ScopeProfile(const char* step, const bool isStep)
: step_(step), expired_(false), isStep_(isStep) {
clock_gettime(CLOCK_REALTIME, &start_);
- PrintProfileLog(step, "START");
+
+ if (!isStep) {
+ // Remove return type and parameter info from __PRETTY_FUNCTION__
+ int se = step_.find_first_of('(');
+ int ss = step_.find_last_of(' ', se) + 1;
+ if (ss < se) {
+ step_ = step_.substr(ss, se - ss);
+ }
+ }
+
+ PrintProfileLog(step_.c_str(), "START");
if(isStep_)
traceAsyncBegin(TTRACE_TAG_WEB, 0, "%s%s", "XWALK:", step_.c_str());
} // namespace common
#define SCOPE_PROFILE() \
- common::ScopeProfile __profile(__FUNCTION__, false);
+ common::ScopeProfile __profile(__PRETTY_FUNCTION__, false);
#define STEP_PROFILE_START(x) \
common::StepProfile::GetInstance()->Start(x)
ext_pattern.append(kExtensionPrefix);
ext_pattern.append("*");
ext_pattern.append(kExtensionSuffix);
+
StringSet files;
{
glob_t glob_result;
}
void XWalkExtensionClient::Initialize() {
+ SCOPE_PROFILE();
if (!extension_apis_.empty()) {
return;
}
void XWalkExtensionRendererController::DidCreateScriptContext(
v8::Handle<v8::Context> context) {
+ SCOPE_PROFILE();
XWalkModuleSystem* module_system = new XWalkModuleSystem(context);
XWalkModuleSystem::SetModuleSystemInContext(
std::unique_ptr<XWalkModuleSystem>(module_system), context);
#include <algorithm>
#include "common/logger.h"
+#include "common/profiler.h"
#include "extensions/renderer/xwalk_extension_module.h"
namespace extensions {
}
void XWalkModuleSystem::Initialize() {
+ SCOPE_PROFILE();
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::Context> context = GetV8Context();
extern "C" void DynamicSetWidgetInfo(const char* tizen_id) {
SCOPE_PROFILE();
- LOGGER(DEBUG) << "InjectedBundle::DynamicSetWidgetInfo !!" << tizen_id;
ecore_init();
runtime::BundleGlobalData::GetInstance()->Initialize(tizen_id);
extensions::XWalkModuleSystem::SetModuleSystemInContext(
std::unique_ptr<extensions::XWalkModuleSystem>(), context);
- LOGGER(DEBUG) << "InjectedBundle::DynamicPluginStartSession !!" << tizen_id;
if (base_url == NULL || common::utils::StartsWith(base_url, "http")) {
LOGGER(ERROR) << "External url not allowed plugin loading.";
return;
}
- STEP_PROFILE_START("Initialize RuntimeIPCClient");
// Initialize RuntimeIPCClient
extensions::RuntimeIPCClient* rc =
extensions::RuntimeIPCClient::GetInstance();
rc->SetRoutingId(context, routing_handle);
- STEP_PROFILE_END("Initialize RuntimeIPCClient");
extensions::XWalkExtensionRendererController& controller =
extensions::XWalkExtensionRendererController::GetInstance();
extern "C" void DynamicPluginStopSession(
const char* tizen_id, v8::Handle<v8::Context> context) {
- LOGGER(DEBUG) << "InjectedBundle::DynamicPluginStopSession !!" << tizen_id;
-
+ SCOPE_PROFILE();
extensions::XWalkExtensionRendererController& controller =
extensions::XWalkExtensionRendererController::GetInstance();
controller.WillReleaseScriptContext(context);
}
extern "C" void DynamicOnIPCMessage(const Ewk_IPC_Wrt_Message_Data& data) {
- LOGGER(DEBUG) << "InjectedBundle::DynamicOnIPCMessage !!";
+ SCOPE_PROFILE();
extensions::XWalkExtensionRendererController& controller =
extensions::XWalkExtensionRendererController::GetInstance();
controller.OnReceivedIPCMessage(&data);
}
extern "C" void DynamicPreloading() {
- LOGGER(DEBUG) << "InjectedBundle::DynamicPreloading !!";
+ SCOPE_PROFILE();
runtime::BundleGlobalData::GetInstance()->PreInitialize();
extensions::XWalkExtensionRendererController& controller =
extensions::XWalkExtensionRendererController::GetInstance();