Lines Matching refs:thread

55  *  u1  thread ID
60 * u2 thread ID
65 * u2 thread ID
83 * Returns true if the thread CPU clock should be used.
117 * Get the thread-cpu time, in usec.
119 * a thread spends running and not blocked.
121 static inline u8 getThreadCpuTimeInUsec(Thread* thread)
125 pthread_getcpuclockid(thread->handle, &cid);
136 * Get the clock used for stopwatch-like timing measurements on a single thread.
175 * Gets a thread's stack trace as an array of method pointers of length pCount.
178 static const Method** getStackTrace(Thread* thread, size_t* pCount)
180 void* fp = thread->interpSave.curFrame;
181 assert(thread == dvmThreadSelf() || dvmIsSuspended(thread));
207 fp = thread->interpSave.curFrame;
224 * Get a sample of the stack trace for a thread.
226 static void getSample(Thread* thread)
228 /* Get old and new stack trace for thread. */
230 const Method** newStackTrace = getStackTrace(thread, &newLength);
231 size_t oldLength = thread->stackTraceSampleLength;
232 const Method** oldStackTrace = thread->stackTraceSample;
237 dvmMethodTraceReadClocks(thread, &cpuClockDiff, &wallClockDiff);
244 dvmMethodTraceAdd(thread, newStackTrace[i], METHOD_TRACE_ENTER,
262 dvmMethodTraceAdd(thread, oldStackTrace[i], METHOD_TRACE_EXIT,
267 dvmMethodTraceAdd(thread, newStackTrace[i], METHOD_TRACE_ENTER,
272 /* Free the old stack trace and update the thread's stack trace sample. */
274 thread->stackTraceSample = newStackTrace;
275 thread->stackTraceSampleLength = newLength;
279 * Entry point for sampling thread. The sampling interval in microseconds is
289 for (Thread *thread = gDvm.threadList; thread != NULL; thread = thread->next) {
290 getSample(thread);
402 Thread* thread;
405 for (thread = gDvm.threadList; thread != NULL; thread = thread->next) {
406 thread->cpuClockBaseSet = false;
407 thread->cpuClockBase = 0;
417 Thread* thread;
420 for (thread = gDvm.threadList; thread != NULL; thread = thread->next) {
421 free(thread->stackTraceSample);
422 thread->stackTraceSample = NULL;
428 * Dump the thread list to the specified file.
432 for (Thread* thread = gDvm.threadList; thread != NULL; thread = thread->next) {
433 std::string threadName(dvmGetThreadName(thread));
434 fprintf(fp, "%d\t%s\n", thread->threadId, threadName.c_str());
596 * ENHANCEMENT: To trace just a single thread, modify the
598 * interpBreak flags only on the target thread.
602 /* Start the sampling thread. */
605 dvmThrowInternalError("failed to create sampling thread");
756 * It's possible under some circumstances for a thread to have advanced
767 * There's a theoretical possibility of interrupting another thread
771 * completely could be done by writing the thread number last and
834 fprintf(state->traceFile, "clock=thread-cpu\n");
897 /* make sure the sampling thread has stopped */
900 ALOGW("Sampling thread join failed");
913 /* Initialize per-thread CPU clock base time on first use. */