Skip to content

Commit a86406c

Browse files
committed
small improvements
1 parent 738f48f commit a86406c

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

frontend/packages/insights/src/PerfAsmViewer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const Instruction = ({data, selectionState, onInstrClick}) => {
88
e.stopPropagation();
99
onInstrClick(data)
1010
}} style={{backgroundColor:`rgba(255,0,0,${data.localPercentage/100*10})`}}>
11-
<div style={{minWidth:80, display:"inline-block"}}>{data.localPercentage>0.05?`${data.localPercentage.toFixed(1)}%`:""}</div><div style={{backgroundColor: selBackgroundColor==="white"? `rgba(255,0,0,${data.localPercentage/100*10})`: selBackgroundColor,display:"inline", fontFamily:"monospace", textDecoration: data.loc?"underline":"default", }}>{data.asm}</div>
11+
<div style={{minWidth:80, display:"inline-block"}}>{data.localPercentage>0.05?`${data.localPercentage.toFixed(1)}%`:""}</div><div style={{backgroundColor: selBackgroundColor==="white"? `none`: selBackgroundColor,display:"inline", fontFamily:"monospace", textDecoration: data.loc?"underline":"default", }}>{data.asm}</div>
1212
</div>)
1313

1414
}

frontend/packages/insights/src/ProfilingView.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,12 @@ export const ProfilingView = ({data, onClose}) => {
238238
setLeftDiffIndex(llvmMLIRData.index - 1)
239239
setRightDiffIndex(llvmMLIRData.index)
240240
}
241+
const handleImpOpSelection = (op) => {
242+
setSelectedOp(op)
243+
setSelectedLayer(imperativeMLIRData.index)
244+
setLeftDiffIndex(imperativeMLIRData.index - 1)
245+
setRightDiffIndex(imperativeMLIRData.index)
246+
}
241247
const handleTraceSelect = (trace) => {
242248
if (trace.category === "Execution" && trace.name === "Step" && hasLayers) {
243249
handleSubOpSelection(trace.extra.location)
@@ -397,8 +403,7 @@ export const ProfilingView = ({data, onClose}) => {
397403
<MLIRViewer height={2 * (window.innerHeight - 90) / 3}
398404
width={(window.innerWidth - 100) / 2}
399405
layer={imperativeMLIRData} selectedOps={selectedImperativeOps}
400-
onOpClick={(d) => {
401-
}}></MLIRViewer>
406+
onOpClick={(d) => handleImpOpSelection(d.id)}></MLIRViewer>
402407
</div>
403408
<div style={{
404409
visibility: activeRightTab === "mlir_llvm" ? "visible" : "hidden",

0 commit comments

Comments
 (0)