mirror of
https://github.com/openharmony/developtools_bytrace_standard.git
synced 2026-07-19 15:03:32 -04:00
!61 replace bytrace key to hitrace_meter for developtools_bytrace_standard
Merge pull request !61 from wenlong_12/master
This commit is contained in:
@@ -26,7 +26,7 @@ constexpr int SLEEP_ONE_SECOND = 1;
|
||||
constexpr int SLEEP_TWO_SECOND = 2;
|
||||
constexpr int CYCLE_TIMES = 5;
|
||||
constexpr int32_t TASK_ID = 111;
|
||||
constexpr uint64_t LABEL = BYTRACE_TAG_OHOS;
|
||||
constexpr uint64_t LABEL = HITRACE_TAG_OHOS;
|
||||
|
||||
void FuncA()
|
||||
{
|
||||
@@ -45,7 +45,7 @@ void FuncC()
|
||||
cout << "funcC" << endl;
|
||||
int num = 0;
|
||||
for (int i = 0; i < CYCLE_TIMES; i++) {
|
||||
CountTrace(BYTRACE_TAG_OHOS, "count number", ++num);
|
||||
CountTrace(HITRACE_TAG_OHOS, "count number", ++num);
|
||||
sleep(SLEEP_ONE_SECOND);
|
||||
}
|
||||
}
|
||||
|
||||
+20
-20
@@ -840,28 +840,28 @@ static void InitKernelSupportTags()
|
||||
static void InitAllSupportTags()
|
||||
{
|
||||
// OHOS
|
||||
g_tagMap["ohos"] = { "ohos", "OpenHarmony", BYTRACE_TAG_OHOS, USER, {}};
|
||||
g_tagMap["ability"] = { "ability", "Ability Manager", BYTRACE_TAG_ABILITY_MANAGER, USER, {}};
|
||||
g_tagMap["zcamera"] = { "zcamera", "OpenHarmony Camera Module", BYTRACE_TAG_ZCAMERA, USER, {}};
|
||||
g_tagMap["zmedia"] = { "zmedia", "OpenHarmony Media Module", BYTRACE_TAG_ZMEDIA, USER, {}};
|
||||
g_tagMap["zimage"] = { "zimage", "OpenHarmony Image Module", BYTRACE_TAG_ZIMAGE, USER, {}};
|
||||
g_tagMap["zaudio"] = { "zaudio", "OpenHarmony Audio Module", BYTRACE_TAG_ZAUDIO, USER, {}};
|
||||
g_tagMap["ohos"] = { "ohos", "OpenHarmony", HITRACE_TAG_OHOS, USER, {}};
|
||||
g_tagMap["ability"] = { "ability", "Ability Manager", HITRACE_TAG_ABILITY_MANAGER, USER, {}};
|
||||
g_tagMap["zcamera"] = { "zcamera", "OpenHarmony Camera Module", HITRACE_TAG_ZCAMERA, USER, {}};
|
||||
g_tagMap["zmedia"] = { "zmedia", "OpenHarmony Media Module", HITRACE_TAG_ZMEDIA, USER, {}};
|
||||
g_tagMap["zimage"] = { "zimage", "OpenHarmony Image Module", HITRACE_TAG_ZIMAGE, USER, {}};
|
||||
g_tagMap["zaudio"] = { "zaudio", "OpenHarmony Audio Module", HITRACE_TAG_ZAUDIO, USER, {}};
|
||||
g_tagMap["distributeddatamgr"] = { "distributeddatamgr", "Distributed Data Manager",
|
||||
BYTRACE_TAG_DISTRIBUTEDDATA, USER, {}};
|
||||
g_tagMap["mdfs"] = { "mdfs", "Mobile Distributed File System", BYTRACE_TAG_MDFS, USER, {}};
|
||||
g_tagMap["graphic"] = { "graphic", "Graphic Module", BYTRACE_TAG_GRAPHIC_AGP, USER, {}};
|
||||
g_tagMap["ace"] = { "ace", "ACE development framework", BYTRACE_TAG_ACE, USER, {}};
|
||||
g_tagMap["notification"] = { "notification", "Notification Module", BYTRACE_TAG_NOTIFICATION, USER, {}};
|
||||
g_tagMap["misc"] = { "misc", "Misc Module", BYTRACE_TAG_MISC, USER, {}};
|
||||
HITRACE_TAG_DISTRIBUTEDDATA, USER, {}};
|
||||
g_tagMap["mdfs"] = { "mdfs", "Mobile Distributed File System", HITRACE_TAG_MDFS, USER, {}};
|
||||
g_tagMap["graphic"] = { "graphic", "Graphic Module", HITRACE_TAG_GRAPHIC_AGP, USER, {}};
|
||||
g_tagMap["ace"] = { "ace", "ACE development framework", HITRACE_TAG_ACE, USER, {}};
|
||||
g_tagMap["notification"] = { "notification", "Notification Module", HITRACE_TAG_NOTIFICATION, USER, {}};
|
||||
g_tagMap["misc"] = { "misc", "Misc Module", HITRACE_TAG_MISC, USER, {}};
|
||||
g_tagMap["multimodalinput"] = { "multimodalinput", "Multimodal Input Module",
|
||||
BYTRACE_TAG_MULTIMODALINPUT, USER, {}};
|
||||
g_tagMap["sensors"] = { "sensors", "Sensors Module", BYTRACE_TAG_SENSORS, USER, {}};
|
||||
g_tagMap["msdp"] = { "msdp", "Multimodal Sensor Data Platform", BYTRACE_TAG_MSDP, USER, {}};
|
||||
g_tagMap["dsoftbus"] = { "dsoftbus", "Distributed Softbus", BYTRACE_TAG_DSOFTBUS, USER, {}};
|
||||
g_tagMap["rpc"] = { "rpc", "RPC and IPC", BYTRACE_TAG_RPC, USER, {}};
|
||||
g_tagMap["ark"] = { "ark", "ARK Module", BYTRACE_TAG_ARK, USER, {}};
|
||||
g_tagMap["window"] = { "window", "Window Manager", BYTRACE_TAG_WINDOW_MANAGER, USER, {}};
|
||||
g_tagMap["app"] = { "app", "APP Module", BYTRACE_TAG_APP, USER, {}};
|
||||
HITRACE_TAG_MULTIMODALINPUT, USER, {}};
|
||||
g_tagMap["sensors"] = { "sensors", "Sensors Module", HITRACE_TAG_SENSORS, USER, {}};
|
||||
g_tagMap["msdp"] = { "msdp", "Multimodal Sensor Data Platform", HITRACE_TAG_MSDP, USER, {}};
|
||||
g_tagMap["dsoftbus"] = { "dsoftbus", "Distributed Softbus", HITRACE_TAG_DSOFTBUS, USER, {}};
|
||||
g_tagMap["rpc"] = { "rpc", "RPC and IPC", HITRACE_TAG_RPC, USER, {}};
|
||||
g_tagMap["ark"] = { "ark", "ARK Module", HITRACE_TAG_ARK, USER, {}};
|
||||
g_tagMap["window"] = { "window", "Window Manager", HITRACE_TAG_WINDOW_MANAGER, USER, {}};
|
||||
g_tagMap["app"] = { "app", "APP Module", HITRACE_TAG_APP, USER, {}};
|
||||
g_tagMap["zbinder"] = { "zbinder", "OpenHarmony binder communication", 0, KERNEL, {
|
||||
{ "events/zbinder/enable" },
|
||||
}};
|
||||
|
||||
@@ -58,9 +58,9 @@ constexpr uint32_t TRACE_FMA11 = 11;
|
||||
constexpr uint32_t TRACE_FMA12 = 12;
|
||||
|
||||
constexpr uint64_t TRACE_INVALIDATE_TAG = 0x1000000;
|
||||
constexpr uint64_t BYTRACE_TAG = 0xd03301;
|
||||
const constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, BYTRACE_TAG, "BYTRACE_TEST"};
|
||||
const uint64_t TAG = BYTRACE_TAG_OHOS;
|
||||
constexpr uint64_t HITRACE_TAG = 0xd03301;
|
||||
const constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HITRACE_TAG, "BYTRACE_TEST"};
|
||||
const uint64_t TAG = HITRACE_TAG_OHOS;
|
||||
static string g_traceRootPath;
|
||||
|
||||
bool SetProperty(const string& property, const string& value);
|
||||
|
||||
@@ -50,13 +50,13 @@ static napi_value JSTraceStart(napi_env env, napi_callback_info info)
|
||||
int taskId = 0;
|
||||
napi_get_value_int32(env, argv[1], &taskId);
|
||||
if (argc == ARGC_NUMBER_TWO) {
|
||||
StartAsyncTrace(BYTRACE_TAG_APP, name, taskId);
|
||||
StartAsyncTrace(HITRACE_TAG_APP, name, taskId);
|
||||
} else {
|
||||
NAPI_CALL(env, napi_typeof(env, argv[ARGC_NUMBER_TWO], &valueType));
|
||||
NAPI_ASSERT(env, valueType == napi_number, "Third arg type error, should is number");
|
||||
double limit = 0;
|
||||
napi_get_value_double(env, argv[ARGC_NUMBER_TWO], &limit);
|
||||
StartAsyncTrace(BYTRACE_TAG_APP, name, taskId, limit);
|
||||
StartAsyncTrace(HITRACE_TAG_APP, name, taskId, limit);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
@@ -81,7 +81,7 @@ static napi_value JSTraceFinish(napi_env env, napi_callback_info info)
|
||||
NAPI_ASSERT(env, valueType == napi_number, "Second arg type error, should is number");
|
||||
int taskId = 0;
|
||||
napi_get_value_int32(env, argv[1], &taskId);
|
||||
FinishAsyncTrace(BYTRACE_TAG_APP, name, taskId);
|
||||
FinishAsyncTrace(HITRACE_TAG_APP, name, taskId);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ static napi_value JSTraceCount(napi_env env, napi_callback_info info)
|
||||
NAPI_ASSERT(env, valueType == napi_number, "Second arg type error, should is number");
|
||||
int64_t count = 0;
|
||||
napi_get_value_int64(env, argv[1], &count);
|
||||
CountTrace(BYTRACE_TAG_APP, name, count);
|
||||
CountTrace(HITRACE_TAG_APP, name, count);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user