Skip to content

Commit 5bd000d

Browse files
committed
Allow frames with the same address but different line numbers.
1 parent b0cb77f commit 5bd000d

File tree

2 files changed

+5
-54
lines changed

2 files changed

+5
-54
lines changed

fxprof-processed-profile/src/frame_table.rs

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub struct FrameTable {
2424
native_symbol_col: Vec<Option<NativeSymbolIndex>>,
2525
inline_depth_col: Vec<u16>,
2626

27-
frame_key_set: FastIndexSet<InternalFrameKey>,
27+
frame_key_set: FastIndexSet<InternalFrame>,
2828
}
2929

3030
impl FrameTable {
@@ -38,7 +38,7 @@ impl FrameTable {
3838
global_libs: &mut GlobalLibTable,
3939
string_table: &mut ThreadStringTable,
4040
) -> usize {
41-
let (frame_index, is_new) = self.frame_key_set.insert_full(frame.frame_key());
41+
let (frame_index, is_new) = self.frame_key_set.insert_full(frame);
4242

4343
if !is_new {
4444
return frame_index;
@@ -162,34 +162,6 @@ pub enum InternalFrameVariant {
162162
}
163163

164164
impl InternalFrame {
165-
pub fn frame_key(&self) -> InternalFrameKey {
166-
let InternalFrame {
167-
name,
168-
variant,
169-
subcategory,
170-
file_path,
171-
line,
172-
col,
173-
flags,
174-
} = *self;
175-
let variant = match variant {
176-
InternalFrameVariant::Label => InternalFrameKeyVariant::Label(LabelFrameKey {
177-
name,
178-
file_path,
179-
line,
180-
col,
181-
}),
182-
InternalFrameVariant::Native(native_frame_data) => {
183-
InternalFrameKeyVariant::Native(native_frame_data)
184-
}
185-
};
186-
InternalFrameKey {
187-
variant,
188-
subcategory,
189-
flags,
190-
}
191-
}
192-
193165
pub fn func_key(&self) -> FuncKey {
194166
let InternalFrame {
195167
name,
@@ -211,27 +183,6 @@ impl InternalFrame {
211183
}
212184
}
213185

214-
#[derive(Debug, Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Hash)]
215-
pub struct InternalFrameKey {
216-
pub variant: InternalFrameKeyVariant,
217-
pub subcategory: SubcategoryHandle,
218-
pub flags: FrameFlags,
219-
}
220-
221-
#[derive(Debug, Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Hash)]
222-
pub struct LabelFrameKey {
223-
pub name: ThreadInternalStringIndex,
224-
pub file_path: Option<ThreadInternalStringIndex>,
225-
pub line: Option<u32>,
226-
pub col: Option<u32>,
227-
}
228-
229-
#[derive(Debug, Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Hash)]
230-
pub enum InternalFrameKeyVariant {
231-
Label(LabelFrameKey),
232-
Native(NativeFrameData),
233-
}
234-
235186
#[derive(Debug, Clone, PartialOrd, Ord, PartialEq, Eq, Hash)]
236187
pub enum InternalFrameAddress {
237188
Unknown(u64),

fxprof-processed-profile/src/profile.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,14 @@ pub struct StackHandle(ThreadHandle, usize);
105105
pub struct FrameSymbolInfo {
106106
/// The function name. If set to `None`, the name of the native symbol will be used.
107107
pub name: Option<StringHandle>,
108-
/// The source location. All fields can be set to `None` if unknown.
109-
pub source_location: SourceLocation,
110108
/// The native symbol for the function whose native code contains the frame address.
111109
pub native_symbol: NativeSymbolHandle,
110+
/// The source location. All fields can be set to `None` if unknown.
111+
pub source_location: SourceLocation,
112112
}
113113

114114
/// Source code information (file path + line number + column number) for a frame.
115-
#[derive(Debug, Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Hash)]
115+
#[derive(Debug, Default, Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Hash)]
116116
pub struct SourceLocation {
117117
/// The [`StringHandle`] for the file path of the source file. Optional.
118118
pub file_path: Option<StringHandle>,

0 commit comments

Comments
 (0)