diff --git a/Cargo.toml b/Cargo.toml index 6698e11c..b4059ad7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,3 +41,4 @@ indexmap = { version = "2.0", features = ["serde"] } [profile.release] debug = 1 # line table + symbol names for flamegraph; no effect on codegen or runtime perf +strip = "none" diff --git a/asap-tools/data-sources/prometheus-exporters/fake_exporter/fake_exporter_rust/fake_exporter/Cargo.toml b/asap-tools/data-sources/prometheus-exporters/fake_exporter/fake_exporter_rust/fake_exporter/Cargo.toml index ab6cec67..7915fbb7 100644 --- a/asap-tools/data-sources/prometheus-exporters/fake_exporter/fake_exporter_rust/fake_exporter/Cargo.toml +++ b/asap-tools/data-sources/prometheus-exporters/fake_exporter/fake_exporter_rust/fake_exporter/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "fake_exporter" version = "0.1.0" diff --git a/asap-tools/experiments/remote_monitor.py b/asap-tools/experiments/remote_monitor.py index 577d6f07..a92a50d2 100644 --- a/asap-tools/experiments/remote_monitor.py +++ b/asap-tools/experiments/remote_monitor.py @@ -176,7 +176,7 @@ def start_profiling_query_engine_pids(qe_pids, experiment_output_dir): "--call-graph", "dwarf", "-F", - "997", + "99", "-o", output_file, "--pid", @@ -212,6 +212,28 @@ def stop_profiling_query_engine_pids(qe_perf_procs, store: bool): logger.debug("Stopped profiling for query engine pids") +def convert_query_engine_perf_data(experiment_output_dir): + qe_profiles_dir = os.path.join(experiment_output_dir, "query_engine_profiles") + data_files = [ + os.path.join(qe_profiles_dir, f) + for f in os.listdir(qe_profiles_dir) + if f.startswith("perf_") and f.endswith(".data") + ] + for data_file in data_files: + script_file = data_file.replace(".data", ".script") + logger.debug(f"Converting {data_file} to {script_file}") + try: + with open(script_file, "w") as f: + subprocess.run( + ["perf", "script", "-i", data_file], + stdout=f, + check=True, + ) + logger.debug(f"Finished converting {data_file}") + except subprocess.CalledProcessError as e: + logger.warning(f"perf script failed for {data_file}: {e}") + + # TODO Provide some way of specifying which hooks will be used def get_process_monitor_hooks( export_cost: bool, provider, node_offset: int @@ -408,6 +430,7 @@ def main(args): if qe_flamegraph_procs: logger.debug("Stopping profiling for query engine pids") stop_profiling_query_engine_pids(qe_flamegraph_procs, store=True) + convert_query_engine_perf_data(args.experiment_output_dir) logger.debug("Stopping process monitors") monitor_info = process_monitor.stop_monitor(monitor, control_pipe, monitor_pipe) diff --git a/asap-tools/installation/common/setup_dependencies.sh b/asap-tools/installation/common/setup_dependencies.sh index 5bd7c1b5..6120a78a 100755 --- a/asap-tools/installation/common/setup_dependencies.sh +++ b/asap-tools/installation/common/setup_dependencies.sh @@ -5,7 +5,7 @@ THIS_DIR=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") sudo apt-get update sudo add-apt-repository ppa:deadsnakes/ppa -y sudo apt-get update -sudo apt-get install -y python3-pip ipython3 golang-go python3.11 htop +sudo apt-get install -y python3-pip ipython3 golang-go python3.11 htop linux-tools-common linux-tools-"$(uname -r)" pip3 install --user pandas 'scipy==1.15' numpy matplotlib psutil loguru pyarrow hydra-core omegaconf pip3 install --user plotnine diff --git a/asap-tools/installation/flamegraph/install.sh b/asap-tools/installation/flamegraph/install.sh deleted file mode 100644 index f17f2229..00000000 --- a/asap-tools/installation/flamegraph/install.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -cargo install flamegraph diff --git a/asap-tools/installation/flamegraph/setup_dependencies.sh b/asap-tools/installation/flamegraph/setup_dependencies.sh deleted file mode 100644 index 8957637e..00000000 --- a/asap-tools/installation/flamegraph/setup_dependencies.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -sudo apt-get install -y linux-tools-common "linux-tools-$(uname -r)" -sudo sh -c 'echo -1 > /proc/sys/kernel/perf_event_paranoid' diff --git a/asap-tools/installation/install_external_components.sh b/asap-tools/installation/install_external_components.sh index 151239e3..5713435f 100755 --- a/asap-tools/installation/install_external_components.sh +++ b/asap-tools/installation/install_external_components.sh @@ -1,7 +1,7 @@ #!/bin/bash # PREDEFINED_COMPONENTS=("benchmarks" "exporters" "flink" "grafana" "kafka" "prometheus" "prometheus_kafka_adapter" "asprof") -PREDEFINED_COMPONENTS=("benchmarks" "exporters" "flink" "grafana" "kafka" "prometheus" "asprof" "arroyo" "flamegraph") +PREDEFINED_COMPONENTS=("benchmarks" "exporters" "flink" "grafana" "kafka" "prometheus" "asprof" "arroyo") if [ "$#" -lt 2 ]; then echo "Usage: $0 [ ...]"