Lines Matching refs:thread
214 auto& thread = thread_map_[r.data->tid]; in ProcessRecord() local
215 thread.process_id = r.data->pid; in ProcessRecord()
216 thread.thread_id = r.data->tid; in ProcessRecord()
217 thread.name = r.comm; in ProcessRecord()
248 ThreadInfo& thread = thread_map_[record.tid_data.tid]; in ProcessSampleRecord() local
249 thread.process_id = record.tid_data.pid; in ProcessSampleRecord()
250 thread.thread_id = record.tid_data.tid; in ProcessSampleRecord()
251 thread.name = thread_name; in ProcessSampleRecord()
252 thread.total_runtime_in_ns += runtime; in ProcessSampleRecord()
253 SpinInfo& spin_info = thread.spin_info; in ProcessSampleRecord()
258 if (thread.spin_info.samples_in_check_period.size() == 1u) { in ProcessSampleRecord()
266 if (thread.spin_info.runtime_in_check_period > time_period_in_ns * spinloop_check_rate_) { in ProcessSampleRecord()
268 thread.spin_info.spinloop_count++; in ProcessSampleRecord()
270 static_cast<double>(thread.spin_info.runtime_in_check_period) / time_period_in_ns); in ProcessSampleRecord()
271 if (rate > thread.spin_info.max_rate) { in ProcessSampleRecord()
272 thread.spin_info.max_rate = rate; in ProcessSampleRecord()
273 thread.spin_info.max_rate_start_timestamp = start_timestamp; in ProcessSampleRecord()
274 thread.spin_info.max_rate_end_timestamp = record.Timestamp(); in ProcessSampleRecord()
277 std::swap(thread.spin_info.samples_in_check_period, empty_q); in ProcessSampleRecord()
278 thread.spin_info.runtime_in_check_period = 0; in ProcessSampleRecord()
280 thread.spin_info.runtime_in_check_period -= in ProcessSampleRecord()
282 thread.spin_info.samples_in_check_period.pop(); in ProcessSampleRecord()
290 const ThreadInfo& thread = pair.second; in BuildProcessInfo() local
292 if (thread.name == "simpleperf") { in BuildProcessInfo()
295 ProcessInfo& process = process_map[thread.process_id]; in BuildProcessInfo()
296 process.process_id = thread.process_id; in BuildProcessInfo()
297 if (thread.process_id == thread.thread_id) { in BuildProcessInfo()
298 process.name = thread.name; in BuildProcessInfo()
300 process.total_runtime_in_ns += thread.total_runtime_in_ns; in BuildProcessInfo()
301 process.threads.push_back(&thread); in BuildProcessInfo()
350 for (auto& thread : process.threads) { in ReportProcessInfo() local
353 entry.runtime_in_ns = thread->total_runtime_in_ns; in ReportProcessInfo()
354 entry.pid = thread->thread_id; in ReportProcessInfo()
355 entry.name = thread->name; in ReportProcessInfo()
358 entry.percentage = 100.0 * thread->total_runtime_in_ns / total_runtime_in_ns; in ReportProcessInfo()
396 for (auto& thread : process.threads) { in ReportProcessInfo() local
397 if (thread->spin_info.spinloop_count != 0u) { in ReportProcessInfo()
398 double percentage = 100.0 * thread->spin_info.max_rate; in ReportProcessInfo()
399 double duration_in_ns = thread->spin_info.max_rate_end_timestamp - in ReportProcessInfo()
400 thread->spin_info.max_rate_start_timestamp; in ReportProcessInfo()
401 double running_time_in_ns = duration_in_ns * thread->spin_info.max_rate; in ReportProcessInfo()
404 thread->spin_info.spinloop_count, process.name.c_str(), process.process_id, in ReportProcessInfo()
405 thread->name.c_str(), thread->thread_id, in ReportProcessInfo()
406 thread->spin_info.max_rate_start_timestamp / 1e9, in ReportProcessInfo()
407 thread->spin_info.max_rate_end_timestamp / 1e9, in ReportProcessInfo()