-
-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(profiling): Add Native iOS profiles to Hermes JS profiles (#3349)
- Loading branch information
1 parent
cbb32a7
commit e9fea85
Showing
15 changed files
with
815 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { makeFifoCache } from '@sentry/utils'; | ||
|
||
import type { RawThreadCpuProfile } from './types'; | ||
import type { CombinedProfileEvent } from './types'; | ||
|
||
export const PROFILE_QUEUE = makeFifoCache<string, RawThreadCpuProfile>(20); | ||
export const PROFILE_QUEUE = makeFifoCache<string, CombinedProfileEvent>(20); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import type { DebugImage } from '@sentry/types'; | ||
import { GLOBAL_OBJ, logger } from '@sentry/utils'; | ||
|
||
import { DEFAULT_BUNDLE_NAME } from './hermes'; | ||
|
||
/** | ||
* Returns debug meta images of the loaded bundle. | ||
*/ | ||
export function getDebugMetadata(): DebugImage[] { | ||
if (!DEFAULT_BUNDLE_NAME) { | ||
return []; | ||
} | ||
|
||
const debugIdMap = GLOBAL_OBJ._sentryDebugIds; | ||
if (!debugIdMap) { | ||
return []; | ||
} | ||
|
||
const debugIdsKeys = Object.keys(debugIdMap); | ||
if (!debugIdsKeys.length) { | ||
return []; | ||
} | ||
|
||
if (debugIdsKeys.length > 1) { | ||
logger.warn( | ||
'[Profiling] Multiple debug images found, but only one one bundle is supported. Using the first one...', | ||
); | ||
} | ||
|
||
return [ | ||
{ | ||
code_file: DEFAULT_BUNDLE_NAME, | ||
debug_id: debugIdMap[debugIdsKeys[0]], | ||
type: 'sourcemap', | ||
}, | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.