Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion samply-symbols/src/breakpad/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ impl<'a> StringListRef<'a> {
pub fn as_slice(&self) -> &'a [StringLocation] {
self.inner
}
pub fn get<R: ReadRef<'a>>(&self, index: u32, data: R) -> Option<&'a [u8]> {
pub fn get<'d, R: ReadRef<'d>>(&self, index: u32, data: R) -> Option<&'d [u8]> {
let location = *self.inner.get(usize::try_from(index).ok()?)?;
location.get(data)
}
Expand Down
12 changes: 0 additions & 12 deletions samply-symbols/src/breakpad/symbol_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,18 +202,6 @@ impl<'a> BreakpadSymbolMapSymbolCache<'a> {
}
}

// let file_offset = entry.offset.get();
// let line_length = entry.line_len.get();
// let line = self
// .data
// .read_bytes_at(file_offset, line_length.into())
// .map_err(|e| {
// Error::HelperErrorDuringFileReading(
// "Breakpad FILE or INLINE_ORIGIN record".to_string(),
// e,
// )
// })?;

impl<'object, T: FileContents> SymbolMapTrait for BreakpadSymbolMapInner<'object, T> {
fn debug_id(&self) -> debugid::DebugId {
self.index.debug_id
Expand Down
3 changes: 1 addition & 2 deletions samply/src/shared/presymbolicate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ use fxprof_processed_profile::symbol_info::{
};
use fxprof_processed_profile::LibraryHandle;
use rustc_hash::FxHashMap;
use wholesym::samply_symbols::SourceFilePathHandle;
use wholesym::{SymbolManager, SymbolMap};
use wholesym::{SourceFilePathHandle, SymbolManager, SymbolMap};

use crate::symbols::create_symbol_manager_and_quota_manager;

Expand Down
5 changes: 1 addition & 4 deletions samply/src/shared/symbol_precog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ use std::{borrow::Cow, fs::File};

use serde::de::{Deserialize, Deserializer};
use serde_derive::Deserialize;
use wholesym::{
samply_symbols::{SourceFilePathHandle, SourceFilePathIndex, SymbolMapGeneration},
SourceFilePath,
};
use wholesym::{SourceFilePath, SourceFilePathHandle, SourceFilePathIndex, SymbolMapGeneration};

#[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq, Hash)]
struct StringTableIndex(usize);
Expand Down
40 changes: 22 additions & 18 deletions wholesym/src/breakpad.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::io::Read;
use std::path::{Path, PathBuf};
use std::sync::Arc;

Expand Down Expand Up @@ -284,25 +285,28 @@ impl BreakpadSymbolDownloaderInner {
&self,
sym_path: &Path,
) -> Result<OwnedBreakpadIndex, SymindexGenerationError> {
let mut sym_file = tokio::fs::File::open(sym_path)
.await
.map_err(SymindexGenerationError::SymReading)?;
let mut parser = BreakpadIndexCreator::new();
const CHUNK_SIZE: usize = 2 * 1024 * 1024; // 2 MiB
let mut buffer = vec![0; CHUNK_SIZE];
loop {
let read_len = sym_file
.read(&mut buffer)
.await
.map_err(SymindexGenerationError::SymReading)?;
if read_len == 0 {
break;
let sym_path = sym_path.to_path_buf();
tokio::task::spawn_blocking(|| {
let mut sym_file =
std::fs::File::open(sym_path).map_err(SymindexGenerationError::SymReading)?;
let mut parser = BreakpadIndexCreator::new();
const CHUNK_SIZE: usize = 64 * 1024; // 64 KiB
let mut buffer = vec![0; CHUNK_SIZE];
loop {
let read_len = sym_file
.read(&mut buffer)
.map_err(SymindexGenerationError::SymReading)?;
if read_len == 0 {
break;
}
parser.consume(&buffer[..read_len]);
}
parser.consume(&buffer[..read_len]);
}
parser
.finish()
.map_err(SymindexGenerationError::BreakpadParsing)
parser
.finish()
.map_err(SymindexGenerationError::BreakpadParsing)
})
.await
.unwrap()
}
}

Expand Down
4 changes: 2 additions & 2 deletions wholesym/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ pub use samply_symbols;
pub use samply_symbols::{
AddressInfo, CodeId, ElfBuildId, Error, ExternalFileAddressInFileRef, ExternalFileAddressRef,
ExternalFileRef, ExternalFileSymbolMap, FrameDebugInfo, FramesLookupResult, LibraryInfo,
LookupAddress, MappedPath, MultiArchDisambiguator, PeCodeId, SourceFilePath, SymbolInfo,
SyncAddressInfo,
LookupAddress, MappedPath, MultiArchDisambiguator, PeCodeId, SourceFilePath,
SourceFilePathHandle, SourceFilePathIndex, SymbolInfo, SymbolMapGeneration, SyncAddressInfo,
};
pub use symbol_manager::{SymbolFileOrigin, SymbolManager, SymbolMap};
pub use symbol_manager_observer::SymbolManagerObserver;
Expand Down
Loading