mirror of
https://gitee.com/openharmony/developtools_profiler
synced 2024-11-23 15:00:17 +00:00
commit
c872588ce3
23
device/etc/hiprofiler_daemon.cfg
Normal file
23
device/etc/hiprofiler_daemon.cfg
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"services" : [{
|
||||||
|
"name" : "hiprofiler_daemon",
|
||||||
|
"path" : ["/system/bin/native_daemon"],
|
||||||
|
"sandbox" : 0,
|
||||||
|
"caps" : ["CAP_KILL", "CAP_SYS_PTRACE"],
|
||||||
|
"once" : 1,
|
||||||
|
"uid" : "hiprofiler",
|
||||||
|
"gid" : ["shell", "readproc"],
|
||||||
|
"socket" : [{
|
||||||
|
"name" : "hook_unix_socket",
|
||||||
|
"family" : "AF_UNIX",
|
||||||
|
"type" : "SOCK_STREAM",
|
||||||
|
"protocol" : "default",
|
||||||
|
"permissions" : "0666",
|
||||||
|
"uid" : "hiprofiler",
|
||||||
|
"gid" : "shell"
|
||||||
|
}],
|
||||||
|
"secon" : "u:r:native_daemon:s0",
|
||||||
|
"start-mode" : "condition"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
18
device/etc/hiprofiler_plugins.cfg
Normal file
18
device/etc/hiprofiler_plugins.cfg
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"services" : [{
|
||||||
|
"name" : "hiprofiler_plugins",
|
||||||
|
"path" : ["/system/bin/hiprofiler_plugins"],
|
||||||
|
"sandbox" : 0,
|
||||||
|
"caps" : ["CAP_SYS_PTRACE", "CAP_DAC_READ_SEARCH"],
|
||||||
|
"once" : 1,
|
||||||
|
"uid" : "hiprofiler",
|
||||||
|
"gid" : ["shell", "readproc"],
|
||||||
|
"secon" : "u:r:hiprofiler_plugins:s0",
|
||||||
|
"start-mode" : "condition",
|
||||||
|
"apl" : "system_basic",
|
||||||
|
"permission" : [
|
||||||
|
"ohos.permission.READ_DFX_SYSEVENT"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
65
device/etc/hiprofilerd.cfg
Normal file
65
device/etc/hiprofilerd.cfg
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
{
|
||||||
|
"services" : [{
|
||||||
|
"name" : "hiprofilerd",
|
||||||
|
"path" : ["/system/bin/hiprofilerd"],
|
||||||
|
"sandbox" : 0,
|
||||||
|
"once" : 1,
|
||||||
|
"uid" : "hiprofiler",
|
||||||
|
"gid" : ["shell", "readproc"],
|
||||||
|
"socket" : [{
|
||||||
|
"name" : "hiprofiler_unix_socket",
|
||||||
|
"family" : "AF_UNIX",
|
||||||
|
"type" : "SOCK_STREAM",
|
||||||
|
"protocol" : "default",
|
||||||
|
"permissions" : "0600",
|
||||||
|
"uid" : "hiprofiler",
|
||||||
|
"gid" : "shell",
|
||||||
|
"option" : [
|
||||||
|
"SOCKET_OPTION_PASSCRED",
|
||||||
|
"SOCK_NONBLOCK",
|
||||||
|
"SOCK_CLOEXEC"
|
||||||
|
]
|
||||||
|
}],
|
||||||
|
"secon" : "u:r:hiprofilerd:s0",
|
||||||
|
"start-mode" : "condition"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"jobs" : [{
|
||||||
|
"name" : "param:hiviewdfx.hiprofiler.profilerd.start=1",
|
||||||
|
"condition" : "hiviewdfx.hiprofiler.profilerd.start=1",
|
||||||
|
"cmds" : [
|
||||||
|
"start hiprofilerd"
|
||||||
|
]
|
||||||
|
}, {
|
||||||
|
"name" : "param:hiviewdfx.hiprofiler.profilerd.start=0",
|
||||||
|
"condition" : "hiviewdfx.hiprofiler.profilerd.start=0",
|
||||||
|
"cmds" : [
|
||||||
|
"stop hiprofilerd"
|
||||||
|
]
|
||||||
|
}, {
|
||||||
|
"name" : "param:hiviewdfx.hiprofiler.plugins.start=1",
|
||||||
|
"condition" : "hiviewdfx.hiprofiler.plugins.start=1",
|
||||||
|
"cmds" : [
|
||||||
|
"start hiprofiler_plugins"
|
||||||
|
]
|
||||||
|
}, {
|
||||||
|
"name" : "param:hiviewdfx.hiprofiler.plugins.start=0",
|
||||||
|
"condition" : "hiviewdfx.hiprofiler.plugins.start=0",
|
||||||
|
"cmds" : [
|
||||||
|
"stop hiprofiler_plugins"
|
||||||
|
]
|
||||||
|
}, {
|
||||||
|
"name" : "param:hiviewdfx.hiprofiler.native_memoryd.start=1",
|
||||||
|
"condition" : "hiviewdfx.hiprofiler.native_memoryd.start=1",
|
||||||
|
"cmds" : [
|
||||||
|
"start hiprofiler_daemon"
|
||||||
|
]
|
||||||
|
}, {
|
||||||
|
"name" : "param:hiviewdfx.hiprofiler.native_memoryd.start=0",
|
||||||
|
"condition" : "hiviewdfx.hiprofiler.native_memoryd.start=0",
|
||||||
|
"cmds" : [
|
||||||
|
"stop hiprofiler_daemon"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -67,8 +67,18 @@ ohos_source_set("plugins_sources") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ohos_prebuilt_etc("hiprofiler_plugins.cfg") {
|
||||||
|
source = "../../etc/hiprofiler_plugins.cfg"
|
||||||
|
relative_install_dir = "init"
|
||||||
|
part_name = "${OHOS_PROFILER_PART_NAME}"
|
||||||
|
subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
|
||||||
|
}
|
||||||
|
|
||||||
ohos_executable("hiprofiler_plugins") {
|
ohos_executable("hiprofiler_plugins") {
|
||||||
deps = [ ":plugins_sources" ]
|
deps = [
|
||||||
|
":hiprofiler_plugins.cfg",
|
||||||
|
":plugins_sources",
|
||||||
|
]
|
||||||
sources = [ "src/main.cpp" ]
|
sources = [ "src/main.cpp" ]
|
||||||
if (current_toolchain != host_toolchain) {
|
if (current_toolchain != host_toolchain) {
|
||||||
defines = [ "HAVE_HILOG" ]
|
defines = [ "HAVE_HILOG" ]
|
||||||
|
@ -34,6 +34,13 @@ config("hook_config") {
|
|||||||
defines += [ "target_cpu_${target_cpu}" ]
|
defines += [ "target_cpu_${target_cpu}" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ohos_prebuilt_etc("hiprofiler_daemon.cfg") {
|
||||||
|
source = "../../etc/hiprofiler_daemon.cfg"
|
||||||
|
relative_install_dir = "init"
|
||||||
|
part_name = "${OHOS_PROFILER_PART_NAME}"
|
||||||
|
subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
|
||||||
|
}
|
||||||
|
|
||||||
ohos_executable("native_daemon") {
|
ohos_executable("native_daemon") {
|
||||||
output_name = "native_daemon"
|
output_name = "native_daemon"
|
||||||
sources = [
|
sources = [
|
||||||
@ -77,6 +84,7 @@ ohos_executable("native_daemon") {
|
|||||||
"//third_party/googletest/googletest/include",
|
"//third_party/googletest/googletest/include",
|
||||||
]
|
]
|
||||||
deps = [
|
deps = [
|
||||||
|
":hiprofiler_daemon.cfg",
|
||||||
"${OHOS_PROFILER_DIR}/device/services/shared_memory:shared_memory",
|
"${OHOS_PROFILER_DIR}/device/services/shared_memory:shared_memory",
|
||||||
"${OHOS_PROFILER_DIR}/protos/services:plugin_service_proto",
|
"${OHOS_PROFILER_DIR}/protos/services:plugin_service_proto",
|
||||||
"${OHOS_PROFILER_DIR}/protos/services:profiler_service_all_type_source",
|
"${OHOS_PROFILER_DIR}/protos/services:profiler_service_all_type_source",
|
||||||
|
@ -59,9 +59,17 @@ ohos_source_set("profiler_service") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ohos_prebuilt_etc("hiprofilerd.cfg") {
|
||||||
|
source = "../../etc/hiprofilerd.cfg"
|
||||||
|
relative_install_dir = "init"
|
||||||
|
part_name = "${OHOS_PROFILER_PART_NAME}"
|
||||||
|
subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
|
||||||
|
}
|
||||||
|
|
||||||
ohos_executable("hiprofilerd") {
|
ohos_executable("hiprofilerd") {
|
||||||
sources = [ "src/main.cpp" ]
|
sources = [ "src/main.cpp" ]
|
||||||
deps = [
|
deps = [
|
||||||
|
":hiprofilerd.cfg",
|
||||||
":profiler_service",
|
":profiler_service",
|
||||||
"../../base:hiprofiler_base",
|
"../../base:hiprofiler_base",
|
||||||
"../plugin_service:hiprofiler_plugin_service",
|
"../plugin_service:hiprofiler_plugin_service",
|
||||||
|
Loading…
Reference in New Issue
Block a user