diff --git a/adapter/uhdf2/hdi/src/idevmgr_client.cpp b/adapter/uhdf2/hdi/src/idevmgr_client.cpp index a339d72439da5f8fb1797a5612f305d0b1564679..467fb0e1c5fd885ada50675ede9601f1f93e5932 100644 --- a/adapter/uhdf2/hdi/src/idevmgr_client.cpp +++ b/adapter/uhdf2/hdi/src/idevmgr_client.cpp @@ -40,6 +40,7 @@ enum DevmgrCmdId : uint32_t { DEVMGR_SERVICE_UNLOAD_DEVICE, DEVMGR_SERVICE_QUERY_DEVICE, DEVMGR_SERVICE_LIST_ALL_DEVICE, + DEVMGR_SERVICE_LIST_ALL_HOST, }; class DeviceManagerProxy : public IProxyBroker { @@ -49,6 +50,7 @@ public: int32_t LoadDevice(const std::string &serviceName) override; int32_t UnloadDevice(const std::string &serviceName) override; int32_t ListAllDevice(std::vector &deviceInfos) override; + int32_t ListAllHost(std::vector &pidList) override; private: static inline BrokerDelegator delegator_; @@ -183,6 +185,47 @@ int32_t DeviceManagerProxy::ListAllDevice(std::vector &deviceInf return status; } +static void HdfDevMgrFillPidList(std::vector &pidList, MessageParcel &reply) +{ + uint32_t count = 0; + reply.ReadUint32(count); + + int pid = -1; + for (uint32_t i = 0; i < count; ++i) { + reply.ReadInt32(pid); + pidList.push_back(pid); + } + + return; +} + +int32_t DeviceManagerProxy::ListAllHost(std::vector &pidList) +{ + MessageParcel data; + MessageParcel reply; + if (!data.WriteInterfaceToken(GetDescriptor())) { + return HDF_FAILURE; + } + + MessageOption option; + std::unique_lock lock(g_remoteMutex); + if (Remote() == nullptr) { + HDF_LOGE("invalid param Remote()"); + return HDF_ERR_INVALID_PARAM; + } + int status = Remote()->SendRequest( + static_cast(DEVMGR_SERVICE_LIST_ALL_HOST), data, reply, option); + lock.unlock(); + if (status != HDF_SUCCESS) { + HDF_LOGE("list all service info failed, %{public}d", status); + return status; + } else { + HdfDevMgrFillPidList(pidList, reply); + } + HDF_LOGD("get all service info success"); + return status; +} + sptr IDeviceManager::Get() { auto servmgr = ServiceManager::V1_0::IServiceManager::Get(); diff --git a/adapter/uhdf2/host/src/devhost_dump.c b/adapter/uhdf2/host/src/devhost_dump.c index 7fb9ab93f21f276139dd55b3689298933b037b23..b9ef1d73cdd6f0592f6893404161eaa437f583ee 100644 --- a/adapter/uhdf2/host/src/devhost_dump.c +++ b/adapter/uhdf2/host/src/devhost_dump.c @@ -21,6 +21,7 @@ #include "hdf_log.h" #include "osal_mem.h" #include "osal_mutex.h" +#include "hdf_dump_reg.h" #define HDF_LOG_TAG devhost_dump @@ -121,7 +122,6 @@ int32_t DevHostRegisterDumpHost(DevHostDumpFunc dump) void DevHostDump(struct HdfSBuf *data, struct HdfSBuf *reply) { - HDF_LOGI("%{public}s enter", __func__); if (data == NULL || reply == NULL) { return; } @@ -157,6 +157,14 @@ void DevHostDump(struct HdfSBuf *data, struct HdfSBuf *reply) if (!dumpFlag) { (void)HdfSbufWriteString(reply, "The service does not register dump function\n"); } + } else if (strcmp(option, "--ipc") == 0) { + int32_t fd = HdfSbufReadFileDescriptor(data); + HDF_LOGI("%{public}s %{public}d", option, fd); + const char *dumpCmd = HdfSbufReadString(data); + if (dumpCmd == NULL) { + return; + } + HdfDumpIpcStat(fd, dumpCmd); } else { HDF_LOGE("%{public}s invalid parameter %{public}s", __func__, option); } diff --git a/adapter/uhdf2/host/test/BUILD.gn b/adapter/uhdf2/host/test/BUILD.gn index 279a46b8fb29c139ee2e0756ae3e7e9f6424059c..05bf9dbe305e4e9e0ab00f1fe0c50163825a520d 100644 --- a/adapter/uhdf2/host/test/BUILD.gn +++ b/adapter/uhdf2/host/test/BUILD.gn @@ -51,6 +51,7 @@ ohos_unittest("DevMgrTest") { external_deps = [ "c_utils:utils", "hilog:libhilog", + "ipc:ipc_single", ] } else { external_deps = [ "hilog:libhilog" ] diff --git a/adapter/uhdf2/ipc/src/hdf_dump.cpp b/adapter/uhdf2/ipc/src/hdf_dump.cpp index 082becd47c4b1a4f2575a313f908ef3c6d496a13..3cea8189294a5f954788c22f7608e39376e6a049 100644 --- a/adapter/uhdf2/ipc/src/hdf_dump.cpp +++ b/adapter/uhdf2/ipc/src/hdf_dump.cpp @@ -15,21 +15,123 @@ #include "hdf_dump.h" +#include "ipc_payload_statistics.h" + #include "file_ex.h" #include "string_ex.h" +#include "unistd.h" #include "hdf_base.h" #include "hdf_dump_reg.h" #include "hdf_log.h" #include "hdf_sbuf.h" +#include "securec.h" #define HDF_LOG_TAG hdf_dump +using namespace OHOS; + static DevHostDumpFunc g_dump = nullptr; +const char *HDF_DUMP_SUCCESS_STR = " success\n"; +const char *HDF_DUMP_FAIL_STR = " fail\n"; + // The maximum parameter is the parameter sent to the host, including public(num=2) and private(mux_num=20) parameters static constexpr int32_t MAX_PARA_NUM = 22; +static bool HdfDumpIpcStatStart(std::string& result) +{ + result = std::string("HdfDumpIpcStatStart pid:") + std::to_string(getpid()); + bool ret = IPCPayloadStatistics::StartStatistics(); + result += ret ? HDF_DUMP_SUCCESS_STR : HDF_DUMP_FAIL_STR; + return ret; +} + +static int32_t HdfDumpIpcStatStop(std::string& result) +{ + result = std::string("HdfDumpIpcStatStop pid:") + std::to_string(getpid()); + bool ret = IPCPayloadStatistics::StopStatistics(); + result += ret ? HDF_DUMP_SUCCESS_STR : HDF_DUMP_FAIL_STR; + return ret; +} + +static int32_t HdfDumpIpcStatGet(std::string& result) +{ + result += "********************************GlobalStatisticsInfo********************************"; + result += "\nCurrentPid:"; + result += std::to_string(getpid()); + result += "\nTotalCount:"; + result += std::to_string(IPCPayloadStatistics::GetTotalCount()); + result += "\nTotalTimeCost:"; + result += std::to_string(IPCPayloadStatistics::GetTotalCost()); + std::vector pids; + pids = IPCPayloadStatistics::GetPids(); + for (unsigned int i = 0; i < pids.size(); i++) { + result += "\n--------------------------------ProcessStatisticsInfo-------------------------------"; + result += "\nCallingPid:"; + result += std::to_string(pids[i]); + result += "\nCallingPidTotalCount:"; + result += std::to_string(IPCPayloadStatistics::GetCount(pids[i])); + result += "\nCallingPidTotalTimeCost:"; + result += std::to_string(IPCPayloadStatistics::GetCost(pids[i])); + std::vector intfs; + intfs = IPCPayloadStatistics::GetDescriptorCodes(pids[i]); + for (unsigned int j = 0; j < intfs.size(); j++) { + result += "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~InterfaceStatisticsInfo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"; + result += "\nDescriptorCode:"; + result += Str16ToStr8(intfs[j].desc) + std::string("_") + std::to_string(intfs[j].code); + result += "\nDescriptorCodeCount:"; + result += std::to_string( + IPCPayloadStatistics::GetDescriptorCodeCount(pids[i], intfs[j].desc, intfs[j].code)); + result += "\nDescriptorCodeTimeCost:"; + result += "\nTotal:"; + result += std::to_string( + IPCPayloadStatistics::GetDescriptorCodeCost(pids[i], intfs[j].desc, intfs[j].code).totalCost); + result += " | Max:"; + result += std::to_string( + IPCPayloadStatistics::GetDescriptorCodeCost(pids[i], intfs[j].desc, intfs[j].code).maxCost); + result += " | Min:"; + result += std::to_string( + IPCPayloadStatistics::GetDescriptorCodeCost(pids[i], intfs[j].desc, intfs[j].code).minCost); + result += " | Avg:"; + result += std::to_string( + IPCPayloadStatistics::GetDescriptorCodeCost(pids[i], intfs[j].desc, intfs[j].code).averCost); + result += "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"; + } + result += "\n------------------------------------------------------------------------------------"; + } + result += "\n************************************************************************************\n"; + + return true; +} + +bool HdfDumpIpcStat(int32_t fd, const char *cmd) +{ + if (cmd == nullptr) { + HDF_LOGE("%{public}s cmd is null", __func__); + return HDF_FAILURE; + } + + bool ret = false; + std::string result; + HDF_LOGI("%{public}s %{public}d", cmd, fd); + if (strcmp(cmd, "--start-stat") == 0) { + ret = HdfDumpIpcStatStart(result); + } else if (strcmp(cmd, "--stop-stat") == 0) { + ret = HdfDumpIpcStatStop(result); + } else if (strcmp(cmd, "--stat") == 0) { + ret = HdfDumpIpcStatGet(result); + } else { + return ret; + } + + if (!OHOS::SaveStringToFd(fd, result)) { + ret = false; + } + + return ret; +} + void HdfRegisterDumpFunc(DevHostDumpFunc dump) { g_dump = dump; @@ -37,8 +139,8 @@ void HdfRegisterDumpFunc(DevHostDumpFunc dump) int32_t HdfDump(int32_t fd, const std::vector &args) { - if (g_dump == nullptr) { - HDF_LOGE("%{public}s g_dump is null", __func__); + if (g_dump == nullptr || fd < 0) { + HDF_LOGE("%{public}s g_dump fd:%{public}d", __func__, fd); return HDF_FAILURE; } @@ -64,6 +166,10 @@ int32_t HdfDump(int32_t fd, const std::vector &args) goto FINISHED; } + if (!HdfSbufWriteFileDescriptor(data, fd)) { + goto FINISHED; + } + if (!HdfSbufWriteUint32(data, argv)) { goto FINISHED; } diff --git a/adapter/uhdf2/manager/include/devmgr_service_stub.h b/adapter/uhdf2/manager/include/devmgr_service_stub.h index 246aa53a65bb5b71164480edc6825a6d4f6df365..e88a345be976705ca2c5b3be234490af45376847 100644 --- a/adapter/uhdf2/manager/include/devmgr_service_stub.h +++ b/adapter/uhdf2/manager/include/devmgr_service_stub.h @@ -40,6 +40,7 @@ enum { DEVMGR_SERVICE_UNLOAD_DEVICE, DEVMGR_SERVICE_QUERY_DEVICE, DEVMGR_SERVICE_LIST_ALL_DEVICE, + DEVMGR_SERVICE_LIST_ALL_HOST, }; struct HdfObject *DevmgrServiceStubCreate(void); diff --git a/adapter/uhdf2/manager/src/devmgr_dump.c b/adapter/uhdf2/manager/src/devmgr_dump.c index 8a0b7bfdb6bbe08f00b76c392aa6c375658905b3..e2eccf70c2bbc2d464b9e8d69eb615bd3f34f62c 100644 --- a/adapter/uhdf2/manager/src/devmgr_dump.c +++ b/adapter/uhdf2/manager/src/devmgr_dump.c @@ -29,7 +29,7 @@ #include "devmgr_dump.h" #define HDF_LOG_TAG devmgr_dump - + static const char *HELP_COMMENT = " usage:\n" " -help :display help information\n" @@ -192,6 +192,136 @@ static int32_t DevMgrDumpService(uint32_t argv, struct HdfSBuf *data, struct Hdf return ret; } +static int32_t DevMgrDumpAllHostIpcStats(struct HdfSBuf *data, struct HdfSBuf *reply) +{ + struct DevmgrService *devMgrSvc = (struct DevmgrService *)DevmgrServiceGetInstance(); + if (devMgrSvc == NULL) { + return HDF_FAILURE; + } + + struct DevHostServiceClnt *hostClnt = NULL; + int32_t ret = HDF_FAILURE; + DLIST_FOR_EACH_ENTRY(hostClnt, &devMgrSvc->hosts, struct DevHostServiceClnt, node) { + HDF_LOGI("%{public}s hostName:%{public}s", __func__, hostClnt->hostName); + if (hostClnt->hostService == NULL || hostClnt->hostService->Dump == NULL) { + HDF_LOGI("The host does not start\n"); + continue; + } + ret = hostClnt->hostService->Dump(hostClnt->hostService, data, reply); + } + + return ret; +} + +static int32_t DevMgrDumpAllHostIpcStat(int32_t fd, const char *cmd, struct HdfSBuf *reply) +{ + struct HdfSBuf *ipcData = HdfSbufTypedObtain(SBUF_IPC); + if (ipcData == NULL) { + return HDF_FAILURE; + } + + if (!HdfSbufWriteString(ipcData, "--ipc")) { + HdfSbufRecycle(ipcData); + return HDF_FAILURE; + } + + if (!HdfSbufWriteFileDescriptor(ipcData, fd)) { + HdfSbufRecycle(ipcData); + return HDF_FAILURE; + } + + if (!HdfSbufWriteString(ipcData, cmd)) { + HdfSbufRecycle(ipcData); + return HDF_FAILURE; + } + + int32_t ret = DevMgrDumpAllHostIpcStats(ipcData, reply); + HdfSbufRecycle(ipcData); + return ret; +} + +static int32_t DevMgrDumpSingleHostIpcStats(int32_t pid, struct HdfSBuf *data, struct HdfSBuf *reply) +{ + struct DevmgrService *devMgrSvc = (struct DevmgrService *)DevmgrServiceGetInstance(); + if (devMgrSvc == NULL) { + return HDF_FAILURE; + } + + struct DevHostServiceClnt *hostClnt = NULL; + int32_t ret = HDF_FAILURE; + DLIST_FOR_EACH_ENTRY(hostClnt, &devMgrSvc->hosts, struct DevHostServiceClnt, node) { + if (hostClnt->hostService == NULL || hostClnt->hostService->Dump == NULL) { + HDF_LOGI("The host does not start\n"); + continue; + } + if (hostClnt->hostProcessId == pid) { + HDF_LOGI("%{public}s hostName:%{public}s %{public}d %{public}d", __func__, + hostClnt->hostName, hostClnt->hostProcessId, pid); + ret = hostClnt->hostService->Dump(hostClnt->hostService, data, reply); + break; + } + } + + return ret; +} + +static int32_t DevMgrDumpSingleHostIpcStat(int32_t pid, int32_t fd, const char *cmd, struct HdfSBuf *reply) +{ + struct HdfSBuf *ipcData = HdfSbufTypedObtain(SBUF_IPC); + if (ipcData == NULL) { + return HDF_FAILURE; + } + + if (!HdfSbufWriteString(ipcData, "--ipc")) { + HdfSbufRecycle(ipcData); + return HDF_FAILURE; + } + + if (!HdfSbufWriteFileDescriptor(ipcData, fd)) { + HdfSbufRecycle(ipcData); + return HDF_FAILURE; + } + + if (!HdfSbufWriteString(ipcData, cmd)) { + HdfSbufRecycle(ipcData); + return HDF_FAILURE; + } + + int32_t ret = DevMgrDumpSingleHostIpcStats(pid, ipcData, reply); + HdfSbufRecycle(ipcData); + return ret; +} + +static int32_t DevMgrDumpIpc(int32_t fd, struct HdfSBuf *data, struct HdfSBuf *reply) +{ + const char *value = HdfSbufReadString(data); + if (value == NULL) { + HDF_LOGE("%{public}s value is null", __func__); + return HDF_FAILURE; + } + + const char *dumpCmd = HdfSbufReadString(data); + if (dumpCmd == NULL) { + HDF_LOGE("%{public}s dumpCmd is null", __func__); + return HDF_FAILURE; + } + + HDF_LOGI("%{public}s %{public}s fd:%{public}d", value, dumpCmd, fd); + if (strcmp(value, "all") == 0) { + HdfDumpIpcStat(fd, dumpCmd); + return DevMgrDumpAllHostIpcStat(fd, dumpCmd, reply); + } else { + int32_t pid = atoi(value); + if (pid == getpid()) { + HdfDumpIpcStat(fd, dumpCmd); + } else { + DevMgrDumpSingleHostIpcStat(pid, fd, dumpCmd, reply); + } + } + + return HDF_SUCCESS; +} + static int32_t DevMgrFillDeviceHostInfo(struct HdfSBuf *data, struct HdfSBuf *reply) { const char *name = HdfSbufReadString(data); @@ -470,6 +600,8 @@ static int32_t DevMgrDump(struct HdfSBuf *data, struct HdfSBuf *reply) return HDF_FAILURE; } + int32_t fd = HdfSbufReadFileDescriptor(data); + uint32_t argv = 0; HdfSbufReadUint32(data, &argv); @@ -501,6 +633,8 @@ static int32_t DevMgrDump(struct HdfSBuf *data, struct HdfSBuf *reply) return DevMgrDumpHost(argv - 1, data, reply); } else if (strcmp(value, "-service") == 0) { return DevMgrDumpService(argv - 1, data, reply); + } else if (strcmp(value, "--ipc") == 0) { + return DevMgrDumpIpc(fd, data, reply); } else { (void)HdfSbufWriteString(reply, HELP_COMMENT); return HDF_SUCCESS; diff --git a/adapter/uhdf2/manager/src/devmgr_service_stub.c b/adapter/uhdf2/manager/src/devmgr_service_stub.c index ad7b82989bf7f0f7a2e35fe7e2ea79518afef818..e4ec2609c78d4ea26db128001a199dd85f6e5aaa 100644 --- a/adapter/uhdf2/manager/src/devmgr_service_stub.c +++ b/adapter/uhdf2/manager/src/devmgr_service_stub.c @@ -20,6 +20,7 @@ #include #include "devhost_service_proxy.h" +#include "devhost_service_clnt.h" #include "device_token_proxy.h" #include "devmgr_query_device.h" #include "devsvc_manager.h" @@ -35,6 +36,24 @@ #define HDF_LOG_TAG devmgr_service_stub +static void DevmgrServicehostClntGetPid(struct IDevmgrService *devmgrSvc, uint16_t hostId) +{ + struct DevmgrService *dmService = (struct DevmgrService *)devmgrSvc; + if (dmService == NULL) { + return; + } + + struct DevHostServiceClnt *hostClnt = NULL; + DLIST_FOR_EACH_ENTRY(hostClnt, &dmService->hosts, struct DevHostServiceClnt, node) { + if (hostClnt->hostId == hostId) { + hostClnt->hostProcessId = HdfRemoteGetCallingPid(); + break; + } + } + + return; +} + static int32_t DevmgrServiceStubDispatchAttachDeviceHost(struct IDevmgrService *devmgrSvc, struct HdfSBuf *data) { uint32_t hostId = 0; @@ -44,6 +63,7 @@ static int32_t DevmgrServiceStubDispatchAttachDeviceHost(struct IDevmgrService * } struct HdfRemoteService *service = HdfSbufReadRemoteService(data); struct IDevHostService *hostIf = DevHostServiceProxyObtain(hostId, service); + DevmgrServicehostClntGetPid(devmgrSvc, hostId); return devmgrSvc->AttachDeviceHost(devmgrSvc, hostId, hostIf); } @@ -109,6 +129,19 @@ static int32_t DevmgrServiceStubDispatchListAllDevice(struct IDevmgrService *dev return devmgrSvc->ListAllDevice(devmgrSvc, reply); } +static int32_t DevmgrServiceStubListAllHost(struct IDevmgrService *devmgrSvc, struct HdfSBuf *reply) +{ + if (reply == NULL) { + HDF_LOGE("%{public}s:service name is null", __func__); + return HDF_ERR_INVALID_PARAM; + } + HDF_LOGD("%{public}s:get all device info", __func__); + + int32_t ret = devmgrSvc->ListAllHost(devmgrSvc, reply); + HdfSbufWriteInt32(reply, getpid()); + return ret; +} + int32_t DevmgrServiceStubDispatch(struct HdfRemoteService *stub, int code, struct HdfSBuf *data, struct HdfSBuf *reply) { int32_t ret = HDF_FAILURE; @@ -145,6 +178,9 @@ int32_t DevmgrServiceStubDispatch(struct HdfRemoteService *stub, int code, struc case DEVMGR_SERVICE_LIST_ALL_DEVICE: ret = DevmgrServiceStubDispatchListAllDevice(super, reply); break; + case DEVMGR_SERVICE_LIST_ALL_HOST: + ret = DevmgrServiceStubListAllHost(super, reply); + break; default: return HdfRemoteServiceDefaultDispatch(serviceStub->remote, code, data, reply); } diff --git a/framework/core/manager/include/devhost_service_clnt.h b/framework/core/manager/include/devhost_service_clnt.h index 8faabae06f6f844693d967fe2cdfb7a9e379f24f..6416755e6d6f31747273eb1a012ea92465efa5bb 100644 --- a/framework/core/manager/include/devhost_service_clnt.h +++ b/framework/core/manager/include/devhost_service_clnt.h @@ -25,6 +25,7 @@ struct DevHostServiceClnt { uint16_t devCount; uint16_t hostId; int hostPid; + int hostProcessId; const char *hostName; bool stopFlag; }; diff --git a/framework/core/manager/src/devmgr_service.c b/framework/core/manager/src/devmgr_service.c index e5d115b48492f799f888668246601eb2f11b107b..0ca8e609a26cdf49615fa4874b2aade73dec5560 100644 --- a/framework/core/manager/src/devmgr_service.c +++ b/framework/core/manager/src/devmgr_service.c @@ -394,6 +394,24 @@ static int32_t DevmgrServiceListAllDevice(struct IDevmgrService *inst, struct Hd return HDF_SUCCESS; } +static int32_t DevmgrServiceListAllHost(struct IDevmgrService *inst, struct HdfSBuf *reply) +{ + struct DevmgrService *devMgrSvc = (struct DevmgrService *)inst; + struct DevHostServiceClnt *hostClnt = NULL; + + if (devMgrSvc == NULL || reply == NULL) { + HDF_LOGE("%{public}s failed, parameter is null", __func__); + return HDF_FAILURE; + } + + HdfSbufWriteUint32(reply, DListGetCount(&devMgrSvc->hosts) + 1); + DLIST_FOR_EACH_ENTRY(hostClnt, &devMgrSvc->hosts, struct DevHostServiceClnt, node) { + HdfSbufWriteInt32(reply, hostClnt->hostProcessId); + } + + return HDF_SUCCESS; +} + int DevmgrServiceStartService(struct IDevmgrService *inst) { int ret; @@ -469,6 +487,7 @@ bool DevmgrServiceConstruct(struct DevmgrService *inst) devMgrSvcIf->StartService = DevmgrServiceStartService; devMgrSvcIf->PowerStateChange = DevmgrServicePowerStateChange; devMgrSvcIf->ListAllDevice = DevmgrServiceListAllDevice; + devMgrSvcIf->ListAllHost = DevmgrServiceListAllHost; DListHeadInit(&inst->hosts); return true; } else { diff --git a/framework/core/shared/include/devmgr_service_if.h b/framework/core/shared/include/devmgr_service_if.h index 872822883b2df8e55d733bad797ddeea55f62cc4..21dcb4d78b8f151140eb76369f74ddef4f326671 100644 --- a/framework/core/shared/include/devmgr_service_if.h +++ b/framework/core/shared/include/devmgr_service_if.h @@ -28,6 +28,7 @@ struct IDevmgrService { int (*StartService)(struct IDevmgrService *); int (*PowerStateChange)(struct IDevmgrService *, enum HdfPowerState pEvent); int (*ListAllDevice)(struct IDevmgrService *, struct HdfSBuf *); + int (*ListAllHost)(struct IDevmgrService *, struct HdfSBuf *); }; #endif /* DEVMGR_SERVICE_IF_H */ diff --git a/interfaces/inner_api/hdi/idevmgr_hdi.h b/interfaces/inner_api/hdi/idevmgr_hdi.h index 05f5caf4af41b5cf0ab4f265237f5f1a1816b5d1..d7440e663c0c0d1f42a08fbd5f806efbb1247309 100644 --- a/interfaces/inner_api/hdi/idevmgr_hdi.h +++ b/interfaces/inner_api/hdi/idevmgr_hdi.h @@ -108,6 +108,14 @@ public: * @return Returns HDF_SUCCESS if the operation is successful; otherwise, the operation fails. */ virtual int32_t ListAllDevice(std::vector &deviceInfos) = 0; + + /** + * @brief Obtains pid about all hosts. + * + * @param pidList Indicates information about all hosts. + * @return Returns HDF_SUCCESS if the operation is successful; otherwise, the operation fails. + */ + virtual int32_t ListAllHost(std::vector &pidList) = 0; }; } // namespace V1_0 } // namespace DeviceManager diff --git a/interfaces/inner_api/ipc/hdf_dump_reg.h b/interfaces/inner_api/ipc/hdf_dump_reg.h index 4bec261301a5088bb9e1e04c26d7d8a79c88a322..d59d5929308dd90d335f9bcdea4fc2a24c42d811 100644 --- a/interfaces/inner_api/ipc/hdf_dump_reg.h +++ b/interfaces/inner_api/ipc/hdf_dump_reg.h @@ -44,6 +44,8 @@ extern "C" { #endif /* __cplusplus */ +bool HdfDumpIpcStat(int32_t fd, const char *cmd); + /** * @brief Implements IPC dump. *