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

Update README and script for flame graph generation with output file name and frequency options

parent 83f9fd97
No related branches found
No related tags found
No related merge requests found
......@@ -53,21 +53,14 @@ The following scripts measure execution time and generate profiling data for dif
### 🔥 Stack Trace & Profiling (Perf + Flamegraphs)
- **With socket output:**
- **Flame Graph for Server**
```sh
./stack_trace_with_perf.sh socket
```
- **With pipe output:**
```sh
./stack_trace_with_perf.sh pipe
```
- **With shared_memory output:**
```sh
./stack_trace_with_perf.sh shared_memory
./startServerAndCreateFlameGraph.sh serverFlameGraphFile 99
```
---
## 📊 Performance Analysis
These tests help analyze performance differences when using sockets, pipes and shared memory.
These tests help analyze performance of our server
Flamegraphs provide a visualization of CPU usage and execution bottlenecks. 🚀
#!/bin/bash
FREQUENCY=$1
FREQUENCY=${1:-99}
# 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}
# Run perf record with the specified frequency
perf record -g -F$FREQUENCY ./build/src/myserver
perf script | /usr/local/FlameGraph/stackcollapse-perf.pl | /usr/local/FlameGraph/flamegraph.pl > serverFlameGraph.svg
\ No newline at end of file
# 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