Skip to content
Snippets Groups Projects
Commit 20d5e1b7 authored by Saif Eddine Askri's avatar Saif Eddine Askri
Browse files

Update flame graph generation script to simplify output file handling and...

Update flame graph generation script to simplify output file handling and adjust frequency parameter
parent 2c17d1ef
No related branches found
No related tags found
No related merge requests found
......@@ -56,6 +56,7 @@ The following scripts measure execution time and generate profiling data for dif
- **Flame Graph for Server**
```sh
./startServerAndCreateFlameGraph.sh serverFlameGraphFile 99
perf script | /usr/local/FlameGraph/stackcollapse-perf.pl | /usr/local/FlameGraph/flamegraph.pl > "serverFlameGraph.svg"
```
---
......
#!/bin/bash
# Check if the output file name is provided
if [ -z "$1" ]; then
echo "Usage: $0 <output file name> [frequency]"
exit 1
fi
# Assign the output file name
OUTPUT_FILE_NAME=$1
# Set the frequency (default to 99 if not provided)
FREQUENCY=${2:-99}
FREQUENCY=${1:-99}
# Run perf record with the specified frequency
perf record -g -F$FREQUENCY ./build/src/myserver
# Generate the flame graph
perf script | /usr/local/FlameGraph/stackcollapse-perf.pl | /usr/local/FlameGraph/flamegraph.pl > "${OUTPUT_FILE_NAME}.svg"
echo "Flame graph saved to ${OUTPUT_FILE_NAME}.svg"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment