mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[Profiling] Strip leading subdirs for frame group ID (#147906)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Closes https://github.com/elastic/prodfiler/issues/2756
This commit is contained in:
parent
aab8cf1302
commit
7bbf24acf6
2 changed files with 16 additions and 2 deletions
|
@ -74,6 +74,16 @@ const symbolizedTests = [
|
|||
},
|
||||
expected: 'full;oom_reaper;crash();main()',
|
||||
},
|
||||
{
|
||||
params: {
|
||||
fileID: '',
|
||||
addressOrLine: 75,
|
||||
exeFilename: 'oom_reaper',
|
||||
sourceFilename: '/code/functionsimsearch/learning/simhashweightslossfunctor.hpp',
|
||||
functionName: 'crash()',
|
||||
},
|
||||
expected: 'full;oom_reaper;crash();learning/simhashweightslossfunctor.hpp',
|
||||
},
|
||||
];
|
||||
|
||||
describe('Frame group operations', () => {
|
||||
|
|
|
@ -4,11 +4,15 @@
|
|||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { takeRight } from 'lodash';
|
||||
import { StackFrameMetadata } from './profiling';
|
||||
|
||||
export type FrameGroupID = string;
|
||||
|
||||
function stripLeadingSubdirs(sourceFileName: string) {
|
||||
return takeRight(sourceFileName.split('/'), 2).join('/');
|
||||
}
|
||||
|
||||
// createFrameGroupID is the "standard" way of grouping frames, by commonly
|
||||
// shared group identifiers.
|
||||
//
|
||||
|
@ -30,5 +34,5 @@ export function createFrameGroupID(
|
|||
return `elf;${exeFilename};${functionName}`;
|
||||
}
|
||||
|
||||
return `full;${exeFilename};${functionName};${sourceFilename}`;
|
||||
return `full;${exeFilename};${functionName};${stripLeadingSubdirs(sourceFilename || '')}`;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue