Home
last modified time | relevance | path

Searched refs:pid (Results 1 – 25 of 267) sorted by relevance

1234567891011

/system/core/libunwindstack/tests/
DMemoryRemoteTest.cpp44 static bool Attach(pid_t pid) { in Attach() argument
45 if (ptrace(PTRACE_ATTACH, pid, 0, 0) == -1) { in Attach()
51 while (TEMP_FAILURE_RETRY(ptrace(PTRACE_GETSIGINFO, pid, 0, &si)) < 0 && errno == ESRCH) { in Attach()
53 printf("%d: Failed to stop after 10 seconds.\n", pid); in Attach()
61 static bool Detach(pid_t pid) { in Detach() argument
62 return ptrace(PTRACE_DETACH, pid, 0, 0) == 0; in Detach()
72 pid_t pid; in TEST_F() local
73 if ((pid = fork()) == 0) { in TEST_F()
77 ASSERT_LT(0, pid); in TEST_F()
79 ASSERT_TRUE(Attach(pid)); in TEST_F()
[all …]
/system/extras/ioshark/
Dcompile-only.sh39 awk -v pid=$i '{ if (pid == $7) print $0}' foo > fstrace.$i
61 pid=${stracefile##*.}
62 process_strace $stracefile foo.$pid
63 if ! [ -s foo.$pid ]; then
64 rm foo.$pid
72 if [ -f fstrace.$pid ]; then
73 fgrep mmap foo.$pid > bar
83 grep -w $j fstrace.$pid > foobar
85 sort foo.$pid foobar >> footemp
91 mv footemp parsed_input_trace.$pid
[all …]
Dcollect-straces-ftraces.sh41 awk -v pid=$i '{ if (pid == $7) print $0}' foo > fstrace.$i
63 pid=${stracefile##*.}
64 process_strace $stracefile foo.$pid
65 if ! [ -s foo.$pid ]; then
66 rm foo.$pid
74 if [ -f fstrace.$pid ]; then
75 fgrep mmap foo.$pid > bar
85 grep -w $j fstrace.$pid > foobar
87 sort foo.$pid foobar >> footemp
93 mv footemp parsed_input_trace.$pid
[all …]
/system/vold/
DProcess.cpp66 void Process::getProcessName(int pid, char *buffer, size_t max) { in getProcessName() argument
68 snprintf(buffer, max, "/proc/%d/cmdline", pid); in getProcessName()
79 int Process::checkFileDescriptorSymLinks(int pid, const char *mountPoint) { in checkFileDescriptorSymLinks() argument
80 return checkFileDescriptorSymLinks(pid, mountPoint, NULL, 0); in checkFileDescriptorSymLinks()
83 int Process::checkFileDescriptorSymLinks(int pid, const char *mountPoint, char *openFilename, size_… in checkFileDescriptorSymLinks() argument
88 snprintf(path, sizeof(path), "/proc/%d/fd", pid); in checkFileDescriptorSymLinks()
124 int Process::checkFileMaps(int pid, const char *mountPoint) { in checkFileMaps() argument
125 return checkFileMaps(pid, mountPoint, NULL, 0); in checkFileMaps()
128 int Process::checkFileMaps(int pid, const char *mountPoint, char *openFilename, size_t max) { in checkFileMaps() argument
132 snprintf(buffer, sizeof(buffer), "/proc/%d/maps", pid); in checkFileMaps()
[all …]
DProcess.h26 static int checkSymLink(int pid, const char *path, const char *name);
27 static int checkFileMaps(int pid, const char *path);
28 static int checkFileMaps(int pid, const char *path, char *openFilename, size_t max);
29 static int checkFileDescriptorSymLinks(int pid, const char *mountPoint);
30 …static int checkFileDescriptorSymLinks(int pid, const char *mountPoint, char *openFilename, size_t…
31 static void getProcessName(int pid, char *buffer, size_t max);
/system/netd/server/
DClatdController.cpp55 pid_t pid = getClatdPid(interface); in startClatd() local
57 if (pid != 0) { in startClatd()
58 ALOGE("clatd pid=%d already started on %s", pid, interface); in startClatd()
88 if ((pid = fork()) < 0) { in startClatd()
93 if (!pid) { in startClatd()
112 mClatdPids[interface] = pid; in startClatd()
120 pid_t pid = getClatdPid(interface); in stopClatd() local
122 if (pid == 0) { in stopClatd()
127 ALOGD("Stopping clatd pid=%d on %s", pid, interface); in stopClatd()
129 kill(pid, SIGTERM); in stopClatd()
[all …]
DIptablesRestoreController.cpp43 IptablesProcess(pid_t pid, int stdIn, int stdOut, int stdErr) : in IptablesProcess() argument
44 pid(pid), in IptablesProcess()
75 int err = kill(pid, SIGTERM); in stop()
84 ALOGE("iptables child process %d unexpectedly disappeared", pid); in stop()
90 ALOGE("Error killing iptables child process %d: %s", pid, strerror(err)); in stop()
94 if (waitpid(pid, &status, 0) == -1) { in stop()
95 ALOGE("Error waiting for iptables child process %d: %s", pid, strerror(errno)); in stop()
97 ALOGW("iptables-restore process %d terminated status=%d", pid, status); in stop()
103 const pid_t pid; member in IptablesProcess
334 ALOGE("Timed out waiting for response from iptables process %d", process->pid); in drainAndWaitForAck()
[all …]
/system/core/logd/
DLogStatistics.h76 std::unique_ptr<const TEntry* []> sort(uid_t uid, pid_t pid, in sort() argument
92 if (pid && entry.getPid() && (pid != entry.getPid())) { in sort()
161 std::string format(const LogStatistics& stat, uid_t uid, pid_t pid,
167 sort(uid, pid, maximum_sorted_entries);
266 pid_t pid; member
271 pid(element->getPid()) { in UidEntry()
281 return pid; in getPid()
285 if (pid != element->getPid()) { in add()
286 pid = -1; in add()
296 uid_t pidToUid(pid_t pid);
[all …]
DLogWhiteBlackList.cpp26 Prune::Prune(uid_t uid, pid_t pid) : mUid(uid), mPid(pid) { in Prune() argument
29 int Prune::cmp(uid_t uid, pid_t pid) const { in cmp()
34 return pid - mPid; in cmp()
165 pid_t pid = Prune::pid_all; in init() local
169 pid = 0; in init()
171 pid = pid * 10 + *str++ - '0'; in init()
176 if ((uid == Prune::uid_all) && (pid == Prune::pid_all)) { in init()
193 if ((pid == p.pid_all) && (p.mPid != p.pid_all)) { in init()
197 m = pid - p.mPid; in init()
201 list->insert(it, Prune(uid, pid)); in init()
[all …]
/system/core/libbacktrace/
Dbacktrace_test.cpp103 static void WaitForStop(pid_t pid) { in WaitForStop() argument
107 while (ptrace(PTRACE_GETSIGINFO, pid, 0, &si) < 0 && (errno == EINTR || errno == ESRCH)) { in WaitForStop()
116 static void CreateRemoteProcess(pid_t* pid) { in CreateRemoteProcess() argument
117 if ((*pid = fork()) == 0) { in CreateRemoteProcess()
122 ASSERT_NE(-1, *pid); in CreateRemoteProcess()
124 ASSERT_TRUE(ptrace(PTRACE_ATTACH, *pid, 0, 0) == 0); in CreateRemoteProcess()
127 WaitForStop(*pid); in CreateRemoteProcess()
130 static void FinishRemoteProcess(pid_t pid) { in FinishRemoteProcess() argument
131 ASSERT_TRUE(ptrace(PTRACE_DETACH, pid, 0, 0) == 0); in FinishRemoteProcess()
133 kill(pid, SIGKILL); in FinishRemoteProcess()
[all …]
DBacktrace.cpp40 Backtrace::Backtrace(pid_t pid, pid_t tid, BacktraceMap* map) in Backtrace() argument
41 : pid_(pid), tid_(tid), map_(map), map_shared_(true) { in Backtrace()
43 map_ = BacktraceMap::Create(pid); in Backtrace()
128 Backtrace* Backtrace::Create(pid_t pid, pid_t tid, BacktraceMap* map) { in Create() argument
129 if (pid == BACKTRACE_CURRENT_PROCESS) { in Create()
130 pid = getpid(); in Create()
135 tid = pid; in Create()
138 if (pid == getpid()) { in Create()
139 return new UnwindCurrent(pid, tid, map); in Create()
141 return new UnwindPtrace(pid, tid, map); in Create()
DUnwindMap.cpp36 UnwindMap::UnwindMap(pid_t pid) : BacktraceMap(pid) { in UnwindMap() argument
40 UnwindMapRemote::UnwindMapRemote(pid_t pid) : UnwindMap(pid) { in UnwindMapRemote() argument
153 BacktraceMap* BacktraceMap::Create(pid_t pid, bool uncached) { in Create() argument
158 map = new BacktraceMap(pid); in Create()
159 } else if (pid == getpid()) { in Create()
162 map = new UnwindMapRemote(pid); in Create()
/system/core/debuggerd/libdebuggerd/
Dbacktrace.cpp41 static void dump_process_header(log_t* log, pid_t pid, const char* process_name) { in dump_process_header() argument
47 _LOG(log, logtype::BACKTRACE, "\n\n----- pid %d at %s -----\n", pid, timestr); in dump_process_header()
55 static void dump_process_footer(log_t* log, pid_t pid) { in dump_process_footer() argument
56 _LOG(log, logtype::BACKTRACE, "\n----- end %d -----\n", pid); in dump_process_footer()
63 static void dump_thread(log_t* log, BacktraceMap* map, pid_t pid, pid_t tid, in dump_thread() argument
67 std::unique_ptr<Backtrace> backtrace(Backtrace::Create(pid, tid, map)); in dump_thread()
76 void dump_backtrace(int fd, BacktraceMap* map, pid_t pid, pid_t tid, const std::string& process_nam… in dump_backtrace() argument
82 dump_process_header(&log, pid, process_name.c_str()); in dump_backtrace()
83 dump_thread(&log, map, pid, tid, threads.find(tid)->second.c_str()); in dump_backtrace()
89 dump_thread(&log, map, pid, thread_tid, thread_name.c_str()); in dump_backtrace()
[all …]
/system/hwservicemanager/
DAccessControl.cpp15 pid_t pid; member
37 bool AccessControl::canAdd(const std::string& fqName, pid_t pid) { in canAdd() argument
45 return checkPermission(pid, kPermissionAdd, checkName.c_str()); in canAdd()
48 bool AccessControl::canGet(const std::string& fqName, pid_t pid) { in canGet() argument
56 return checkPermission(pid, kPermissionGet, checkName.c_str()); in canGet()
59 bool AccessControl::canList(pid_t pid) { in canList() argument
60 return checkPermission(pid, mSeContext, kPermissionList, nullptr); in canList()
74 ad.pid = sourcePid; in checkPermission()
110 snprintf(buf, len, "interface=%s pid=%d", ad->interfaceName, ad->pid); in auditCallback()
DServiceManager.cpp152 pid_t pid = IPCThreadState::self()->getCallingPid(); in get() local
153 if (!mAcl.canGet(fqName, pid)) { in get()
181 pid_t pid = IPCThreadState::self()->getCallingPid(); in add() local
192 if (!mAcl.canAdd(fqName, pid)) { in add()
205 std::make_unique<HidlService>(fqName, name, service, pid)); in add()
211 hidlService->setService(service, pid); in add()
235 pid_t pid = IPCThreadState::self()->getCallingPid(); in getTransport() local
236 if (!mAcl.canGet(fqName, pid)) { in getTransport()
252 pid_t pid = IPCThreadState::self()->getCallingPid(); in list() local
253 if (!mAcl.canList(pid)) { in list()
[all …]
/system/core/libprocessgroup/
Dprocessgroup.cpp98 static int convertUidPidToPath(char *path, size_t size, uid_t uid, int pid) in convertUidPidToPath() argument
105 pid); in convertUidPidToPath()
108 static int initCtx(uid_t uid, int pid, struct ctx *ctx) in initCtx() argument
112 convertUidPidToPath(path, sizeof(path), uid, pid); in initCtx()
177 long pid = strtol(ctx->buf_ptr, &pid_eptr, 10); in getOneAppProcess() local
188 return (pid_t)pid; in getOneAppProcess()
191 static int removeProcessGroup(uid_t uid, int pid) in removeProcessGroup() argument
196 convertUidPidToPath(path, sizeof(path), uid, pid); in removeProcessGroup()
258 pid_t pid; in doKillProcessGroupOnce() local
262 while ((pid = getOneAppProcess(uid, initialPid, &ctx)) >= 0) { in doKillProcessGroupOnce()
[all …]
/system/extras/tests/kernel.config/
Dsysvipc_test.cpp33 pid_t pid = getpid(); in TEST() local
34 int ret = kcmp(pid, pid, KCMP_SYSVSEM, 0, 0); in TEST()
36 EXPECT_EQ(-1, kcmp(pid, pid, KCMP_SYSVSEM, 0, 0)); in TEST()
/system/core/fs_mgr/
Dfs_mgr_format.cpp90 int pid; in format_f2fs() local
97 pid = fork(); in format_f2fs()
98 if (pid < 0) { in format_f2fs()
99 return pid; in format_f2fs()
101 if (!pid) { in format_f2fs()
107 pid_t p = waitpid(pid, &rc, 0); in format_f2fs()
108 if (p != pid) { in format_f2fs()
/system/core/lmkd/
Dlmkd.c103 int pid; member
147 static struct proc *pid_lookup(int pid) { in pid_lookup() argument
150 for (procp = pidhash[pid_hashfn(pid)]; procp && procp->pid != pid; in pid_lookup()
191 int hval = pid_hashfn(procp->pid); in proc_insert()
198 static int pid_remove(int pid) { in pid_remove() argument
199 int hval = pid_hashfn(pid); in pid_remove()
203 for (procp = pidhash[hval], prevp = NULL; procp && procp->pid != pid; in pid_remove()
240 static void cmd_procprio(int pid, int uid, int oomadj) { in cmd_procprio() argument
250 snprintf(path, sizeof(path), "/proc/%d/oom_score_adj", pid); in cmd_procprio()
257 procp = pid_lookup(pid); in cmd_procprio()
[all …]
/system/extras/perfprofd/quipper/
Dperf_parser.cc192 << " -> " << event.fork.pid << ":" << event.fork.tid; in ProcessEvents()
202 VLOG(1) << "COMM: " << event.comm.pid << ":" << event.comm.tid << ": " in ProcessEvents()
207 pidtid_to_comm_map_[std::make_pair(event.comm.pid, event.comm.tid)] = in ProcessEvents()
263 PidTid pidtid = std::make_pair(sample_info.pid, sample_info.tid); in MapSampleEvent()
273 sample_info.pid, in MapSampleEvent()
281 sample_info.pid, in MapSampleEvent()
289 !MapBranchStack(sample_info.pid, in MapSampleEvent()
309 const uint32_t pid, in MapCallchain() argument
340 pid, in MapCallchain()
353 bool PerfParser::MapBranchStack(const uint32_t pid, in MapBranchStack() argument
[all …]
/system/core/debuggerd/tombstoned/
Dintercept_manager.cpp106 if (intercept_request.pid <= 0 || intercept_request.pid > std::numeric_limits<pid_t>::max()) { in intercept_request_cb()
110 intercept_request.pid); in intercept_request_cb()
115 intercept->intercept_pid = intercept_request.pid; in intercept_request_cb()
118 if (intercept_manager->intercepts.count(intercept_request.pid) > 0) { in intercept_request_cb()
122 "pid %" PRId32 " already intercepted", intercept_request.pid); in intercept_request_cb()
138 intercept_manager->intercepts[intercept_request.pid] = std::unique_ptr<Intercept>(intercept); in intercept_request_cb()
141 LOG(INFO) << "tombstoned registered intercept for pid " << intercept_request.pid; in intercept_request_cb()
177 bool InterceptManager::GetIntercept(pid_t pid, android::base::unique_fd* out_fd) { in GetIntercept() argument
178 auto it = this->intercepts.find(pid); in GetIntercept()
186 LOG(INFO) << "found intercept fd " << intercept->output_fd.get() << " for pid " << pid; in GetIntercept()
/system/extras/latencytop/
Dlatencytop.c45 static struct latency_entry *read_process_stats(struct latency_entry *list, int erase, int pid);
46 static struct latency_entry *read_thread_stats(struct latency_entry *list, int erase, int pid, int …
72 int pid, tid; in main() local
78 pid = tid = 0; in main()
106 pid = atoi(argv[++i]); in main()
122 if (tid && !pid) { in main()
146 if (pid) { in main()
148 e = read_thread_stats(e, erase, pid, tid, 1); in main()
150 e = read_process_stats(e, erase, pid); in main()
158 if (pid) { in main()
[all …]
/system/extras/simpleperf/
Dthread_tree.cpp48 void ThreadTree::SetThreadName(int pid, int tid, const std::string& comm) { in SetThreadName() argument
49 ThreadEntry* thread = FindThreadOrNew(pid, tid); in SetThreadName()
57 void ThreadTree::ForkThread(int pid, int tid, int ppid, int ptid) { in ForkThread() argument
59 ThreadEntry* child = FindThreadOrNew(pid, tid); in ForkThread()
61 if (pid != ppid) { in ForkThread()
67 ThreadEntry* ThreadTree::FindThreadOrNew(int pid, int tid) { in FindThreadOrNew() argument
70 return CreateThread(pid, tid); in FindThreadOrNew()
72 if (pid != it->second.get()->pid) { in FindThreadOrNew()
75 << it->second.get()->pid << ", " << tid << "), actual (" << pid in FindThreadOrNew()
82 ThreadEntry* ThreadTree::CreateThread(int pid, int tid) { in CreateThread() argument
[all …]
/system/core/libmemtrack/
Dmemtrack_test.c28 static int getprocname(pid_t pid, char *buf, int len) { in getprocname() argument
38 if (asprintf(&filename, "/proc/%d/cmdline", pid) < 0) { in getprocname()
105 pid_t pid = pids[i]; in main() local
114 getprocname(pid, cmdline, (int)sizeof(cmdline)); in main()
116 ret = memtrack_proc_get(p, pid); in main()
119 pid, strerror(-ret), ret); in main()
131 printf("%5d %6zu %6zu %6zu %6zu %6zu %6zu %s\n", pid, in main()
/system/core/libcutils/
Diosched_policy.c35 int android_set_ioprio(int pid __android_unused, IoSchedClass clazz __android_unused, int ioprio __… in android_set_ioprio()
37 if (syscall(SYS_ioprio_set, IOPRIO_WHO_PROCESS, pid, ioprio | (clazz << IOPRIO_CLASS_SHIFT))) { in android_set_ioprio()
44 int android_get_ioprio(int pid __android_unused, IoSchedClass *clazz, int *ioprio) { in android_get_ioprio()
48 if ((rc = syscall(SYS_ioprio_get, IOPRIO_WHO_PROCESS, pid)) < 0) { in android_get_ioprio()

1234567891011