mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
full support gperf gmc/gmp/gcp
This commit is contained in:
parent
8cd1c11add
commit
6e0bebdacf
4 changed files with 42 additions and 11 deletions
|
@ -115,6 +115,8 @@ if [ $help = yes ]; then
|
||||||
--with-utest build the utest for srs.
|
--with-utest build the utest for srs.
|
||||||
--with-gperf build srs with gperf tools(no gmc/gmp/gcp, with tcmalloc only).
|
--with-gperf build srs with gperf tools(no gmc/gmp/gcp, with tcmalloc only).
|
||||||
--with-gmc build memory check for srs with gperf tools.
|
--with-gmc build memory check for srs with gperf tools.
|
||||||
|
--with-gmp build memory profile for srs with gperf tools.
|
||||||
|
--with-gcp build cpu profile for srs with gperf tools.
|
||||||
|
|
||||||
--without-ssl disable rtmp complex handshake.
|
--without-ssl disable rtmp complex handshake.
|
||||||
--without-hls disable hls, rtmp streaming only.
|
--without-hls disable hls, rtmp streaming only.
|
||||||
|
@ -124,6 +126,8 @@ if [ $help = yes ]; then
|
||||||
--without-utest do not build the utest for srs.
|
--without-utest do not build the utest for srs.
|
||||||
--without-gperf do not build srs with gperf tools(without tcmalloc and gmc/gmp/gcp).
|
--without-gperf do not build srs with gperf tools(without tcmalloc and gmc/gmp/gcp).
|
||||||
--without-gmc do not build memory check for srs with gperf tools.
|
--without-gmc do not build memory check for srs with gperf tools.
|
||||||
|
--without-gmp do not build memory profile for srs with gperf tools.
|
||||||
|
--without-gcp do not build cpu profile for srs with gperf tools.
|
||||||
|
|
||||||
--jobs[=N] Allow N jobs at once; infinite jobs with no arg.
|
--jobs[=N] Allow N jobs at once; infinite jobs with no arg.
|
||||||
used for make in the configure, for example, to make ffmpeg.
|
used for make in the configure, for example, to make ffmpeg.
|
||||||
|
@ -151,6 +155,14 @@ if [ $SRS_GPERF = NO ]; then
|
||||||
__check_ok=NO
|
__check_ok=NO
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
if [ $SRS_GPERF_MC = YES ]; then
|
||||||
|
if [ $SRS_GPERF_MP = YES ]; then
|
||||||
|
echo "gperf-mc not compatible with gperf-mp, see: ./configure --help";
|
||||||
|
echo "@see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html";
|
||||||
|
echo "Note that since the heap-checker uses the heap-profiling framework internally, it is not possible to run both the heap-checker and heap profiler at the same time";
|
||||||
|
__check_ok=NO
|
||||||
|
fi
|
||||||
|
fi
|
||||||
# check variable neccessary
|
# check variable neccessary
|
||||||
if [ $SRS_SSL = RESERVED ]; then
|
if [ $SRS_SSL = RESERVED ]; then
|
||||||
echo "you must specifies the ssl, see: ./configure --help";
|
echo "you must specifies the ssl, see: ./configure --help";
|
||||||
|
|
12
trunk/configure
vendored
12
trunk/configure
vendored
|
@ -67,6 +67,7 @@ SrsUtestSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_UTEST = YES ]; then SrsU
|
||||||
SrsGperfSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_GPERF = YES ]; then SrsGperfSummaryColor="\$(GREEN)"; fi
|
SrsGperfSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_GPERF = YES ]; then SrsGperfSummaryColor="\$(GREEN)"; fi
|
||||||
SrsGperfMCSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_GPERF_MC = YES ]; then SrsGperfMCSummaryColor="\$(GREEN)"; fi
|
SrsGperfMCSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_GPERF_MC = YES ]; then SrsGperfMCSummaryColor="\$(GREEN)"; fi
|
||||||
SrsGperfMPSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_GPERF_MP = YES ]; then SrsGperfMPSummaryColor="\$(GREEN)"; fi
|
SrsGperfMPSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_GPERF_MP = YES ]; then SrsGperfMPSummaryColor="\$(GREEN)"; fi
|
||||||
|
SrsGperfCPSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_GPERF_CP = YES ]; then SrsGperfCPSummaryColor="\$(GREEN)"; fi
|
||||||
|
|
||||||
#####################################################################################
|
#####################################################################################
|
||||||
# makefile
|
# makefile
|
||||||
|
@ -98,9 +99,14 @@ default: bandwidth librtmp-sample utest
|
||||||
@echo -e " ${SrsGperfMCSummaryColor}gmc: gperf memory check, @see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html\$(BLACK)"
|
@echo -e " ${SrsGperfMCSummaryColor}gmc: gperf memory check, @see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html\$(BLACK)"
|
||||||
@echo -e " ${SrsGperfMCSummaryColor}env PPROF_PATH=./objs/pprof HEAPCHECK=normal ./objs/srs -c conf/srs.conf # start gmc\$(BLACK)"
|
@echo -e " ${SrsGperfMCSummaryColor}env PPROF_PATH=./objs/pprof HEAPCHECK=normal ./objs/srs -c conf/srs.conf # start gmc\$(BLACK)"
|
||||||
@echo -e " ${SrsGperfMCSummaryColor}killall -2 srs # or CTRL+C to stop gmc\$(BLACK)"
|
@echo -e " ${SrsGperfMCSummaryColor}killall -2 srs # or CTRL+C to stop gmc\$(BLACK)"
|
||||||
@echo -e " ${SrsGperfMPSummaryColor}gmc: gperf memory profile, @see: http://google-perftools.googlecode.com/svn/trunk/doc/heapprofile.html\$(BLACK)"
|
@echo -e " ${SrsGperfMPSummaryColor}gmp: gperf memory profile, @see: http://google-perftools.googlecode.com/svn/trunk/doc/heapprofile.html\$(BLACK)"
|
||||||
@echo -e " ${SrsGperfMPSummaryColor}env PPROF_PATH=./objs/pprof HEAPCHECK=normal ./objs/srs -c conf/srs.conf # start gmc\$(BLACK)"
|
@echo -e " ${SrsGperfMPSummaryColor}rm -f gperf.srs.gmp*; ./objs/srs -c conf/srs.conf # start gmp\$(BLACK)"
|
||||||
@echo -e " ${SrsGperfMPSummaryColor}killall -2 srs # or CTRL+C to stop gmc\$(BLACK)"
|
@echo -e " ${SrsGperfMPSummaryColor}killall -2 srs # or CTRL+C to stop gmp\$(BLACK)"
|
||||||
|
@echo -e " ${SrsGperfMPSummaryColor}./objs/pprof --text objs/srs gperf.srs.gmp* # to analysis memory profile\$(BLACK)"
|
||||||
|
@echo -e " ${SrsGperfCPSummaryColor}gcp: gperf cpu profile, @see: http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html\$(BLACK)"
|
||||||
|
@echo -e " ${SrsGperfCPSummaryColor}rm -f gperf.srs.gcp*; ./objs/srs -c conf/srs.conf # start gcp\$(BLACK)"
|
||||||
|
@echo -e " ${SrsGperfCPSummaryColor}killall -2 srs # or CTRL+C to stop gcp\$(BLACK)"
|
||||||
|
@echo -e " ${SrsGperfCPSummaryColor}./objs/pprof --text objs/srs gperf.srs.gcp* # to analysis cpu profile\$(BLACK)"
|
||||||
@echo -e "\$(GREEN)binaries @see: https://github.com/winlinvip/simple-rtmp-server/wiki/Build\$(BLACK)"
|
@echo -e "\$(GREEN)binaries @see: https://github.com/winlinvip/simple-rtmp-server/wiki/Build\$(BLACK)"
|
||||||
|
|
||||||
help:
|
help:
|
||||||
|
|
|
@ -281,13 +281,16 @@ void SrsServer::on_signal(int signo)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SRS_GPERF_MC
|
|
||||||
if (signo == SIGINT) {
|
if (signo == SIGINT) {
|
||||||
|
#ifdef SRS_GPERF_MC
|
||||||
srs_trace("gmc is on, main cycle will terminate normally.");
|
srs_trace("gmc is on, main cycle will terminate normally.");
|
||||||
signal_gmc_stop = true;
|
signal_gmc_stop = true;
|
||||||
|
#else
|
||||||
|
srs_trace("user terminate program");
|
||||||
|
exit(0);
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// TODO: handle the SIGINT, SIGTERM.
|
// TODO: handle the SIGINT, SIGTERM.
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,10 +37,10 @@ SrsServer* _srs_server = new SrsServer();
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#ifdef SRS_GPERF_HEAP_PROFILE
|
#ifdef SRS_GPERF_MP
|
||||||
#include <gperftools/heap-profiler.h>
|
#include <gperftools/heap-profiler.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef SRS_GPERF_CPU_PROFILE
|
#ifdef SRS_GPERF_CP
|
||||||
#include <gperftools/profiler.h>
|
#include <gperftools/profiler.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -54,11 +54,11 @@ int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
int ret = ERROR_SUCCESS;
|
int ret = ERROR_SUCCESS;
|
||||||
|
|
||||||
#ifdef SRS_GPERF_HEAP_PROFILE
|
#ifdef SRS_GPERF_MP
|
||||||
HeapProfilerStart("gperf.srs");
|
HeapProfilerStart("gperf.srs.gmp");
|
||||||
#endif
|
#endif
|
||||||
#ifdef SRS_GPERF_CPU_PROFILE
|
#ifdef SRS_GPERF_CP
|
||||||
ProfilerStart("gperf.srs.prof");
|
ProfilerStart("gperf.srs.gcp");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
signal(SIGNAL_RELOAD, handler);
|
signal(SIGNAL_RELOAD, handler);
|
||||||
|
@ -67,6 +67,16 @@ int main(int argc, char** argv)
|
||||||
if ((ret = _srs_config->parse_options(argc, argv)) != ERROR_SUCCESS) {
|
if ((ret = _srs_config->parse_options(argc, argv)) != ERROR_SUCCESS) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SRS_GPERF_MC
|
||||||
|
#ifdef SRS_GPERF_MP
|
||||||
|
srs_error("option --with-gmc confict with --with-gmp, "
|
||||||
|
"@see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html\n"
|
||||||
|
"Note that since the heap-checker uses the heap-profiling framework internally, "
|
||||||
|
"it is not possible to run both the heap-checker and heap profiler at the same time");
|
||||||
|
return -1;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
if ((ret = _srs_server->initialize()) != ERROR_SUCCESS) {
|
if ((ret = _srs_server->initialize()) != ERROR_SUCCESS) {
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue