/base/hiviewdfx/hiview/service/ |
D | hiview_service.cpp | 39 void HiviewService::DumpRequestDispatcher(int fd, const std::vector<std::string> &cmds) in DumpRequestDispatcher() argument 41 if (fd < 0) { in DumpRequestDispatcher() 47 DumpLoadedPluginInfo(fd); in DumpRequestDispatcher() 53 DumpDetailedInfo(fd); in DumpRequestDispatcher() 59 DumpPluginInfo(fd, cmds); in DumpRequestDispatcher() 63 PrintUsage(fd); in DumpRequestDispatcher() 67 void HiviewService::DumpPluginInfo(int fd, const std::vector<std::string> &cmds) const in DumpPluginInfo() argument 87 pluginPtr->Dump(fd, newCmd); in DumpPluginInfo() 92 pluginPtr->Dump(fd, newCmd); in DumpPluginInfo() 98 void HiviewService::DumpDetailedInfo(int fd) in DumpDetailedInfo() argument [all …]
|
D | hiview_service.h | 31 void DumpRequestDispatcher(int fd, const std::vector<std::string>& cmds); 33 void DumpDetailedInfo(int fd); 34 void DumpPluginInfo(int fd, const std::vector<std::string>& cmds) const; 35 void DumpLoadedPluginInfo(int fd) const; 36 void DumpPluginUsageInfo(int fd); 37 void DumpPluginUsageInfo(int fd, const std::string& pluginName) const; 39 void DumpThreadUsageInfo(int fd) const; 40 void DumpThreadUsageInfo(int fd, const std::string& threadName) const; 42 void DumpPipelineUsageInfo(int fd) const; 43 void DumpPipelineUsageInfo(int fd, const std::string& pipelineName) const; [all …]
|
/base/security/access_token/interfaces/innerkits/token_setproc/src/ |
D | token_setproc.c | 53 int fd = open(TOKENID_DEVNODE, O_RDWR); in GetSelfTokenID() local 54 if (fd < 0) { in GetSelfTokenID() 57 int ret = ioctl(fd, ACCESS_TOKENID_GET_TOKENID, &token); in GetSelfTokenID() 59 close(fd); in GetSelfTokenID() 63 close(fd); in GetSelfTokenID() 69 int fd = open(TOKENID_DEVNODE, O_RDWR); in SetSelfTokenID() local 70 if (fd < 0) { in SetSelfTokenID() 73 int ret = ioctl(fd, ACCESS_TOKENID_SET_TOKENID, &tokenID); in SetSelfTokenID() 75 close(fd); in SetSelfTokenID() 79 close(fd); in SetSelfTokenID() [all …]
|
/base/hiviewdfx/hidumper_lite/ |
D | hidumper.c | 85 static void ExecAction(int fd, unsigned int cmd) in ExecAction() argument 87 if (fd < 0) { in ExecAction() 88 printf("Invalid fd: %d\n", fd); in ExecAction() 92 int ret = ioctl(fd, cmd, NULL); in ExecAction() 98 static void DumpALLInfo(int fd) in DumpALLInfo() argument 100 ExecAction(fd, HIDUMPER_DUMP_ALL); in DumpALLInfo() 103 static void DumpCpuUsage(int fd) in DumpCpuUsage() argument 105 ExecAction(fd, HIDUMPER_CPU_USAGE); in DumpCpuUsage() 108 static void DumpMemUsage(int fd) in DumpMemUsage() argument 110 ExecAction(fd, HIDUMPER_MEM_USAGE); in DumpMemUsage() [all …]
|
/base/update/updater/services/applypatch/ |
D | partition_record.cpp | 40 int fd = open(realPath, O_RDONLY | O_EXCL | O_CLOEXEC | O_BINARY); in IsPartitionUpdated() local 42 if (fd < 0) { in IsPartitionUpdated() 46 if (lseek(fd, PARTITION_RECORD_START, SEEK_CUR) < 0) { in IsPartitionUpdated() 48 close(fd); in IsPartitionUpdated() 51 … if (read(fd, buffer, PARTITION_UPDATER_RECORD_MSG_SIZE) != PARTITION_UPDATER_RECORD_MSG_SIZE) { in IsPartitionUpdated() 53 close(fd); in IsPartitionUpdated() 61 close(fd); in IsPartitionUpdated() 65 fsync(fd); in IsPartitionUpdated() 66 close(fd); in IsPartitionUpdated() 81 int fd = open(realPath, O_RDWR | O_EXCL | O_CLOEXEC | O_BINARY); in RecordPartitionUpdateStatus() local [all …]
|
D | store.cpp | 120 int fd = open(pathTmp.c_str(), O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); in WriteDataToStore() local 121 if (fd == -1) { in WriteDataToStore() 125 if (fchown(fd, O_USER_GROUP_ID, O_USER_GROUP_ID) != 0) { in WriteDataToStore() 127 close(fd); in WriteDataToStore() 131 if (size < 0 || !WriteFully(fd, buffer.data(), static_cast<size_t>(size))) { in WriteDataToStore() 133 close(fd); in WriteDataToStore() 137 close(fd); in WriteDataToStore() 140 if (fsync(fd) == -1) { in WriteDataToStore() 142 close(fd); in WriteDataToStore() 145 close(fd); in WriteDataToStore() [all …]
|
/base/startup/init/services/param/liteos/ |
D | param_hal.c | 50 static int ParamFileClose(int fd) in ParamFileClose() argument 53 return close(fd); in ParamFileClose() 55 return UtilsFileClose(fd); in ParamFileClose() 59 static int ParamFileRead(int fd, char* buf, unsigned int len) in ParamFileRead() argument 62 return read(fd, buf, len); in ParamFileRead() 64 return UtilsFileRead(fd, buf, len); in ParamFileRead() 68 static int ParamFileWrite(int fd, const char* buf, unsigned int len) in ParamFileWrite() argument 71 return write(fd, buf, len); in ParamFileWrite() 73 return UtilsFileWrite(fd, buf, len); in ParamFileWrite() 89 int fd = open(path, O_RDONLY); in ParamFileStat() local [all …]
|
/base/powermgr/battery_manager/services/native/src/ |
D | battery_dump.cpp | 30 bool BatteryDump::DumpBatteryHelp(int32_t fd, const std::vector<std::u16string> &args) in DumpBatteryHelp() argument 36 DumpHelp(fd); in DumpBatteryHelp() 40 void BatteryDump::DumpHelp(int32_t fd) in DumpHelp() argument 42 dprintf(fd, "Usage:\n"); in DumpHelp() 43 dprintf(fd, " -h: dump help\n"); in DumpHelp() 44 dprintf(fd, " -i: dump battery info\n"); in DumpHelp() 45 dprintf(fd, " -d: show low power diaolog\n"); in DumpHelp() 46 dprintf(fd, " -u: unplug battery charging state\n"); in DumpHelp() 47 dprintf(fd, " -r: reset battery charging state\n"); in DumpHelp() 50 void BatteryDump::DumpCurrentTime(int32_t fd) in DumpCurrentTime() argument [all …]
|
/base/security/device_security_level/services/dfx/ |
D | dslm_hidumper.c | 160 static void PrintBanner(int fd) in PrintBanner() argument 162 dprintf(fd, " ___ ___ _ __ __ ___ _ _ __ __ ___ ___ ___ " END_LINE); in PrintBanner() 163 dprintf(fd, "| \\/ __| | | \\/ | | \\| | | | \\/ | _ \\ __| _ \\" END_LINE); in PrintBanner() 164 dprintf(fd, "| |) \\__ \\ |__| |\\/| | | |) | |_| | |\\/| | _/ __| /" END_LINE); in PrintBanner() 165 dprintf(fd, "|___/|___/____|_| |_| |___/ \\___/|_| |_|_| |___|_|_\\" END_LINE); in PrintBanner() 168 static void DumpDeviceDetails(const DslmDeviceInfo *info, int32_t fd) in DumpDeviceDetails() argument 170 dprintf(fd, "DEVICE_ID : %x" END_LINE, info->machine.machineId); in DumpDeviceDetails() 171 dprintf(fd, "DEVICE_TYPE : %u" END_LINE, info->deviceType); in DumpDeviceDetails() 172 dprintf(fd, END_LINE); in DumpDeviceDetails() 174 …dprintf(fd, "DEVICE_ONLINE_STATUS : %s" END_LINE, (info->onlineStatus != 0) ? "online" : "off… in DumpDeviceDetails() [all …]
|
/base/startup/init/services/loopevent/socket/ |
D | le_socket.c | 62 int fd = socket(PF_UNIX, SOCK_STREAM, 0); in CreatePipeSocket_() local 63 LE_CHECK(fd > 0, return fd, "Failed to create socket"); in CreatePipeSocket_() 64 SetNoBlock(fd); in CreatePipeSocket_() 67 int ret = setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)); in CreatePipeSocket_() 72 LE_CHECK(ret == 0, close(fd); in CreatePipeSocket_() 76 LE_CHECK(ret == 0, close(fd); in CreatePipeSocket_() 79 ret = connect(fd, (struct sockaddr *)&serverAddr, size); in CreatePipeSocket_() 80 LE_CHECK(ret >= 0, close(fd); in CreatePipeSocket_() 82 LE_LOGV("CreatePipeSocket connect fd: %d server: %s ", fd, serverAddr.sun_path); in CreatePipeSocket_() 83 return fd; in CreatePipeSocket_() [all …]
|
/base/startup/init/services/init/ |
D | init_service_file.c | 43 if (file->fd >= 0) { in CreateFile() 44 close(file->fd); in CreateFile() 45 file->fd = -1; in CreateFile() 47 int fd = open(path, file->flags | O_CREAT, file->perm); in CreateFile() local 48 INIT_ERROR_CHECK(fd >= 0, return -1, "Failed open %s, err=%d ", path, errno); in CreateFile() 49 close(fd); in CreateFile() 50 fd = -1; in CreateFile() 53 file->fd = open(path, file->flags); in CreateFile() 54 return file->fd; in CreateFile() 57 static int SetFileEnv(int fd, const char *pathName) in SetFileEnv() argument [all …]
|
/base/update/updater/services/flashd/ |
D | partition.cpp | 44 auto fd = open(GetPartitionRealPath(devName_).c_str(), O_RDWR); in DoErase() local 45 if (fd < 0) { in DoErase() 50 uint64_t size = GetBlockDeviceSize(fd); in DoErase() 52 if (ioctl(fd, BLKSECDISCARD, &range) >= 0) { in DoErase() 53 close(fd); in DoErase() 59 if (ioctl(fd, BLKDISCARD, &range) < 0) { in DoErase() 60 close(fd); in DoErase() 65 if (!Updater::Utils::WriteFully(fd, buffer.data(), buffer.size())) { in DoErase() 66 close(fd); in DoErase() 70 fsync(fd); in DoErase() [all …]
|
/base/sensors/medical_sensor/services/medical_sensor/src/ |
D | medical_dump.cpp | 46 bool MedicalSensorDump::DumpSensorHelp(int32_t fd, const std::vector<std::u16string> &args) in DumpSensorHelp() argument 52 DumpHelp(fd); in DumpSensorHelp() 56 void MedicalSensorDump::DumpHelp(int32_t fd) in DumpHelp() argument 58 dprintf(fd, "Usage:\n"); in DumpHelp() 59 dprintf(fd, " -h: dump help\n"); in DumpHelp() 60 dprintf(fd, " -l: dump the sensor list\n"); in DumpHelp() 61 dprintf(fd, " -c: dump the sensor data channel info\n"); in DumpHelp() 62 dprintf(fd, " -o: dump the opening sensors\n"); in DumpHelp() 63 dprintf(fd, " -d: dump the last 10 packages sensor data\n"); in DumpHelp() 66 bool MedicalSensorDump::DumpSensorList(int32_t fd, in DumpSensorList() argument [all …]
|
/base/powermgr/battery_manager/services/native/test/unittest/src/ |
D | battery_dump_test.cpp | 41 int32_t fd = 1; variable 45 EXPECT_EQ(g_service->Dump(fd, args), ERR_OK); 56 int32_t fd = 1; variable 60 EXPECT_EQ(g_service->Dump(fd, args), ERR_OK); 71 int32_t fd = 1; variable 75 EXPECT_EQ(g_service->Dump(fd, args), ERR_OK); 86 int32_t fd = 1; variable 90 EXPECT_EQ(g_service->Dump(fd, args), ERR_OK); 101 int32_t fd = 1; variable 105 EXPECT_EQ(g_service->Dump(fd, args), ERR_NO_INIT); [all …]
|
/base/startup/hvb/test/ |
D | hvb_main.c | 39 int fd; in hvb_read_partition() local 44 fd = open(partition, O_RDONLY); in hvb_read_partition() 45 if (fd == -1) { in hvb_read_partition() 53 if (ioctl(fd, BLKGETSIZE64, &partition_size) != 0) { in hvb_read_partition() 61 where = lseek(fd, offset, SEEK_SET); in hvb_read_partition() 72 num_read = read(fd, buffer, num_bytes); in hvb_read_partition() 84 if (fd != -1) { in hvb_read_partition() 85 if (close(fd) != 0) { in hvb_read_partition() 99 int fd; in hvb_write_partition() local 104 fd = open(partition, O_WRONLY); in hvb_write_partition() [all …]
|
/base/hiviewdfx/hilog/frameworks/libhilog/socket/ |
D | dgram_socket_client.cpp | 28 int fd = GenerateFD(); in CheckSocket() local 29 if (fd < 0) { in CheckSocket() 30 return fd; in CheckSocket() 35 fdHandler.compare_exchange_strong(defaultValue, fd); in CheckSocket() 38 close(fd); in CheckSocket() 40 ret = fd; in CheckSocket() 41 SetHandler(fd); in CheckSocket()
|
/base/hiviewdfx/faultloggerd/interfaces/innerkits/signal_handler/ |
D | dfx_crash_local_handler.c | 72 __attribute__((noinline)) void PrintLog(int fd, const char *format, ...) in PrintLog() argument 81 if (fd > 0) { in PrintLog() 83 (void)write(fd, error, strlen(error)); in PrintLog() 88 if (fd > 0) { in PrintLog() 89 (void)write(fd, buf, strlen(buf)); in PrintLog() 93 __attribute__((noinline)) void CrashLocalUnwind(const int fd, const ucontext_t* uc) in CrashLocalUnwind() argument 100 PrintLog(fd, "Fail to mmap, errno(%d).", errno); in CrashLocalUnwind() 124 PrintLog(fd, "memcpy_s context error."); in CrashLocalUnwind() 130 PrintLog(fd, "Fail to init local unwind context.\n"); in CrashLocalUnwind() 143 PrintLog(fd, "reach max unwind frame count, stop.\n"); in CrashLocalUnwind() [all …]
|
/base/startup/init/services/loopevent/loop/ |
D | le_epoll.c | 24 static void GetEpollEvent_(int fd, int op, struct epoll_event *event) in GetEpollEvent_() argument 26 event->data.fd = fd; in GetEpollEvent_() 51 int fd = GetSocketFd((const TaskHandle)task); in AddEvent_() local 52 GetEpollEvent_(fd, op, &event); in AddEvent_() 53 if (IsValid_(epoll) && fd >= 0) { in AddEvent_() 54 ret = epoll_ctl(epoll->epollFd, EPOLL_CTL_ADD, fd, &event); in AddEvent_() 56 LE_CHECK(ret == 0, return LE_FAILURE, "Failed to add epoll_ctl %d ret %d", fd, errno); in AddEvent_() 67 int fd = GetSocketFd((const TaskHandle)task); in ModEvent_() local 68 GetEpollEvent_(fd, op, &event); in ModEvent_() 69 if (IsValid_(epoll) && fd >= 0) { in ModEvent_() [all …]
|
/base/update/updater/test/unittest/applypatch_test/ |
D | all_cmd_unittest.cpp | 38 bool WriteTestBin(int fd, const uint8_t &data, size_t size) const; 40 int AllCmdUnitTestMove(int &fd, std::vector<std::string> &allCmd, TransferManager &tm); 67 int fd = open(transferFile.c_str(), O_RDONLY | O_CLOEXEC); in GetTransferContents() local 68 if (fd < 0) { in GetTransferContents() 72 bool rc = Updater::Utils::ReadFileToString(fd, contents); in GetTransferContents() 73 close(fd); in GetTransferContents() 77 bool AllCmdUnitTest::WriteTestBin(int fd, const uint8_t &data, size_t size) const in WriteTestBin() argument 86 written = write(fd, p, count); in WriteTestBin() 107 int fd = open(filename, O_RDWR); variable 108 if (fd == -1) { [all …]
|
/base/startup/init/services/begetctl/ |
D | misc_daemon.cpp | 40 static void ClearLogo(int fd) in ClearLogo() argument 42 if (fd < 0) { in ClearLogo() 47 if (lseek(fd, addrOffset * BLOCK_SZIE_1, SEEK_SET) < 0) { in ClearLogo() 51 if (write(fd, &buffer, sizeof(buffer)) != sizeof(buffer)) { in ClearLogo() 57 static void WriteLogoContent(int fd, const std::string &logoPath, uint32_t size) in WriteLogoContent() argument 79 ssize_t ret = write(fd, buffer, size); in WriteLogoContent() 89 static int WriteLogo(int fd, const std::string &logoPath) in WriteLogo() argument 92 if (lseek(fd, addrOffset * BLOCK_SZIE_1, SEEK_SET) < 0) { in WriteLogo() 98 if (read(fd, &magic, sizeof(uint32_t)) != sizeof(uint32_t)) { in WriteLogo() 110 lseek(fd, addrOffset * BLOCK_SZIE_1, SEEK_SET); in WriteLogo() [all …]
|
/base/sensors/sensor/services/sensor/src/ |
D | sensor_dump.cpp | 98 void SensorDump::ParseCommand(int32_t fd, const std::vector<std::string> &args, const std::vector<S… in ParseCommand() argument 114 dprintf(fd, "cmd param number not more than 32\n"); in ParseCommand() 149 DumpSensorChannel(fd, clientInfo); in ParseCommand() 153 DumpSensorData(fd, clientInfo); in ParseCommand() 157 DumpOpeningSensor(fd, sensors, clientInfo); in ParseCommand() 161 DumpHelp(fd); in ParseCommand() 165 DumpSensorList(fd, sensors); in ParseCommand() 169 …dprintf(fd, "Unrecognized option: %s\nMore info with: \"hidumper -s 3601 -a -h\"\n", argv[optind-1… in ParseCommand() 181 void SensorDump::DumpHelp(int32_t fd) in DumpHelp() argument 183 dprintf(fd, "Usage:\n"); in DumpHelp() [all …]
|
/base/hiviewdfx/hiview/plugins/eventlogger/log_catcher/test/unittest/common/ |
D | event_logger_catcher_test.cpp | 90 int EventloggerCatcherTest::GetFdSize(int32_t fd) in GetFdSize() argument 93 if (fstat(fd, &fileStat) == -1) { in GetFdSize() 156 auto fd = open(logPath.c_str(), O_CREAT | O_WRONLY | O_TRUNC, defaultLogFileMode); in StartCreate() local 157 if (fd < 0) { in StartCreate() 158 printf("Fail to create %s. fd == %d\n", logFile_.c_str(), fd); in StartCreate() 162 auto logTask = std::make_unique<EventLogTask>(fd, event); in StartCreate() 167 close(fd); in StartCreate() 170 close(fd); in StartCreate() 200 auto fd = JudgmentsFileSize(minQuantity, "EventloggerCatcherTest001"); variable 201 if (fd < 0) { [all …]
|
/base/startup/syspara_lite/frameworks/parameter/src/param_impl_hal/ |
D | param_impl_hal.c | 64 int fd = UtilsFileOpen(key, O_RDONLY_FS, 0); in GetSysParam() local 65 if (fd < 0) { in GetSysParam() 69 int ret = UtilsFileRead(fd, value, valueLen); in GetSysParam() 70 UtilsFileClose(fd); in GetSysParam() 71 fd = -1; in GetSysParam() 84 int fd = UtilsFileOpen(key, O_RDWR_FS | O_CREAT_FS | O_TRUNC_FS, 0); in SetSysParam() local 85 if (fd < 0) { in SetSysParam() 89 int ret = UtilsFileWrite(fd, value, strlen(value)); in SetSysParam() 90 UtilsFileClose(fd); in SetSysParam() 91 fd = -1; in SetSysParam()
|
/base/startup/init/interfaces/innerkits/fs_manager/libfs_hvb/ |
D | hvb_ops.c | 34 static int64_t GetImageSizeForHVB(const int fd, const char* image) in GetImageSizeForHVB() argument 36 if (fd < 0) { in GetImageSizeForHVB() 41 return lseek64(fd, 0, SEEK_END); in GetImageSizeForHVB() 50 int fd = -1; in HvbReadFromPartition() local 80 fd = open(path, O_RDONLY | O_CLOEXEC); in HvbReadFromPartition() 81 if (fd < 0) { in HvbReadFromPartition() 83 fd = open("/dev/block/by-name/rvt_system", O_RDONLY | O_CLOEXEC); in HvbReadFromPartition() 85 fd, errno); in HvbReadFromPartition() 86 if (fd >= 0) { in HvbReadFromPartition() 87 close(fd); in HvbReadFromPartition() [all …]
|
/base/startup/init/interfaces/innerkits/socket/ |
D | init_socket.c | 34 int fd = strtol(val, NULL, N_DEC); in GetControlFromEnv() local 36 BEGET_ERROR_CHECK(fcntl(fd, F_GETFD) >= 0, return -1, "Failed fcntl err=%d ", errno); in GetControlFromEnv() 37 return fd; in GetControlFromEnv() 46 int fd = GetControlFromEnv(path, MAX_SOCKET_ENV_PREFIX_LEN); in GetControlSocket() local 47 BEGET_ERROR_CHECK(fd >= 0, return -1, "Get control fd from environment failed"); in GetControlSocket() 50 int ret = getsockopt(fd, SOL_SOCKET, SO_DOMAIN, &addrFamily, &afLen); in GetControlSocket() 53 return fd; in GetControlSocket() 57 ret = getsockname(fd, (struct sockaddr*)&addr, &addrlen); in GetControlSocket() 64 return fd; in GetControlSocket()
|