The branch srs will be patched the following patches:
- Patch st.arm.patch, for ARM.
- Patch st.osx.kqueue.patch, for osx.
- Patch st.disable.examples.patch, for ubuntu.
- Refine TAB of code.
- Merge from michaeltalyansky and xzh3836598, support ARM.
- Merge from toffaletti, support valgrind for ST.
- Introduction: http://ossrs.github.io/state-threads/docs/st.html
- API reference: http://ossrs.github.io/state-threads/docs/reference.html
- Programming notes: http://ossrs.github.io/state-threads/docs/notes.html
make linux-debug EXTRA_CFLAGS="-DMD_HAVE_EPOLL"
make darwin-debug EXTRA_CFLAGS="-DMD_HAVE_KQUEUE"
Linux with valgrind:
make linux-debug EXTRA_CFLAGS="-DMD_VALGRIND"
Remark: User must install valgrind, for instance, in centos6
sudo yum install -y valgrind valgrind-devel.
Linux with valgrind and epoll:
make linux-debug EXTRA_CFLAGS="-DMD_HAVE_EPOLL -DMD_VALGRIND"
For OSX, user must specifies the valgrind header files:
make darwin-debug EXTRA_CFLAGS="-DMD_HAVE_KQUEUE -DMD_VALGRIND -I/usr/local/include"
How to debug with gdb under valgrind, read valgrind manual.
About startup parameters, read valgrind cli.
Important cli options:
--undef-value-errors=<yes|no> [default: yes], Controls whether Memcheck reports uses of undefined value errors. Set this to no if you don't want to see undefined value errors. It also has the side effect of speeding up Memcheck somewhat.
--leak-check=<no|summary|yes|full> [default: summary], When enabled, search for memory leaks when the client program finishes. If set to summary, it says how many leaks occurred. If set to full or yes, each individual leak will be shown in detail and/or counted as an error, as specified by the options
--track-origins=<yes|no> [default: no], Controls whether Memcheck tracks the origin of uninitialised values. By default, it does not, which means that although it can tell you that an uninitialised value is being used in a dangerous way, it cannot tell you where the uninitialised value came from. This often makes it difficult to track down the root problem.
--show-reachable=<yes|no> , --show-possibly-lost=<yes|no>, to show the using memory.