diff --git a/compose.yaml b/compose.yaml index d2e919d..3d5b71c 100644 --- a/compose.yaml +++ b/compose.yaml @@ -58,6 +58,7 @@ services: platforms: - linux/x86_64 platform: linux/x86_64 + privileged: true ports: - 8079:8080 networks: diff --git a/kaproxy/Dockerfile b/kaproxy/Dockerfile index baef27b..7ba2843 100644 --- a/kaproxy/Dockerfile +++ b/kaproxy/Dockerfile @@ -2,13 +2,13 @@ FROM archlinux:latest EXPOSE 8080 RUN pacman -Syyu --noconfirm -RUN pacman -S base-devel glibc gcc-libs --noconfirm +RUN pacman -S base-devel glibc gcc-libs perf --noconfirm COPY nginx /nginx WORKDIR /nginx RUN auto/configure \ --with-debug \ --with-http_ssl_module \ - --with-cc-opt=-pg + --with-cc-opt="-ggdb -fno-omit-frame-pointer" RUN make RUN make install COPY nginx.conf / diff --git a/kaproxy/run.sh b/kaproxy/run.sh index 7e68009..89f8203 100755 --- a/kaproxy/run.sh +++ b/kaproxy/run.sh @@ -1,5 +1,14 @@ #!/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 \ + -g "daemon off;" +} + function invoke() { /nginx/objs/nginx \ -p /tmp \ @@ -23,7 +32,7 @@ function sigcont_handler() { trap 'sigint_handler' INT trap 'sigcont_handler' CONT -invoke & +p_invoke & wait echo "NGINX down. waiting until signalled..." sleep infinity