-
Notifications
You must be signed in to change notification settings - Fork 0
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
WIP: Implement symbolication precognition #1
Conversation
3aa3054
to
7ac737f
Compare
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.
This seems pretty reasonable! Somewhat unfortunate to have to expose the SymbolMapTrait
through two or three layers of crates, but for a temporary hack, it seems acceptable.
samply/src/shared/symbol_precog.rs
Outdated
|
||
#[derive(Debug, Clone, PartialOrd, Ord, PartialEq, Eq, Hash)] | ||
//struct StringTableIndex(usize); | ||
struct StringTableIndex(String); |
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.
Nice index :P
samply/src/shared/symbol_precog.rs
Outdated
unsafe impl Sync for PrecogSymbolInfo {} | ||
unsafe impl Send for PrecogSymbolInfo {} |
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.
Don't think these are needed
wholesym/src/helper.rs
Outdated
&self, | ||
info: &LibraryInfo, | ||
) -> Option<(Self::FL, Box<dyn SymbolMapTrait + Send + Sync>)> { | ||
if let Some(precog_helper) = self.config.precog_helper.as_ref() { |
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 would just have a HashMap<(String, DebugId), Arc<dyn SymbolMapTrait + Send + Sync>>
stored inside the helper. And then you would add those with wholesym::SymbolManager::add_precog_symbol_map
similarly to how we add known libs. This wouldn't require an extra trait.
samply/Cargo.toml
Outdated
@@ -11,6 +11,7 @@ readme = "README.md" | |||
|
|||
[dependencies] | |||
|
|||
samply-symbols = { version = "0.22.0", path = "../samply-symbols" } |
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.
This isn't needed, you can just use wholesym::samply_symbols
in the code - it won't make a difference but I think it's good practice to use the re-export in order to avoid mixing versions.
WIP horrible, but maybe not totally horrible?
Notes:
GlobalLibTable
gained a parallelused_rvas
array because I didn't want to modify theLibraryInfo
type (lots of cascading effects)Clone
fromwholesym::SymbolManagerConfig
. Keeping it was causing me all sorts of pain with the dyn trait object.&'static
for thePrecogHelper
is also a hack, but it might be one that's in the "whatever" categoryIf there is a precog helper, this PR searches only it for symbols, for testing(removed in followup commit but can be uncommented)