• Home
  • Raw
  • Download

Lines Matching refs:s

97   for (const auto& s : summaries_) {  in FindSummary()  local
98 if (s.type_name == type_name && s.modifier == modifier && s.thread == thread && s.cpu == cpu) { in FindSummary()
99 return &s; in FindSummary()
107 const CounterSummary& s = summaries_[i]; in AutoGenerateSummaries() local
108 if (s.modifier == "u") { in AutoGenerateSummaries()
109 const CounterSummary* other = FindSummary(s.type_name, "k", s.thread, s.cpu); in AutoGenerateSummaries()
110 if (other != nullptr && other->IsMonitoredAtTheSameTime(s)) { in AutoGenerateSummaries()
111 if (FindSummary(s.type_name, "", s.thread, s.cpu) == nullptr) { in AutoGenerateSummaries()
112 summaries_.emplace_back(s.type_name, "", s.group_id, s.thread, s.cpu, in AutoGenerateSummaries()
113 s.count + other->count, s.runtime_in_ns, s.scale, true, csv_); in AutoGenerateSummaries()
121 for (auto& s : summaries_) { in GenerateComments() local
122 s.comment = GetCommentForSummary(s, duration_in_sec); in GenerateComments()
137 for (auto& s : summaries_) { in ShowCSV() local
139 fprintf(fp, "%s,%d,%d,", s.thread->name.c_str(), s.thread->pid, s.thread->tid); in ShowCSV()
142 fprintf(fp, "%d,", s.cpu); in ShowCSV()
144 fprintf(fp, "%s,%s,%s,%s\n", s.readable_count.c_str(), s.Name().c_str(), s.comment.c_str(), in ShowCSV()
145 (s.auto_generated ? "(generated)," : "")); in ShowCSV()
171 for (auto& s : summaries_) { in ShowText() local
174 adjust_width(width[i++], s.thread->name.size()); in ShowText()
175 adjust_width(width[i++], std::to_string(s.thread->pid).size()); in ShowText()
176 adjust_width(width[i++], std::to_string(s.thread->tid).size()); in ShowText()
179 adjust_width(width[i++], std::to_string(s.cpu).size()); in ShowText()
181 adjust_width(width[i++], s.readable_count.size()); in ShowText()
182 adjust_width(width[i++], s.Name().size()); in ShowText()
183 adjust_width(width[i++], s.comment.size()); in ShowText()
199 for (auto& s : summaries_) { in ShowText() local
202 fprintf(fp, " %-*s", static_cast<int>(width[i++]), s.thread->name.c_str()); in ShowText()
203 fprintf(fp, " %-*d", static_cast<int>(width[i++]), s.thread->pid); in ShowText()
204 fprintf(fp, " %-*d", static_cast<int>(width[i++]), s.thread->tid); in ShowText()
207 fprintf(fp, " %-*d", static_cast<int>(width[i++]), s.cpu); in ShowText()
209 fprintf(fp, " %*s %-*s # %-*s%s\n", static_cast<int>(width[i]), s.readable_count.c_str(), in ShowText()
210 static_cast<int>(width[i + 1]), s.Name().c_str(), static_cast<int>(width[i + 2]), in ShowText()
211 s.comment.c_str(), (s.auto_generated ? " (generated)" : "")); in ShowText()
215 std::string CounterSummaries::GetCommentForSummary(const CounterSummary& s, in GetCommentForSummary() argument
223 if (s.type_name == "task-clock") { in GetCommentForSummary()
224 double run_sec = s.count / 1e9; in GetCommentForSummary()
228 if (s.type_name == "cpu-clock") { in GetCommentForSummary()
231 if (s.type_name == "cpu-cycles") { in GetCommentForSummary()
232 if (s.runtime_in_ns == 0) { in GetCommentForSummary()
235 double ghz = static_cast<double>(s.count) / s.runtime_in_ns; in GetCommentForSummary()
238 if (s.type_name == "instructions" && s.count != 0) { in GetCommentForSummary()
239 const CounterSummary* other = FindSummary("cpu-cycles", s.modifier, s.thread, s.cpu); in GetCommentForSummary()
240 if (other != nullptr && other->IsMonitoredAtTheSameTime(s)) { in GetCommentForSummary()
241 double cpi = static_cast<double>(other->count) / s.count; in GetCommentForSummary()
245 std::string rate_comment = GetRateComment(s, sap_mid); in GetCommentForSummary()
249 if (s.runtime_in_ns == 0) { in GetCommentForSummary()
252 double runtime_in_sec = static_cast<double>(s.runtime_in_ns) / 1e9; in GetCommentForSummary()
253 double rate = s.count / runtime_in_sec; in GetCommentForSummary()
266 std::string CounterSummaries::GetRateComment(const CounterSummary& s, char sep) { in GetRateComment() argument
267 std::string_view miss_event_name = s.type_name; in GetRateComment()
285 const CounterSummary* other = FindSummary(event_name, s.modifier, s.thread, s.cpu); in GetRateComment()
286 if (other != nullptr && other->IsMonitoredAtTheSameTime(s) && other->count != 0) { in GetRateComment()
287 double miss_rate = static_cast<double>(s.count) / other->count; in GetRateComment()