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>
This commit is contained in:
@@ -116,19 +116,27 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install autoconf automake libtool pkg-config gettext flex bison libpcap-dev
|
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
|
env GO111MODULE=on go install github.com/google/pprof@latest
|
||||||
sudo ln -s ${HOME}/go/bin/pprof /usr/bin/pprof
|
sudo ln -s ${HOME}/go/bin/pprof /usr/bin/pprof
|
||||||
pprof -h
|
pprof -h
|
||||||
- name: Configure nDPI library
|
- name: Configure nDPI library
|
||||||
run: |
|
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
|
- name: Build nDPI library
|
||||||
run: |
|
run: |
|
||||||
make
|
make
|
||||||
- name: Performance Profiling
|
- name: Performance Profiling
|
||||||
run: |
|
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:
|
test-scripts:
|
||||||
name: Test Utils (ubuntu-latest)
|
name: Test Utils (ubuntu-latest)
|
||||||
|
|||||||
+1
-1
@@ -286,7 +286,7 @@ AS_IF([test "x$enable_gprof" = "xyes"], [
|
|||||||
AC_MSG_ERROR([libtcmalloc not available. Required for profiling support.])
|
AC_MSG_ERROR([libtcmalloc not available. Required for profiling support.])
|
||||||
])
|
])
|
||||||
GPROF_ENABLED=1
|
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}"
|
GPROF_CFLAGS="${pkg_cv_PROFILER_CFLAGS} ${pkg_cv_TCMALLOC_CFLAGS}"
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -108,8 +108,10 @@ check_results() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [ ${GPROF_ENABLED} -eq 1 ]; then
|
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|.*_ndpi)' ../example/ndpiReader${EXE_SUFFIX} ./result/*.cprof || exit 1
|
||||||
${GPROF} -top -nodecount 100 -nodefraction 0 -show '^(ndpi)' ../example/ndpiReader${EXE_SUFFIX} ./result/*.heap || RC=$(( RC + 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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user