it profiles

Signed-off-by: Ava Hahn <a.hahn@f5.com>
This commit is contained in:
Ava Hahn 2025-08-25 23:04:54 +00:00
parent 8924f2ef22
commit d07bf56cd7
7 changed files with 112 additions and 33 deletions

View file

@ -2,13 +2,13 @@ FROM archlinux:latest
EXPOSE 8080
RUN pacman -Syyu --noconfirm
RUN pacman -S base-devel glibc gcc-libs perf --noconfirm
RUN pacman -S base-devel glibc gcc-libs valgrind --noconfirm
COPY nginx /nginx
WORKDIR /nginx
RUN auto/configure \
--with-debug \
--with-http_ssl_module \
--with-cc-opt="-ggdb -fno-omit-frame-pointer"
--with-cc-opt="-gdwarf-4 -fno-omit-frame-pointer"
RUN make
RUN make install
COPY nginx.conf /

@ -1 +0,0 @@
Subproject commit 64d0795ac41836b6be8fcceba68f1dbb62b4035a

View file

@ -1,9 +1,9 @@
worker_processes 5;
worker_processes 10;
error_log /dev/stdout notice;
pid /tmp/pid;
events {
worker_connections 20;
worker_connections 10;
}
http {

View file

@ -1,20 +1,23 @@
#!/bin/bash
function p_invoke() {
perf record -F1000 --call-graph dwarf -o /perf.data \
-- /nginx/objs/nginx \
-p /tmp \
-e /tmp/error.log \
-c /nginx.conf \
# set trace-children=yes to profile worker processes
valgrind --tool=callgrind \
--trace-children=no \
--callgrind-out-file=/tmp/callgrind.output \
/nginx/objs/nginx \
-p /tmp \
-e /tmp/error.log \
-c /nginx.conf \
-g "daemon off;"
}
function invoke() {
/nginx/objs/nginx \
-p /tmp \
-e /tmp/error.log \
-c /nginx.conf \
-g "daemon off;" \
/nginx/objs/nginx \
-p /tmp \
-e /tmp/error.log \
-c /nginx.conf \
-g "daemon off;" \
$@
}