1- import { Component , inject , Injector , Input , OnDestroy , OnInit , Output , EventEmitter , SimpleChanges } from '@angular/core' ;
1+ import { Component , EventEmitter , inject , Injector , Input , OnChanges , OnDestroy , OnInit , Output , SimpleChanges } from '@angular/core' ;
22import { Params } from '@angular/router' ;
33import { Store } from '@ngrx/store' ;
44import { type OpProfileProto } from 'org_xprof/frontend/app/common/interfaces/data_table' ;
@@ -23,7 +23,7 @@ const GROUP_BY_RULES = ['program', 'category', 'provenance'];
2323 templateUrl : './op_profile_base.ng.html' ,
2424 styleUrls : [ './op_profile_common.scss' ]
2525} )
26- export class OpProfileBase implements OnDestroy , OnInit {
26+ export class OpProfileBase implements OnDestroy , OnInit , OnChanges {
2727 /** Handles on-destroy Subject, used to unsubscribe. */
2828 private readonly destroyed = new ReplaySubject < void > ( 1 ) ;
2929 private readonly injector = inject ( Injector ) ;
@@ -42,9 +42,12 @@ export class OpProfileBase implements OnDestroy, OnInit {
4242 sourceCodeServiceIsAvailable = false ;
4343 sourceFileAndLineNumber = '' ;
4444 stackTrace = '' ;
45+ focusedOpProgramId = '' ;
46+ focusedOpName = '' ;
4547 showStackTrace = false ;
4648 useUncappedFlops = false ;
4749
50+ @Input ( ) sessionId = '' ;
4851 @Input ( ) opProfileData : OpProfileProto | null = null ;
4952 @Output ( ) readonly groupByChange = new EventEmitter < string > ( ) ;
5053
@@ -80,10 +83,14 @@ export class OpProfileBase implements OnDestroy, OnInit {
8083 } ) ;
8184 }
8285
86+ // Update state for source info given the active node selection in the
87+ // underneath table.
8388 private updateActiveNode ( node : Node | null ) {
8489 this . sourceFileAndLineNumber = `${ node ?. xla ?. sourceInfo ?. fileName || '' } :${
8590 node ?. xla ?. sourceInfo ?. lineNumber || - 1 } `;
8691 this . stackTrace = node ?. xla ?. sourceInfo ?. stackFrame || '' ;
92+ this . focusedOpProgramId = node ?. xla ?. programId || '' ;
93+ this . focusedOpName = node ?. name || '' ;
8794 }
8895
8996 ngOnChanges ( changes : SimpleChanges ) {
0 commit comments