Lines Matching refs:s
110 for (const auto& s : summaries_) { in FindSummary() local
111 if (s.type_name == type_name && s.modifier == modifier && s.thread == thread && s.cpu == cpu) { in FindSummary()
112 return &s; in FindSummary()
120 const CounterSummary& s = summaries_[i]; in AutoGenerateSummaries() local
121 if (s.modifier == "u") { in AutoGenerateSummaries()
122 const CounterSummary* other = FindSummary(s.type_name, "k", s.thread, s.cpu); in AutoGenerateSummaries()
123 if (other != nullptr && other->IsMonitoredAtTheSameTime(s)) { in AutoGenerateSummaries()
124 if (FindSummary(s.type_name, "", s.thread, s.cpu) == nullptr) { in AutoGenerateSummaries()
125 summaries_.emplace_back(s.type_name, "", s.group_id, s.thread, s.cpu, in AutoGenerateSummaries()
126 s.count + other->count, s.runtime_in_ns, s.scale, true, csv_); in AutoGenerateSummaries()
134 for (auto& s : summaries_) { in GenerateComments() local
135 s.comment = GetCommentForSummary(s, duration_in_sec); in GenerateComments()
150 for (auto& s : summaries_) { in ShowCSV() local
152 fprintf(fp, "%s,%d,%d,", s.thread->name.c_str(), s.thread->pid, s.thread->tid); in ShowCSV()
155 fprintf(fp, "%d,", s.cpu); in ShowCSV()
157 fprintf(fp, "%s,%s,%s,%s\n", s.readable_count.c_str(), s.Name().c_str(), s.comment.c_str(), in ShowCSV()
158 (s.auto_generated ? "(generated)," : "")); in ShowCSV()
184 for (auto& s : summaries_) { in ShowText() local
187 adjust_width(width[i++], s.thread->name.size()); in ShowText()
188 adjust_width(width[i++], std::to_string(s.thread->pid).size()); in ShowText()
189 adjust_width(width[i++], std::to_string(s.thread->tid).size()); in ShowText()
192 adjust_width(width[i++], std::to_string(s.cpu).size()); in ShowText()
194 adjust_width(width[i++], s.readable_count.size()); in ShowText()
195 adjust_width(width[i++], s.Name().size()); in ShowText()
196 adjust_width(width[i++], s.comment.size()); in ShowText()
212 for (auto& s : summaries_) { in ShowText() local
215 fprintf(fp, " %-*s", static_cast<int>(width[i++]), s.thread->name.c_str()); in ShowText()
216 fprintf(fp, " %-*d", static_cast<int>(width[i++]), s.thread->pid); in ShowText()
217 fprintf(fp, " %-*d", static_cast<int>(width[i++]), s.thread->tid); in ShowText()
220 fprintf(fp, " %-*d", static_cast<int>(width[i++]), s.cpu); in ShowText()
222 fprintf(fp, " %*s %-*s # %-*s%s\n", static_cast<int>(width[i]), s.readable_count.c_str(), in ShowText()
223 static_cast<int>(width[i + 1]), s.Name().c_str(), static_cast<int>(width[i + 2]), in ShowText()
224 s.comment.c_str(), (s.auto_generated ? " (generated)" : "")); in ShowText()
228 std::string CounterSummaries::GetCommentForSummary(const CounterSummary& s, in GetCommentForSummary() argument
236 if (s.type_name == "task-clock") { in GetCommentForSummary()
237 double run_sec = s.count / 1e9; in GetCommentForSummary()
241 if (s.type_name == "cpu-clock") { in GetCommentForSummary()
244 if (s.type_name == "cpu-cycles") { in GetCommentForSummary()
245 if (s.runtime_in_ns == 0) { in GetCommentForSummary()
248 double ghz = static_cast<double>(s.count) / s.runtime_in_ns; in GetCommentForSummary()
251 if (s.type_name == "instructions" && s.count != 0) { in GetCommentForSummary()
252 const CounterSummary* other = FindSummary("cpu-cycles", s.modifier, s.thread, s.cpu); in GetCommentForSummary()
253 if (other != nullptr && other->IsMonitoredAtTheSameTime(s)) { in GetCommentForSummary()
254 double cpi = static_cast<double>(other->count) / s.count; in GetCommentForSummary()
258 std::string rate_comment = GetRateComment(s, sap_mid); in GetCommentForSummary()
262 if (s.runtime_in_ns == 0) { in GetCommentForSummary()
265 double runtime_in_sec = static_cast<double>(s.runtime_in_ns) / 1e9; in GetCommentForSummary()
266 double rate = s.count / runtime_in_sec; in GetCommentForSummary()
279 std::string CounterSummaries::GetRateComment(const CounterSummary& s, char sep) { in GetRateComment() argument
280 std::string_view miss_event_name = s.type_name; in GetRateComment()
298 const CounterSummary* other = FindSummary(event_name, s.modifier, s.thread, s.cpu); in GetRateComment()
299 if (other != nullptr && other->IsMonitoredAtTheSameTime(s) && other->count != 0) { in GetRateComment()
300 double miss_rate = static_cast<double>(s.count) / other->count; in GetRateComment()