diff --git a/frontend/app/common/constants/constants.ts b/frontend/app/common/constants/constants.ts index 095e8c6a0..9c519b64b 100644 --- a/frontend/app/common/constants/constants.ts +++ b/frontend/app/common/constants/constants.ts @@ -82,6 +82,11 @@ export const GRAPH_CONFIG_KEYS = [ */ export const GRAPH_TYPE_DEFAULT = 'xla'; +/** + * The graph type for viewing the original HLO graph. + */ +export const GRAPH_TYPE_ORIGINAL_HLO = 'original_hlo'; + /** The tools generated by HLO proto. */ export const HLO_TOOLS = ['memory_viewer', 'graph_viewer']; diff --git a/frontend/app/components/controls/download_hlo/download_hlo.ts b/frontend/app/components/controls/download_hlo/download_hlo.ts index 5a855636b..660fa77df 100644 --- a/frontend/app/components/controls/download_hlo/download_hlo.ts +++ b/frontend/app/components/controls/download_hlo/download_hlo.ts @@ -1,5 +1,6 @@ import {Component, inject, Input, OnDestroy} from '@angular/core'; import {ActivatedRoute} from '@angular/router'; +import {GRAPH_TYPE_DEFAULT} from 'org_xprof/frontend/app/common/constants/constants'; import {FileExtensionType} from 'org_xprof/frontend/app/common/constants/enums'; import {DATA_SERVICE_INTERFACE_TOKEN, DataServiceV2Interface} from 'org_xprof/frontend/app/services/data_service_v2/data_service_v2_interface'; import {ReplaySubject} from 'rxjs'; @@ -32,6 +33,8 @@ export class DownloadHlo implements OnDestroy { @Input() moduleName: string = ''; /** Includes metadata in the proto. */ @Input() showMetadata: boolean = false; + /** The graph type to download. */ + @Input() graphType: string = GRAPH_TYPE_DEFAULT; readonly downloadMenuItems = DOWNLOAD_HLO_PROTO_MENU_ITEMS; private readonly destroyed = new ReplaySubject(1); @@ -53,6 +56,7 @@ export class DownloadHlo implements OnDestroy { this.dataService .downloadHloProto( this.sessionId, + this.graphType, this.moduleName, type, this.showMetadata, diff --git a/frontend/app/components/graph_viewer/graph_viewer.ng.html b/frontend/app/components/graph_viewer/graph_viewer.ng.html index 7c675628f..63f83d9a2 100644 --- a/frontend/app/components/graph_viewer/graph_viewer.ng.html +++ b/frontend/app/components/graph_viewer/graph_viewer.ng.html @@ -32,6 +32,7 @@