Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 188) sorted by relevance

12345678

/developtools/profiler/hiebpf/include/
Dfstrace_progs.h62 int BPF_KPROBE(ksys_read_entry, unsigned int fd, char __user* buf, size_t count) in BPF_KPROBE() argument
77 args->fd = fd; in BPF_KPROBE()
101 int BPF_KPROBE(ksys_write_entry, unsigned int fd, const char __user* buf, size_t count) in BPF_KPROBE() argument
116 args->fd = fd; in BPF_KPROBE()
140 int BPF_KPROBE(ksys_pread64_entry, unsigned int fd, char __user* buf, size_t count, loff_t pos) in BPF_KPROBE() argument
155 args->fd = fd; in BPF_KPROBE()
180 int BPF_KPROBE(ksys_pwrite64_entry, unsigned int fd, const char __user* buf, size_t count, loff_t p… in BPF_KPROBE() argument
195 args->fd = fd; in BPF_KPROBE()
220 int BPF_KPROBE(do_readv_entry, unsigned long fd, const struct iovec __user* vec, unsigned long vlen… in BPF_KPROBE() argument
235 args->fd = fd; in BPF_KPROBE()
[all …]
Dfstrace_types.h30 unsigned int fd; member
36 unsigned int fd; member
42 unsigned int fd; member
49 unsigned int fd; member
56 unsigned long fd; member
63 unsigned long fd; member
70 unsigned long fd; member
78 unsigned long fd; member
87 unsigned fd; member
/developtools/hdc/hdc_rust/src/cffi/
Dmount.cpp26 int fd; in FindMountDeviceByPath() local
32 fd = open("/proc/mounts", O_RDONLY | O_CLOEXEC); in FindMountDeviceByPath()
33 if (fd < 0) { in FindMountDeviceByPath()
36 read(fd, buf, sizeof(buf) - 1); in FindMountDeviceByPath()
37 close(fd); in FindMountDeviceByPath()
61 int fd; in RemountPartition() local
69 if ((fd = open(dev, O_RDONLY | O_CLOEXEC)) < 0) { in RemountPartition()
72 ioctl(fd, BLKROSET, &off); in RemountPartition()
73 close(fd); in RemountPartition()
Duart_wrapper.cpp37 extern "C" int32_t SetSerialExt(int32_t fd, int32_t nSpeed, int32_t nBits, uint8_t nEvent, int32_t … in SetSerialExt() argument
39 return static_cast<int32_t>(SetSerial(static_cast<int>(fd), static_cast<int>(nSpeed), in SetSerialExt()
44 extern "C" SerializedBuffer ReadUartDevExt(int32_t fd, uint32_t expectedSize) in ReadUartDevExt() argument
49 length = ReadUartDev(static_cast<int>(fd), readBuf, static_cast<size_t>(expectedSize)); in ReadUartDevExt()
60 extern "C" int32_t WriteUartDevExt(int32_t fd, SerializedBuffer buf) in WriteUartDevExt() argument
62 …return static_cast<int32_t>(WriteUartDev(static_cast<int>(fd), reinterpret_cast<uint8_t *>(buf.ptr… in WriteUartDevExt()
66 extern "C" uint8_t CloseSerialPortExt(int32_t fd) in CloseSerialPortExt() argument
68 return static_cast<uint8_t>(CloseSerialPort(fd)); in CloseSerialPortExt()
Doh_usb.cpp79 int OpenEpPoint(int &fd, const std::string path) in OpenEpPoint() argument
81 if ((fd = open(path.c_str(), O_RDWR)) < 0) { in OpenEpPoint()
85 fcntl(fd, F_SETFD, FD_CLOEXEC); in OpenEpPoint()
89 int CloseUsbFd(int &fd) in CloseUsbFd() argument
93 printf("CloseFd fd:%d\n", fd); in CloseUsbFd()
95 if (fd > 0) { in CloseUsbFd()
96 rc = close(fd); in CloseUsbFd()
106 fd = -1; in CloseUsbFd()
Dusb_wrapper.cpp37 int fd = -1; in OpenEpPointEx() local
38 if (OpenEpPoint(fd, std::string(path)) != 0) { in OpenEpPointEx()
42 return static_cast<int32_t>(fd); in OpenEpPointEx()
45 extern "C" int32_t CloseUsbFdEx(int32_t fd) in CloseUsbFdEx() argument
47 return static_cast<int32_t>(CloseUsbFd(fd)); in CloseUsbFdEx()
/developtools/hdc/hdc_rust/src/transfer/
Duart.rs42 fn SetSerialExt(fd: i32, speed: i32, bits: i32, event: u8, stop: i32) -> i32; in SetSerialExt()
43 fn ReadUartDevExt(fd: i32, size: i32) -> SerializedBuffer; in ReadUartDevExt()
44 fn WriteUartDevExt(fd: i32, buf: SerializedBuffer) -> i32; in WriteUartDevExt()
45 fn CloseSerialPortExt(fd: i32) -> u8; in CloseSerialPortExt()
50 let fd = unsafe { in uart_init() localVariable
54 let fd = OpenSerialPortExt(name.as_ptr()); in uart_init() localVariable
55 if fd < 0 { in uart_init()
59 fd, in uart_init()
69 fd in uart_init()
71 Ok(fd) in uart_init()
[all …]
/developtools/profiler/hiebpf/data/
Dfstrace_target_funcs.txt2 ksys_read(read, unsigned int, fd, char __user*, buf, size_t, count)
3 ksys_write(write, unsigned int, fd, const char __user*, buf, size_t, count)
4 ksys_pread64(pread64, unsigned int, fd, char __user*, buf, size_t, count, loff_t, pos)
5 ksys_pwrite64(pwrite64, unsigned int, fd, const char __user*, buf, size_t, count, loff_t, pos)
6 "do_readv(readv, unsigned long, fd, const struct iovec __user*, vec,
8 "do_writev(writev, unsigned long, fd, const struct iovec __user*, vec,
10 "do_preadv(preadv, unsigned long, fd, const struct iovec __user*, vec,
12 "do_pwritev(pwritev, unsigned long, fd, const struct iovec __user*, vec,
14 __close_fd(close, struct files_struct*, files, unsigned, fd)
/developtools/profiler/device/base/src/
Depoll_event_poller.cpp43 bool EpollEventPoller::AddFileDescriptor(int fd, in AddFileDescriptor() argument
49 ctx->fd = fd; in AddFileDescriptor()
54 CHECK_TRUE(AddContextLocked(ctx), false, "add context for %d failed!", fd); in AddFileDescriptor()
58 bool EpollEventPoller::RemoveFileDescriptor(int fd) in RemoveFileDescriptor() argument
61 auto it = context_.find(fd); in RemoveFileDescriptor()
62 CHECK_TRUE(it != context_.end(), false, "fd %d not found in poll set!", fd); in RemoveFileDescriptor()
66 CHECK_TRUE(RemoveContextLocked(ctx), false, "remove context for %d failed!", fd); in RemoveFileDescriptor()
72 context_[ctx->fd] = ctx; in AddContextLocked()
78 context_.erase(ctx->fd); in RemoveContextLocked()
79 CHECK_TRUE(UpdateEvent(EPOLL_CTL_DEL, ctx), false, "update fd %d ctx FAILED!", ctx->fd); in RemoveContextLocked()
[all …]
Devent_notifier.cpp34 EventNotifierPtr EventNotifier::CreateWithFd(int fd) in CreateWithFd() argument
36 return std::make_shared<EventNotifier>(fd); in CreateWithFd()
52 EventNotifier::EventNotifier(int fd) : fd_(fd), flags_(0) in EventNotifier() argument
55 CHECK_TRUE(flags >= 0, NO_RETVAL, "get flags of fd %d FAILED, %d", fd, errno); in EventNotifier()
Dschedule_task_manager.cpp98 evt.data.fd = timerFd; in ScheduleTask()
137 if (events[i].data.fd == stopFd_) { in ScheduleThread()
141 int32_t ret = read(events[i].data.fd, &exp, sizeof(uint64_t)); in ScheduleThread()
144 if (tasks_.find(events[i].data.fd) != tasks_.end()) { in ScheduleThread()
145 tasks_[events[i].data.fd](); in ScheduleThread()
153 void ScheduleTaskManager::HandleSingleTask(int32_t fd, std::function<void(void)> callback) in HandleSingleTask() argument
156 UnscheduleTaskLockless(fd); in HandleSingleTask()
164 evt.data.fd = stopFd_; in StartThread()
/developtools/smartperf_host/trace_streamer/test/unittest/pbreader/
Dparser_pbreader_test.cpp54 int32_t fd(base::OpenFile(tracePath, O_RDONLY, G_FILE_PERMISSION));
57 auto rsize = base::Read(fd, buf.get(), readSize);
71 close(fd);
97 int32_t fd(base::OpenFile(tracePath, O_RDONLY, G_FILE_PERMISSION));
100 auto rsize = base::Read(fd, buf.get(), readSize);
113 close(fd);
139 int32_t fd(base::OpenFile(tracePath, O_RDONLY, G_FILE_PERMISSION));
142 auto rsize = base::Read(fd, buf.get(), readSize);
156 close(fd);
182 int32_t fd(base::OpenFile(tracePath, O_RDONLY, G_FILE_PERMISSION));
[all …]
/developtools/smartperf_host/trace_streamer/src/base/
Dfile.cpp43 ssize_t Read(int32_t fd, uint8_t* dst, size_t dstSize) in Read() argument
46 return _read(fd, dst, static_cast<unsigned>(dstSize)); in Read()
50 ret = read(fd, dst, dstSize); in Read()
59 int32_t fd(_open(path.c_str(), flags | O_BINARY, mode)); in OpenFile() local
61 int32_t fd(open(path.c_str(), flags | O_CLOEXEC, mode)); in OpenFile() local
63 return fd; in OpenFile()
/developtools/profiler/device/plugins/ftrace_plugin/src/
Dfile_utils.cpp31 std::string FileUtils::ReadFile(int fd) in ReadFile() argument
39 ssize_t nBytes = TEMP_FAILURE_RETRY(read(fd, &content[count], content.size() - count)); in ReadFile()
57 int fd = open(realPath, O_RDONLY); in ReadFile() local
58 if (fd == -1) { in ReadFile()
65 std::string content = ReadFile(fd); in ReadFile()
66 CHECK_TRUE(close(fd) != -1, content, "close %s failed, %d", path.c_str(), errno); in ReadFile()
98 int fd = open(path.c_str(), flags, mode); in WriteFile() local
99 CHECK_TRUE(fd >= 0, -1, "open %s failed, %d", path.c_str(), errno); in WriteFile()
101 int retval = write(fd, content.data(), content.size()); in WriteFile()
102 CHECK_TRUE(close(fd) != -1, -1, "close %s failed, %d", path.c_str(), errno); in WriteFile()
/developtools/profiler/device/plugins/api/test/unittest/
Dbuffer_write_test.cpp38 int fd = syscall(SYS_memfd_create, SMB1_NAME.c_str(), 0); in InitShareMemory1() local
39 CHECK_TRUE(fd >= 0, -1, "CreateBlock FAIL SYS_memfd_create"); in InitShareMemory1()
41 int check = ftruncate(fd, SMB1_SIZE); in InitShareMemory1()
43 close(fd); in InitShareMemory1()
51 g_smbAddr1 = mmap(nullptr, SMB1_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); in InitShareMemory1()
53 close(fd); in InitShareMemory1()
70 return fd; in InitShareMemory1()
75 int fd = syscall(SYS_memfd_create, SMB2_NAME.c_str(), 0); in InitShareMemory2() local
76 CHECK_TRUE(fd >= 0, -1, "CreateBlock FAIL SYS_memfd_create"); in InitShareMemory2()
78 int check = ftruncate(fd, SMB2_SIZE); in InitShareMemory2()
[all …]
/developtools/profiler/device/plugins/native_daemon/native_memory_profiler_sa/include/
Dnative_memory_profiler_sa_service.h39 int32_t DumpData(uint32_t fd, std::shared_ptr<NativeMemoryProfilerSaConfig>& config) override;
43 int32_t StartHook(std::shared_ptr<NativeMemoryProfilerSaConfig>& config, uint32_t fd = 0);
45 bool CheckConfig(std::shared_ptr<NativeMemoryProfilerSaConfig>& config, uint32_t fd = 0);
53 const std::string& filePath, int32_t timerFd, bool startupMode, uint32_t fd = 0)
55 isStartupMode(startupMode), fd(fd) {} in hookMgr()
63 uint32_t fd{0};
/developtools/profiler/device/services/shared_memory/test/unittest/
Dshared_memory_allocator_test.cpp105 int fd = syscall(SYS_memfd_create, "testnameremote", 0); variable
106 EXPECT_GE(fd, 0);
107 int check = ftruncate(fd, 4096);
110 …ASSERT_TRUE(ShareMemoryAllocator::GetInstance().CreateMemoryBlockRemote("testnameremote", 0, fd) ==
114 …ASSERT_TRUE(ShareMemoryAllocator::GetInstance().CreateMemoryBlockRemote("testnameremote", 1, fd) ==
118 …RT_FALSE(ShareMemoryAllocator::GetInstance().CreateMemoryBlockRemote("testnameremote", 4096, fd) ==
120 …ERT_TRUE(ShareMemoryAllocator::GetInstance().CreateMemoryBlockRemote("testnameremote", 4096, fd) ==
/developtools/profiler/hiebpf/test/
Dhiebpf_test_demo.cpp72 int fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, FILE_MODE); in CallStack1() local
73 if (fd < 0) { in CallStack1()
82 write(fd, buf.data(), buf.size()); in CallStack1()
83 fsync(fd); in CallStack1()
88 lseek(fd, 0, SEEK_SET); in CallStack1()
89 read(fd, buf.data(), BUF_SIZE); in CallStack1()
90 read(fd, buf.data(), BUF_SIZE); in CallStack1()
95 close(fd); in CallStack1()
/developtools/profiler/hiebpf/src/
Dfstrace_args_converter.cpp34 args[ARGS_POINT_ZERO] = (__u64) startEvent->read_args.fd; in ReadArgsConverter()
43 args[ARGS_POINT_ZERO] = (__u64) startEvent->write_args.fd; in WriteArgsConverter()
52 args[ARGS_POINT_ZERO] = (__u64) startEvent->pread64_args.fd; in Pread64ArgsConverter()
61 args[ARGS_POINT_ZERO] = (__u64) startEvent->pwrite64_args.fd; in Pwrite64ArgsConverter()
70 args[ARGS_POINT_ZERO] = (__u64) startEvent->readv_args.fd; in ReadvArgsConverter()
79 args[ARGS_POINT_ZERO] = (__u64) startEvent->writev_args.fd; in WritevArgsConverter()
88 args[ARGS_POINT_ZERO] = (__u64) startEvent->preadv_args.fd; in PreadvArgsConverter()
97 args[ARGS_POINT_ZERO] = (__u64) startEvent->pwritev_args.fd; in PwritevArgsConverter()
107 args[ARGS_POINT_ONE] = (__u64) startEvent->close_args.fd; in CloseArgsConverter()
/developtools/hdc/hdc_rust/src/common/
Djdwp.rs74 pub async fn send_fd_to_target(&self, target_pid: u32, fd: i32, parameter: &str) -> bool { in send_fd_to_target()
82 let bytes = fd.to_be_bytes(); in send_fd_to_target()
87 let ret = send_msg(node.fd, fd, param_bytes); in send_fd_to_target()
156 fd: i32, in handle_client()
164 let size = UdsServer::wrap_recv(fd, &mut buffer); in handle_client()
181 let node = PollNode::new(fd, pid, pkg_name.clone(), debug_or_release); in handle_client()
186 UdsServer::wrap_close(value.fd); in handle_client()
191 map.insert(fd, node); in handle_client()
207 let fd = UdsServer::wrap_socket(SOCK_STREAM); in jdwp_listen() localVariable
214 let ret = UdsServer::wrap_bind(fd, addr_obj); in jdwp_listen()
[all …]
/developtools/profiler/hiebpf/test/unittest/
Dbpf_controller_test.cpp77 int fd = open(FILE_NAME.c_str(), O_RDWR | O_CREAT, FILE_MODE); variable
78 ASSERT_GT(fd, 0);
83 pwrite(fd, buf, sizeof(buf), offset);
84 fsync(fd);
85 pread(fd, buf, sizeof(buf), offset);
88 close(fd);
/developtools/hdc/src/daemon/
Djdwp.h31 bool SendJdwpNewFD(uint32_t targetPID, int fd);
32 bool SendArkNewFD(const std::string str, int fd);
34 bool SendFdToApp(int sockfd, uint8_t *buf, int size, int fd);
52 int fd; member
59 PollNode(int fd, uint32_t pid) in PollNode()
62 pollfd.fd = fd; in PollNode()
Djdwp.cpp105 pollNodeMap.erase(pair.second.pollfd.fd); in RemoveFdFromPollList()
161 int fd = -1; in ReadStream() local
162 if (uv_fileno(reinterpret_cast<uv_handle_t *>(&(ctxJdwp->pipe)), &fd) < 0) { in ReadStream()
166 thisClass->pollNodeMap.emplace(fd, PollNode(fd, pid)); in ReadStream()
269 if (handle->io_watcher.fd >= 0) { in UvPipeBind()
270 WRITE_LOG(LOG_FATAL, "socket already bound %d", handle->io_watcher.fd); in UvPipeBind()
306 handle->io_watcher.fd = sockfd; in UvPipeBind()
372 bool HdcJdwp::SendJdwpNewFD(uint32_t targetPID, int fd) in SendJdwpNewFD() argument
384 if (uv_tcp_open(&ctx->jvmTCP, fd)) { in SendJdwpNewFD()
396 WRITE_LOG(LOG_DEBUG, "SendJdwpNewFD successful targetPID:%d fd%d", targetPID, fd); in SendJdwpNewFD()
[all …]
/developtools/profiler/device/plugins/hidump_plugin/src/
Dhidump_plugin.cpp194 int fd[PIPE_LEN]; in CustomPopen() local
195 pipe(fd); in CustomPopen()
206 close(fd[READ]); in CustomPopen()
207 dup2(fd[WRITE], REDIRECT_STDOUT); // Redirect stdout to pipe in CustomPopen()
208 dup2(fd[WRITE], REDIRECT_STDERR); // Redirect stderr to pipe in CustomPopen()
210 close(fd[WRITE]); in CustomPopen()
211 dup2(fd[READ], 0); // Redirect stdin to pipe in CustomPopen()
220 close(fd[WRITE]); in CustomPopen()
223 close(fd[READ]); in CustomPopen()
230 return fdopen(fd[READ], "r"); in CustomPopen()
[all …]
/developtools/profiler/device/services/ipc/src/
Dunix_socket_server.cpp63 evt.data.fd = socketHandle_; in UnixSocketAccept()
79 clientEvt.data.fd = clientSocket; in UnixSocketAccept()
92 delEvt.data.fd = events[i].data.fd; in UnixSocketAccept()
94 epoll_ctl(epfd, EPOLL_CTL_DEL, events[i].data.fd, &delEvt); in UnixSocketAccept()
95 if (socketClients_.find(events[i].data.fd) != socketClients_.end()) { in UnixSocketAccept()
98 socketClients_.erase(events[i].data.fd); in UnixSocketAccept()
100 PROFILER_LOG_ERROR(LOG_CORE, "Client %d not exist", events[i].data.fd); in UnixSocketAccept()

12345678