Skip to content

Commit

Permalink
Handle 'profile.meta.debug' field and display it in the meta panel (PR
Browse files Browse the repository at this point in the history
  • Loading branch information
canaltinova committed Mar 21, 2019
1 parent 4fa493c commit 8dbea8f
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs-developer/gecko-profile-format.md
Expand Up @@ -49,6 +49,7 @@ The source data format is de-duplicated to make it quicker to transfer in the JS
version: 5,
interval: 0.4,
stackwalk: 1,
debug: 1,
startTime: 1477063882018.4387,
shutdownTime: null,
processType: 0,
Expand Down
6 changes: 6 additions & 0 deletions src/components/app/MenuButtons/MetaInfo.js
Expand Up @@ -87,6 +87,12 @@ export class MenuButtonsMetaInfo extends React.PureComponent<Props> {
)}
</div>
) : null}
{meta.debug !== undefined ? (
<div className="metaInfoRow">
<span className="metaInfoLabel">Build Type:</span>
{meta.debug ? 'Debug' : 'Opt'}
</div>
) : null}
{meta.extensions ? (
<div className="metaInfoRow">
<span className="metaInfoLabel">Extensions:</span>
Expand Down
1 change: 1 addition & 0 deletions src/profile-logic/process-profile.js
Expand Up @@ -1038,6 +1038,7 @@ export function processProfile(
processType: geckoProfile.meta.processType,
product: geckoProfile.meta.product,
stackwalk: geckoProfile.meta.stackwalk,
debug: !!geckoProfile.meta.debug,
toolkit: geckoProfile.meta.toolkit,
version: geckoProfile.meta.version,
categories: geckoProfile.meta.categories,
Expand Down
10 changes: 10 additions & 0 deletions src/test/components/__snapshots__/MenuButtons.test.js.snap
Expand Up @@ -114,6 +114,16 @@ Array [
</span>
20181126165837
</div>
<div
class="metaInfoRow"
>
<span
class="metaInfoLabel"
>
Build Type:
</span>
Debug
</div>
<div
class="metaInfoRow"
>
Expand Down
1 change: 1 addition & 0 deletions src/test/fixtures/profiles/gecko-profile.js
Expand Up @@ -81,6 +81,7 @@ export function createGeckoProfile(): GeckoProfile {
processType: 0,
product: 'Firefox',
stackwalk: 1,
debug: 1,
startTime: 1460221352723.438,
shutdownTime: 1560221352723,
toolkit: 'cocoa',
Expand Down
Expand Up @@ -3818,6 +3818,7 @@ Object {
"name": "Network",
},
],
"debug": false,
"extensions": Object {
"baseURL": Array [],
"id": Array [],
Expand Down
1 change: 1 addition & 0 deletions src/test/unit/__snapshots__/profile-upgrading.test.js.snap
Expand Up @@ -40,6 +40,7 @@ Object {
"name": "Network",
},
],
"debug": false,
"extensions": Object {
"baseURL": Array [],
"id": Array [],
Expand Down
6 changes: 6 additions & 0 deletions src/types/gecko-profile.js
Expand Up @@ -192,6 +192,12 @@ export type GeckoProfileMeta = {|
processType: number,
product: string,
stackwalk: 0 | 1,
// This value represents a boolean, but for some reason is written out as an int
// value as the previous field.
// It's 0 for opt builds, and 1 for debug builds.
// This property was added to Firefox Profiler a long time after it was added to
// Firefox, that's why we don't need to make it optional for gecko profiles.
debug: 0 | 1,
toolkit: string,
version: number,
// The appBuildID, sourceURL, physicalCPUs and logicalCPUs properties landed
Expand Down
6 changes: 6 additions & 0 deletions src/types/profile.js
Expand Up @@ -330,6 +330,12 @@ export type ProfileMeta = {|
// It's 0 for the stack walking feature being turned off, and 1 for stackwalking being
// turned on.
stackwalk: 0 | 1,
// A boolean flag indicating whether the profiled application is using a debug build.
// It's false for opt builds, and true for debug builds.
// This property is optional because older processed profiles don't have this but
// this property was added to Firefox a long time ago. It should work on older Firefox
// versions without any problem.
debug?: boolean,
// This is the Gecko profile format version (the unprocessed version received directly
// from the browser.)
version: number,
Expand Down

0 comments on commit 8dbea8f

Please sign in to comment.