Add elf symbol address helper + pass experiment path to queries

This commit is contained in:
2026-06-12 17:34:24 +02:00
parent 4b0a4b175b
commit b0cb01a7e4
3 changed files with 78 additions and 77 deletions

View File

@ -6,18 +6,14 @@ rec {
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
}; };
# TODO: Rewrite all perl scripts -> modularize common code and unify menu actions outputs = {
outputs =
{
self, self,
nixpkgs, nixpkgs,
flake-utils, flake-utils,
}: }:
# Create a shell (and possibly package) for each possible system, not only x86_64-linux # Create a shell (and possibly package) for each possible system, not only x86_64-linux
flake-utils.lib.eachDefaultSystem ( flake-utils.lib.eachDefaultSystem (
system: system: let
let
# ========================================================================================= # =========================================================================================
# Define pkgs/stdenvs # Define pkgs/stdenvs
# ========================================================================================= # =========================================================================================
@ -66,8 +62,7 @@ rec {
# ========================================================================================= # =========================================================================================
# Setup the shell when entering the "nix develop" environment (bash script). # Setup the shell when entering the "nix develop" environment (bash script).
shellHook = shellHook = let
let
# Add project-local fish abbrs here # Add project-local fish abbrs here
abbrs = { abbrs = {
fail = "perl ./scripts/menu.pl"; fail = "perl ./scripts/menu.pl";
@ -119,11 +114,13 @@ rec {
# =========================================================================================== # ===========================================================================================
python = pkgs.python314.withPackages ( python = pkgs.python314.withPackages (
p: with p; [ p:
with p; [
setuptools setuptools
flask flask
flask-mysqldb flask-mysqldb
pyyaml pyyaml
tabulate
] ]
); );
@ -166,8 +163,7 @@ rec {
pname = "wasi-sdk"; pname = "wasi-sdk";
version = "29"; version = "29";
src = src = let
let
baseurl = "https://github.com/WebAssembly/wasi-sdk/releases/download"; baseurl = "https://github.com/WebAssembly/wasi-sdk/releases/download";
in in
builtins.fetchTarball { builtins.fetchTarball {
@ -199,8 +195,7 @@ rec {
pname = "iwasm"; pname = "iwasm";
version = "2.4.4"; version = "2.4.4";
src = src = let
let
baseurl = "https://github.com/bytecodealliance/wasm-micro-runtime/releases/download"; baseurl = "https://github.com/bytecodealliance/wasm-micro-runtime/releases/download";
in in
builtins.fetchTarball { builtins.fetchTarball {
@ -234,8 +229,7 @@ rec {
pname = "wamrc"; pname = "wamrc";
version = "2.4.4"; version = "2.4.4";
src = src = let
let
baseurl = "https://github.com/bytecodealliance/wasm-micro-runtime/releases/download"; baseurl = "https://github.com/bytecodealliance/wasm-micro-runtime/releases/download";
in in
builtins.fetchTarball { builtins.fetchTarball {
@ -357,8 +351,7 @@ rec {
runHook postInstall runHook postInstall
''; '';
}; };
in in {
{
# Provide package for "nix build" # Provide package for "nix build"
packages = { packages = {
default = fail-bin; default = fail-bin;
@ -391,6 +384,7 @@ rec {
# Those are read by compile.pl / build.pl # Those are read by compile.pl / build.pl
FAIL_SHARE = "${fail-bin}/share"; FAIL_SHARE = "${fail-bin}/share";
FAIL_PYTHON = "${python}/bin/python";
WASI_ROOT = wasi-sdk; WASI_ROOT = wasi-sdk;
WAMR_ROOT = "/home/christoph/Notes/TU/MastersThesis/FailNix/wamr"; WAMR_ROOT = "/home/christoph/Notes/TU/MastersThesis/FailNix/wamr";
CROSS_CC = "${i386_pkgs.stdenv.cc}/bin/i386-elf-gcc"; CROSS_CC = "${i386_pkgs.stdenv.cc}/bin/i386-elf-gcc";

View File

@ -140,7 +140,7 @@ sub execute_query {
my $postprocess = $module->can('postprocess') my $postprocess = $module->can('postprocess')
or die "$module can't postprocess()"; or die "$module can't postprocess()";
my $querystring = $query->($experiment); my $querystring = $query->($experiment, "$builds_dir/$experiment");
my $argsstring = $args->(); my $argsstring = $args->();
my $filenamestring = $filename->(); my $filenamestring = $filename->();
@ -171,6 +171,13 @@ sub format_number_sep {
return $number; return $number;
} }
sub elf_sym_addr {
my ($elffile, $sym) = @_;
my $line = qx{nm "$elffile" 2>/dev/null | grep " $sym\$"};
return undef unless $line =~ /^([0-9a-f]+)/i;
return hex($1);
}
sub elf_read_sections { sub elf_read_sections {
my ($elffile) = @_; my ($elffile) = @_;

View File

@ -386,7 +386,7 @@ make_heatmap <- function(target_resulttype, target_benchmark) {
xmin = -0.5, xmin = -0.5,
xmax = row_width - 0.5, xmax = row_width - 0.5,
fill = NA, fill = NA,
linewidth = 1.0, linewidth = 1.5,
inherit.aes = FALSE inherit.aes = FALSE
) + ) +
scale_colour_brewer(name = "Region", palette = "Dark2") scale_colour_brewer(name = "Region", palette = "Dark2")