Skip to content
Snippets Groups Projects
Commit 327f2ac4 authored by Maxime Jacquemin's avatar Maxime Jacquemin Committed by David Bühler
Browse files

[ivette] Callstack unfolding by function

parent 03a32a31
No related branches found
No related tags found
No related merge requests found
...@@ -87,7 +87,7 @@ export class LayoutEngine { ...@@ -87,7 +87,7 @@ export class LayoutEngine {
// --- Probe Buffer // --- Probe Buffer
private byFct?: string; // current function private byFct?: string; // current function
private byStk?: boolean; // callstack probes private byStk = new Map<string, boolean>(); // callstack probes
private skip?: boolean; // skip current function private skip?: boolean; // skip current function
private rowSize: Size = EMPTY; private rowSize: Size = EMPTY;
private buffer: Probe[] = []; private buffer: Probe[] = [];
...@@ -104,7 +104,7 @@ export class LayoutEngine { ...@@ -104,7 +104,7 @@ export class LayoutEngine {
}; };
} }
layout(ps: Probe[], byCallstacks: boolean): Row[] { layout(ps: Probe[], byCallstacks: Map<string, boolean>): Row[] {
this.chained = undefined; this.chained = undefined;
this.byStk = byCallstacks; this.byStk = byCallstacks;
ps.sort(LayoutEngine.order).forEach(this.push); ps.sort(LayoutEngine.order).forEach(this.push);
...@@ -171,7 +171,7 @@ export class LayoutEngine { ...@@ -171,7 +171,7 @@ export class LayoutEngine {
const rs = this.rows; const rs = this.rows;
const fct = this.byFct; const fct = this.byFct;
if (fct && ps.length > 0) { if (fct && ps.length > 0) {
const stk = this.byStk; const stk = this.byStk.get(fct);
const hlines = this.rowSize.rows; const hlines = this.rowSize.rows;
if (stk) { if (stk) {
// --- by callstacks // --- by callstacks
......
...@@ -72,7 +72,7 @@ export class Model implements ModelCallbacks { ...@@ -72,7 +72,7 @@ export class Model implements ModelCallbacks {
private remanent?: Probe; // last transient private remanent?: Probe; // last transient
private probes = new Map<string, Probe>(); private probes = new Map<string, Probe>();
private folded = new Map<string, boolean>(); // folded functions private folded = new Map<string, boolean>(); // folded functions
private byCallstacks = false; private byCallstacks = new Map<string, boolean>();
getFocused() { return this.focused; } getFocused() { return this.focused; }
isFocused(p: Probe | undefined) { return this.focused === p; } isFocused(p: Probe | undefined) { return this.focused === p; }
...@@ -114,12 +114,12 @@ export class Model implements ModelCallbacks { ...@@ -114,12 +114,12 @@ export class Model implements ModelCallbacks {
this.forceLayout(); this.forceLayout();
} }
getByCallstacks(): boolean { isByCallstacks(fct: string): boolean {
return this.byCallstacks; return this.byCallstacks.get(fct) ?? false;
} }
setByCallstacks(b: boolean) { setByCallstacks(fct: string, b: boolean) {
this.byCallstacks = b; this.byCallstacks.set(fct, b);
this.forceLayout(); this.forceLayout();
} }
......
...@@ -109,7 +109,7 @@ export function ProbeInfos() { ...@@ -109,7 +109,7 @@ export function ProbeInfos() {
const model = useModel(); const model = useModel();
const probe = model.getFocused(); const probe = model.getFocused();
const fct = probe?.fct; const fct = probe?.fct;
const byCS = model.getByCallstacks(); const byCS = fct ? model.isByCallstacks(fct) : false;
const effects = probe ? probe.effects : false; const effects = probe ? probe.effects : false;
const condition = probe ? probe.condition : false; const condition = probe ? probe.condition : false;
const summary = fct ? model.stacks.getSummary(fct) : false; const summary = fct ? model.stacks.getSummary(fct) : false;
......
...@@ -288,7 +288,7 @@ function TableRow(props: TableRowProps) { ...@@ -288,7 +288,7 @@ function TableRow(props: TableRowProps) {
if (!fct) return null; if (!fct) return null;
const folded = model.isFolded(fct); const folded = model.isFolded(fct);
const foldable = model.isFoldable(fct); const foldable = model.isFoldable(fct);
const byCallstacks = model.getByCallstacks(); const byCallstacks = model.isByCallstacks(fct);
return ( return (
<Hpack className="eva-function" style={props.style}> <Hpack className="eva-function" style={props.style}>
<TableSection <TableSection
...@@ -297,7 +297,7 @@ function TableRow(props: TableRowProps) { ...@@ -297,7 +297,7 @@ function TableRow(props: TableRowProps) {
foldable={foldable} foldable={foldable}
onClick={() => model.setFolded(fct, !folded)} onClick={() => model.setFolded(fct, !folded)}
byCallstacks = {byCallstacks} byCallstacks = {byCallstacks}
onCallstackClick = {() => model.setByCallstacks(!byCallstacks)} onCallstackClick = {() => model.setByCallstacks(fct, !byCallstacks)}
/> />
</Hpack> </Hpack>
); );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment