Skip to content

Commit

Permalink
fix: Truncate flamegraph text to the right (#7333)
Browse files Browse the repository at this point in the history
Please read [contributing guidelines](CONTRIBUTING.md) and remove this
line.
  • Loading branch information
sirasistant authored Jul 4, 2024
1 parent 694cebc commit b7c6593
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions noir-projects/noir-contracts/scripts/flamegraph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ fi
# Get the directory of the script
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

PROFILER="$SCRIPT_DIR/../../../noir/noir-repo/target/debug/noir-profiler"
PROFILER="$SCRIPT_DIR/../../../noir/noir-repo/target/release/noir-profiler"

if [ ! -f $PROFILER ]; then
echo "Profiler not found, building profiler"
cd "$SCRIPT_DIR/../../../noir/noir-repo/tooling/profiler"
cargo build
cargo build --release
cd "$SCRIPT_DIR"
fi

Expand Down
4 changes: 2 additions & 2 deletions noir-projects/noir-protocol-circuits/scripts/flamegraph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ if [[ ! -f $ARTIFACT ]]; then
fi

# Build profier if it's not available.
PROFILER="$SCRIPT_DIR/../../../noir/noir-repo/target/debug/noir-profiler"
PROFILER="$SCRIPT_DIR/../../../noir/noir-repo/target/release/noir-profiler"
if [ ! -f $PROFILER ]; then
echo "Profiler not found, building profiler"
cd "$SCRIPT_DIR/../../../noir/noir-repo/tooling/profiler"
cargo build
cargo build --release
cd "$SCRIPT_DIR"
fi

Expand Down
3 changes: 2 additions & 1 deletion noir/noir-repo/tooling/profiler/src/flamegraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{collections::BTreeMap, io::BufWriter};
use acir::circuit::{Opcode, OpcodeLocation};
use color_eyre::eyre::{self};
use fm::codespan_files::Files;
use inferno::flamegraph::{from_lines, Options};
use inferno::flamegraph::{from_lines, Options, TextTruncateDirection};
use noirc_errors::debug_info::DebugInfo;
use noirc_errors::reporter::line_and_column_from_span;
use noirc_errors::Location;
Expand Down Expand Up @@ -60,6 +60,7 @@ impl FlamegraphGenerator for InfernoFlamegraphGenerator {
options.color_diffusion = true;
options.min_width = 0.0;
options.count_name = self.count_name.clone();
options.text_truncate_direction = TextTruncateDirection::Right;

from_lines(
&mut options,
Expand Down

0 comments on commit b7c6593

Please sign in to comment.