!710 增加配置文件

Merge pull request !710 from zhangcui/master
This commit is contained in:
openharmony_ci 2023-01-20 09:45:43 +00:00 committed by Gitee
commit c872588ce3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 133 additions and 1 deletions

View 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"
}
]
}

View 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"
]
}
]
}

View 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"
]
}
]
}

View File

@ -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") {
deps = [ ":plugins_sources" ]
deps = [
":hiprofiler_plugins.cfg",
":plugins_sources",
]
sources = [ "src/main.cpp" ]
if (current_toolchain != host_toolchain) {
defines = [ "HAVE_HILOG" ]

View File

@ -34,6 +34,13 @@ config("hook_config") {
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") {
output_name = "native_daemon"
sources = [
@ -77,6 +84,7 @@ ohos_executable("native_daemon") {
"//third_party/googletest/googletest/include",
]
deps = [
":hiprofiler_daemon.cfg",
"${OHOS_PROFILER_DIR}/device/services/shared_memory:shared_memory",
"${OHOS_PROFILER_DIR}/protos/services:plugin_service_proto",
"${OHOS_PROFILER_DIR}/protos/services:profiler_service_all_type_source",

View File

@ -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") {
sources = [ "src/main.cpp" ]
deps = [
":hiprofilerd.cfg",
":profiler_service",
"../../base:hiprofiler_base",
"../plugin_service:hiprofiler_plugin_service",