-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Add logs for SymbolFileDWARF::FindTypes #106030
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@augusto2112 @clayborg please take a look |
@llvm/pr-subscribers-lldb Author: Dmitrii Galimzianov (DmT021) Changes
Full diff: https://github.com/llvm/llvm-project/pull/106030.diff 1 Files Affected:
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 7e0cf36d0de1b8..53f1276ee07f8b 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2737,10 +2737,18 @@ void SymbolFileDWARF::FindTypes(const TypeQuery &query, TypeResults &results) {
if (results.AlreadySearched(this))
return;
+ auto type_basename = query.GetTypeBasename();
+
+ if (Log *log = GetLog(DWARFLog::Lookups)) {
+ GetObjectFile()->GetModule()->LogMessage(
+ log, "SymbolFileDWARF::FindTypes(type_basename=\"{0}\")",
+ type_basename);
+ }
+
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
bool have_index_match = false;
- m_index->GetTypes(query.GetTypeBasename(), [&](DWARFDIE die) {
+ m_index->GetTypes(type_basename, [&](DWARFDIE die) {
// Check the language, but only if we have a language filter.
if (query.HasLanguage()) {
if (!query.LanguageMatches(GetLanguageFamily(*die.GetCU())))
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found this useful in the past, so LGTM, thanks!
We also seem to have lost the counterpart log message which tells us whether we found something or not:
GetObjectFile()->GetModule()->LogMessage(
log,
"SymbolFileDWARF::FindTypes (sc, name=\"{0}\", parent_decl_ctx "
"= NULL, max_matches={1}, type_list) => {2}",
name.GetCString(), max_matches, types.GetSize());
Would be nice to restore that too (unless it's now logged elsewhere)
07a0426
to
9cc21bf
Compare
@Michael137 Ok, added another message after the search |
@@ -2779,7 +2788,19 @@ void SymbolFileDWARF::FindTypes(const TypeQuery &query, TypeResults &results) { | |||
return !results.Done(query); // Keep iterating if we aren't done. | |||
}); | |||
|
|||
if (results.Done(query)) | |||
auto CheckIsDoneAndLog = [&results, &query, log, type_basename, this] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this back. Usually I'm in favour of DRY but personally I find it more readable if you just inline the logging, instead of the lambda. Mind changing that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And for the log in the -gsimple-template-names
block below (line 2837), can we add something in the log that indicates we've found the type during the simple-template-names (i.e., stripped template args) lookup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I added "(simplified as <simplified_name>)" to the end of the message, but if you prefer some other format let me know
9cc21bf
to
a370fbb
Compare
@DmT021 Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our build bots. If there is a problem with a build, you may receive a report in an email or a comment on this PR. Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues. How to do this, and the rest of the post-merge process, is covered in detail here. If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of LLVM development. You can fix your changes and open a new PR to merge them again. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! |
`SymbolFileDWARF::FindTypes` was logged prior to [this commit](llvm@dd95877#diff-edef3a65d5d569bbb75a4158d35b827aa5d42ee03ccd3b0c1d4f354afa12210c). This is a helpful log message for checking for redundant type searches
SymbolFileDWARF::FindTypes
was logged prior to this commit.This is a helpful log message for checking for redundant type searches, so maybe we should restore it?