Home
last modified time | relevance | path

Searched refs:tid (Results 1 – 25 of 96) sorted by relevance

1234

/system/core/libmemunreachable/
DThreadCapture.cpp79 bool ReleaseThread(pid_t tid);
83 int CaptureThread(pid_t tid);
84 bool ReleaseThread(pid_t tid, unsigned int signal);
85 int PtraceAttach(pid_t tid);
86 void PtraceDetach(pid_t tid, unsigned int signal);
87 bool PtraceThreadInfo(pid_t tid, ThreadInfo& thread_info);
136 pid_t tid = atoi(dirent->d_name); in ListThreads() local
137 if (tid <= 0) { in ListThreads()
140 tids.push_back(tid); in ListThreads()
177 void ThreadCaptureImpl::PtraceDetach(pid_t tid, unsigned int signal) { in PtraceDetach() argument
[all …]
/system/core/libcutils/
Dsched_policy.c74 static int add_tid_to_cgroup(int tid, int fd) in add_tid_to_cgroup() argument
87 while (tid > 0) { in add_tid_to_cgroup()
88 *--ptr = '0' + (tid % 10); in add_tid_to_cgroup()
89 tid = tid / 10; in add_tid_to_cgroup()
161 static int getCGroupSubsys(int tid, const char* subsys, char* buf, size_t bufLen) in getCGroupSubsys() argument
168 snprintf(pathBuf, sizeof(pathBuf), "/proc/%d/cgroup", tid); in getCGroupSubsys()
222 int get_sched_policy(int tid, SchedPolicy *policy) in get_sched_policy() argument
224 if (tid == 0) { in get_sched_policy()
225 tid = gettid(); in get_sched_policy()
232 if (getCGroupSubsys(tid, "cpuset", grpBuf, sizeof(grpBuf)) < 0) in get_sched_policy()
[all …]
Ddebugger.c45 static int make_dump_request(debugger_action_t action, pid_t tid, int timeout_secs) { in make_dump_request() argument
48 msg.tid = tid; in make_dump_request()
78 int dump_backtrace_to_file(pid_t tid, int fd) { in dump_backtrace_to_file() argument
79 return dump_backtrace_to_file_timeout(tid, fd, 0); in dump_backtrace_to_file()
82 int dump_backtrace_to_file_timeout(pid_t tid, int fd, int timeout_secs) { in dump_backtrace_to_file_timeout() argument
83 int sock_fd = make_dump_request(DEBUGGER_ACTION_DUMP_BACKTRACE, tid, timeout_secs); in dump_backtrace_to_file_timeout()
102 int dump_tombstone(pid_t tid, char* pathbuf, size_t pathlen) { in dump_tombstone() argument
103 return dump_tombstone_timeout(tid, pathbuf, pathlen, 0); in dump_tombstone()
106 int dump_tombstone_timeout(pid_t tid, char* pathbuf, size_t pathlen, int timeout_secs) { in dump_tombstone_timeout() argument
107 int sock_fd = make_dump_request(DEBUGGER_ACTION_DUMP_TOMBSTONE, tid, timeout_secs); in dump_tombstone_timeout()
/system/bt/utils/src/
Dbt_utils.c120 int tid = gettid(); in raise_priority_a2dp() local
134 rc = set_sched_policy(tid, SP_AUDIO_SYS); in raise_priority_a2dp()
138 g_TaskIDs[high_task] = tid; in raise_priority_a2dp()
142 LOG_WARN(LOG_TAG, "failed to change sched policy, tid %d, err: %d", tid, errno); in raise_priority_a2dp()
151 if (setpriority(PRIO_PROCESS, tid, priority) < 0) { in raise_priority_a2dp()
152 LOG_WARN(LOG_TAG, "failed to change priority tid: %d to %d", tid, priority); in raise_priority_a2dp()
169 int tid; in adjust_priority_a2dp() local
174 tid = g_TaskIDs[i]; in adjust_priority_a2dp()
175 if (tid != INVALID_TASK_ID) in adjust_priority_a2dp()
177 if (setpriority(PRIO_PROCESS, tid, priority) < 0) in adjust_priority_a2dp()
[all …]
/system/core/debuggerd/
Ddebuggerd.cpp71 pid_t pid, tid; member
88 request.pid, request.tid); in wait_for_user_action()
103 static int get_process_info(pid_t tid, pid_t* out_pid, uid_t* out_uid, uid_t* out_gid) { in get_process_info() argument
105 snprintf(path, sizeof(path), "/proc/%d/status", tid); in get_process_info()
173 if (getpidcon(request->tid, &tcon) < 0) { in selinux_action_allowed()
174 ALOGE("Cannot get context for tid %d\n", request->tid); in selinux_action_allowed()
221 out_request->tid = msg.tid; in read_request()
232 snprintf(buf, sizeof buf, "/proc/%d/task/%d", out_request->pid, out_request->tid); in read_request()
235 out_request->tid, out_request->pid); in read_request()
242 status = get_process_info(out_request->tid, &out_request->pid, in read_request()
[all …]
Dbacktrace.cpp71 static void dump_thread(log_t* log, BacktraceMap* map, pid_t pid, pid_t tid) { in dump_thread() argument
77 snprintf(path, sizeof(path), "/proc/%d/comm", tid); in dump_thread()
89 _LOG(log, logtype::BACKTRACE, "\n\"%s\" sysTid=%d\n", threadname ? threadname : "<unknown>", tid); in dump_thread()
91 std::unique_ptr<Backtrace> backtrace(Backtrace::Create(pid, tid, map)); in dump_thread()
95 ALOGE("Unwind failed: tid = %d: %s", tid, in dump_thread()
100 void dump_backtrace(int fd, BacktraceMap* map, pid_t pid, pid_t tid, in dump_backtrace() argument
107 dump_thread(&log, map, pid, tid); in dump_backtrace()
Dtombstone.cpp179 static void dump_signal_info(log_t* log, pid_t tid, int signal, int si_code) { in dump_signal_info() argument
182 if (ptrace(PTRACE_GETSIGINFO, tid, 0, &si) == -1) { in dump_signal_info()
201 static void dump_thread_info(log_t* log, pid_t pid, pid_t tid) { in dump_thread_info() argument
207 snprintf(path, sizeof(path), "/proc/%d/comm", tid); in dump_thread_info()
234 _LOG(log, logtype::HEADER, "pid: %d, tid: %d, name: %s >>> %s <<<\n", pid, tid, in dump_thread_info()
359 static void dump_all_maps(Backtrace* backtrace, BacktraceMap* map, log_t* log, pid_t tid) { in dump_all_maps() argument
364 if (ptrace(PTRACE_GETSIGINFO, tid, 0, &si) != -1) { in dump_all_maps()
368 ALOGE("Cannot get siginfo for %d: %s\n", tid, strerror(errno)); in dump_all_maps()
447 static void dump_thread(log_t* log, pid_t pid, pid_t tid, BacktraceMap* map, int signal, in dump_thread() argument
449 log->current_tid = tid; in dump_thread()
[all …]
Dsignal_sender.cpp35 pid_t tid; member
100 if (msg.tid > 0) { in start_signal_sender()
101 if (syscall(SYS_tgkill, msg.pid, msg.tid, msg.signal) != 0) { in start_signal_sender()
148 bool send_signal(pid_t pid, pid_t tid, int signal) { in send_signal() argument
155 signal_message msg = {.pid = pid, .tid = tid, .signal = signal }; in send_signal()
/system/extras/memory_replay/
DThreads.cpp76 Thread* Threads::CreateThread(pid_t tid) { in CreateThread() argument
80 Thread* thread = FindEmptyEntry(tid); in CreateThread()
85 thread->tid_ = tid; in CreateThread()
89 err(1, "Failed to create thread %d: %s\n", tid, strerror(errno)); in CreateThread()
96 Thread* Threads::FindThread(pid_t tid) { in FindThread() argument
97 size_t index = GetHashEntry(tid); in FindThread()
100 if (cur_tid == tid) { in FindThread()
123 size_t Threads::GetHashEntry(pid_t tid) { in GetHashEntry() argument
124 return tid % max_threads_; in GetHashEntry()
127 Thread* Threads::FindEmptyEntry(pid_t tid) { in FindEmptyEntry() argument
[all …]
DThreads.h31 Thread* CreateThread(pid_t tid);
32 Thread* FindThread(pid_t tid);
49 Thread* FindEmptyEntry(pid_t tid);
50 size_t GetHashEntry(pid_t tid);
/system/core/libutils/
DProcessCallStack.cpp80 static String8 getThreadName(pid_t tid) { in getThreadName() argument
86 snprintf(path, sizeof(path), PATH_THREAD_NAME, tid); in getThreadName()
96 return String8::format("[err-unknown-tid-%d]", tid); in getThreadName()
163 pid_t tid = -1; in update() local
164 sscanf(ep->d_name, "%d", &tid); in update()
166 if (tid < 0) { in update()
173 ssize_t idx = mThreadMap.add(tid, ThreadInfo()); in update()
186 int ignoreDepth = (selfPid == tid) ? IGNORE_DEPTH_CURRENT_THREAD : 0; in update()
189 threadInfo.callStack.update(ignoreDepth, tid); in update()
192 threadInfo.threadName = getThreadName(tid); in update()
[all …]
/system/core/include/cutils/
Ddebugger.h44 pid_t tid; member
53 int dump_tombstone(pid_t tid, char* pathbuf, size_t pathlen);
61 int dump_tombstone_timeout(pid_t tid, char* pathbuf, size_t pathlen, int timeout_secs);
66 int dump_backtrace_to_file(pid_t tid, int fd);
73 int dump_backtrace_to_file_timeout(pid_t tid, int fd, int timeout_secs);
Dsched_policy.h38 extern int set_cpuset_policy(int tid, SchedPolicy policy);
46 extern int set_sched_policy(int tid, SchedPolicy policy);
52 extern int get_sched_policy(int tid, SchedPolicy *policy);
/system/extras/memory_replay/dumps/
DREADME9 <tid>: <action_name> <ptr> [<optional_arguments>]
11 <tid>
22 thread_done - Terminate the thread with the given tid.
26 <tid>: malloc <ptr> <size>
33 <tid>: calloc <ptr> <nmemb> <size>
41 <tid>:realloc <new_ptr> <old_ptr> <size>
50 <tid>:memalign <ptr> <alignment> <size>
58 <tid>: free <ptr>
66 <tid>: thread_done 0x0
67 Indicates that the thread <tid> has completed.
/system/core/libbacktrace/
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()
119 Backtrace* Backtrace::Create(pid_t pid, pid_t tid, BacktraceMap* map) { in Create() argument
122 if (tid == BACKTRACE_CURRENT_THREAD) { in Create()
123 tid = gettid(); in Create()
125 } else if (tid == BACKTRACE_CURRENT_THREAD) { in Create()
126 tid = pid; in Create()
130 return new UnwindCurrent(pid, tid, map); in Create()
132 return new UnwindPtrace(pid, tid, map); in Create()
DThreadEntry.cpp33 ThreadEntry::ThreadEntry(pid_t pid, pid_t tid) in ThreadEntry() argument
34 : pid_(pid), tid_(tid), ref_count_(1), mutex_(PTHREAD_MUTEX_INITIALIZER), in ThreadEntry()
49 ThreadEntry* ThreadEntry::Get(pid_t pid, pid_t tid, bool create) { in Get() argument
53 if (entry->Match(pid, tid)) { in Get()
61 entry = new ThreadEntry(pid, tid); in Get()
/system/extras/simpleperf/
Dthread_tree.cpp45 void ThreadTree::AddThread(int pid, int tid, const std::string& comm) { in AddThread() argument
46 auto it = thread_tree_.find(tid); in AddThread()
49 pid, tid, in AddThread()
53 auto pair = thread_tree_.insert(std::make_pair(tid, std::unique_ptr<ThreadEntry>(thread))); in AddThread()
61 void ThreadTree::ForkThread(int pid, int tid, int ppid, int ptid) { in ForkThread() argument
63 ThreadEntry* child = FindThreadOrNew(pid, tid); in ForkThread()
68 ThreadEntry* ThreadTree::FindThreadOrNew(int pid, int tid) { in FindThreadOrNew() argument
69 auto it = thread_tree_.find(tid); in FindThreadOrNew()
71 AddThread(pid, tid, "unknown"); in FindThreadOrNew()
72 it = thread_tree_.find(tid); in FindThreadOrNew()
[all …]
Devent_fd.cpp45 std::unique_ptr<EventFd> EventFd::OpenEventFile(const perf_event_attr& attr, pid_t tid, int cpu, in OpenEventFile() argument
53 int perf_event_fd = perf_event_open(&perf_attr, tid, cpu, -1, 0); in OpenEventFile()
56 PLOG(ERROR) << "open perf_event_file (event " << event_name << ", tid " << tid << ", cpu " in OpenEventFile()
59 PLOG(DEBUG) << "open perf_event_file (event " << event_name << ", tid " << tid << ", cpu " in OpenEventFile()
67 << tid << ", cpu " << cpu << ") failed"; in OpenEventFile()
70 << tid << ", cpu " << cpu << ") failed"; in OpenEventFile()
74 return std::unique_ptr<EventFd>(new EventFd(perf_event_fd, event_name, tid, cpu)); in OpenEventFile()
Dsample_tree_test.cpp23 int tid; member
35 ASSERT_EQ(expected.tid, sample.thread->tid); in SampleMatchExpectation()
57 if (sample1.thread->tid != sample2.thread->tid) { in CompareSampleFunction()
58 return sample1.thread->tid - sample2.thread->tid; in CompareSampleFunction()
Dthread_tree.h54 int tid; member
67 void AddThread(int pid, int tid, const std::string& comm);
68 void ForkThread(int pid, int tid, int ppid, int ptid);
69 ThreadEntry* FindThreadOrNew(int pid, int tid);
72 void AddThreadMap(int pid, int tid, uint64_t start_addr, uint64_t len, uint64_t pgoff,
Dsample_tree.cpp33 SampleEntry* SampleTree::AddSample(int pid, int tid, uint64_t ip, uint64_t time, uint64_t period, in AddSample() argument
35 const ThreadEntry* thread = thread_tree_->FindThreadOrNew(pid, tid); in AddSample()
47 void SampleTree::AddBranchSample(int pid, int tid, uint64_t from_ip, uint64_t to_ip, in AddBranchSample() argument
49 const ThreadEntry* thread = thread_tree_->FindThreadOrNew(pid, tid); in AddBranchSample()
73 SampleEntry* SampleTree::AddCallChainSample(int pid, int tid, uint64_t ip, uint64_t time, in AddCallChainSample() argument
76 const ThreadEntry* thread = thread_tree_->FindThreadOrNew(pid, tid); in AddCallChainSample()
108 if (!tid_filter_.empty() && tid_filter_.find(value.thread->tid) == tid_filter_.end()) { in IsFilteredOut()
/system/extras/latencytop/
Dlatencytop.c46 …tency_entry *read_thread_stats(struct latency_entry *list, int erase, int pid, int tid, int fatal);
72 int pid, tid; in main() local
78 pid = tid = 0; in main()
114 tid = atoi(argv[++i]); in main()
122 if (tid && !pid) { in main()
147 if (tid) { in main()
148 e = read_thread_stats(e, erase, pid, tid, 1); in main()
159 if (tid) { in main()
160 printf("Latencies for thread %d in process %d:\n", tid, pid); in main()
207 int tid; in read_process_stats() local
[all …]
/system/core/toolbox/
Dps.c44 static int ps_line(int pid, int tid) in ps_line() argument
60 sprintf(statline, "/proc/%d", tid ? tid : pid); in ps_line()
63 if(tid) { in ps_line()
64 sprintf(statline, "/proc/%d/task/%d/stat", pid, tid); in ps_line()
66 snprintf(macline, sizeof(macline), "/proc/%d/task/%d/attr/current", pid, tid); in ps_line()
145 if(tid != 0) { in ps_line()
147 pid = tid; in ps_line()
252 int tid = atoi(de->d_name); in ps_threads() local
253 if(tid == pid) continue; in ps_threads()
254 ps_line(pid, tid); in ps_threads()
/system/extras/perfprofd/quipper/kernel-headers/tools/perf/util/
Devent.h25 u32 pid, tid; member
35 u32 pid, tid; member
50 u32 pid, tid; member
57 u32 tid, ptid; member
70 u32 pid, tid; member
116 u32 pid, tid; member
/system/bt/osi/src/
Dthread.c42 pid_t tid; member
157 const int rc = setpriority(PRIO_PROCESS, thread->tid, priority); in thread_set_priority()
160 __func__, priority, thread->tid, rc); in thread_set_priority()
196 thread->tid = gettid(); in run_thread()
198 …LOG_WARN(LOG_TAG, "%s: thread id %d, thread name %s started", __func__, thread->tid, thread->name); in run_thread()
224 LOG_WARN(LOG_TAG, "%s: thread id %d, thread name %s exited", __func__, thread->tid, thread->name); in run_thread()

1234