aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2022-07-02 18:14:11 +0200
committerIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2022-07-03 17:38:43 +0200
commit69ccb39741a99999db07bb56e01fc53774b69621 (patch)
treec40f2969e8a89e5ef2269cfb9c53b76bf0853178
parentf2d1edbedf4b36eafb6869ffd5684d2558c1d355 (diff)
Generate profiling results as PNG.
* use -ltcmalloc_and_profiler and try to get rid of LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libprofiler.so Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r--.github/workflows/build.yml14
-rw-r--r--configure.ac2
-rwxr-xr-xtests/do.sh.in6
3 files changed, 16 insertions, 6 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index a1d8aa1c0..17e43a6e2 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -116,19 +116,27 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install autoconf automake libtool pkg-config gettext flex bison libpcap-dev
- sudo apt-get install golang-1.16-go libgoogle-perftools-dev
+ sudo apt-get install golang-1.16-go libgoogle-perftools-dev graphviz
env GO111MODULE=on go install github.com/google/pprof@latest
sudo ln -s ${HOME}/go/bin/pprof /usr/bin/pprof
pprof -h
- name: Configure nDPI library
run: |
- ./autogen.sh --enable-gprof --enable-option-checking=fatal ${{ matrix.gcrypt }} ${{ matrix.msan }} ${{ matrix.pcre }} ${{ matrix.maxminddb }}
+ ./autogen.sh --enable-gprof --enable-option-checking=fatal --with-pcre --with-maxminddb --enable-tls-sigs
- name: Build nDPI library
run: |
make
- name: Performance Profiling
run: |
- env LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libprofiler.so ./tests/do.sh
+ ./tests/do.sh
+ mkdir ndpi-performance-upload
+ mv -v tests/result/cpu_profile.png ndpi-performance-upload/cpu_profile.png
+ mv -v tests/result/heap_profile.png ndpi-performance-upload/heap_profile.png
+ - uses: actions/upload-artifact@v2
+ with:
+ name: ndpi-performance
+ path: ndpi-performance-upload
+ retention-days: 7
test-scripts:
name: Test Utils (ubuntu-latest)
diff --git a/configure.ac b/configure.ac
index b9c4259b9..5c881ab99 100644
--- a/configure.ac
+++ b/configure.ac
@@ -286,7 +286,7 @@ AS_IF([test "x$enable_gprof" = "xyes"], [
AC_MSG_ERROR([libtcmalloc not available. Required for profiling support.])
])
GPROF_ENABLED=1
- GPROF_LIBS="${pkg_cv_PROFILER_LIBS} ${pkg_cv_TCMALLOC_LIBS}"
+ GPROF_LIBS="-ltcmalloc_and_profiler"
GPROF_CFLAGS="${pkg_cv_PROFILER_CFLAGS} ${pkg_cv_TCMALLOC_CFLAGS}"
])
diff --git a/tests/do.sh.in b/tests/do.sh.in
index 3d9bfeaca..6172439ba 100755
--- a/tests/do.sh.in
+++ b/tests/do.sh.in
@@ -108,8 +108,10 @@ check_results() {
done
if [ ${GPROF_ENABLED} -eq 1 ]; then
- ${GPROF} -top -nodecount 100 -nodefraction 0 -show '^(ndpi)' ../example/ndpiReader${EXE_SUFFIX} ./result/*.cprof || RC=$(( RC + 1 ))
- ${GPROF} -top -nodecount 100 -nodefraction 0 -show '^(ndpi)' ../example/ndpiReader${EXE_SUFFIX} ./result/*.heap || RC=$(( RC + 1 ))
+ ${GPROF} -top -nodecount 100 -nodefraction 0 -show '^(ndpi|.*_ndpi)' ../example/ndpiReader${EXE_SUFFIX} ./result/*.cprof || exit 1
+ ${GPROF} -png -output ./result/cpu_profile.png -nodecount 100 -nodefraction 0 -show '^(ndpi|.*_ndpi)' ../example/ndpiReader${EXE_SUFFIX} ./result/*.cprof || exit 1
+ ${GPROF} -top -nodecount 100 -nodefraction 0 -show '^(ndpi|.*_ndpi)' ../example/ndpiReader${EXE_SUFFIX} ./result/*.heap || exit 1
+ ${GPROF} -png -output ./result/heap_profile.png -nodecount 100 -nodefraction 0 -show '^(ndpi|.*_ndpi)' ../example/ndpiReader${EXE_SUFFIX} ./result/*.heap || exit 1
fi
}