improve debug infomation, add time/file/line info. #34

Merged
merged 1 commit into from Feb 27, 2014

2 participants

@soarpenguin

No description provided.

@soarpenguin

你的意思是所有debug信息都应该输出到文件,是吗?

@kongjian
Alibaba member

目前还没有错误日志文件,输出到stderr就可以的

@kongjian kongjian merged commit 0cfb0e7 into alibaba:master Feb 27, 2014
@kongjian
Alibaba member

你这个patch不能编译,请调试一下

@soarpenguin

方便提供下出错信息吗? 我的环境如下,没有问题
ubuntu@ubuntu:~/tsar$ uname -a
Linux ubuntu 3.2.0-58-generic-pae #88-Ubuntu SMP Tue Dec 3 18:00:02 UTC 2013 i686 i686 i386 GNU/Linux

ubuntu@ubuntu:~/tsar$ make clean
for i in modules src; do cd $i;make clean;cd ..; done
make[1]: Entering directory /home/ubuntu/tsar/modules'
rm -f *.so;
make[1]: Leaving directory
/home/ubuntu/tsar/modules'
make[1]: Entering directory /home/ubuntu/tsar/src'
rm -rf *.o tsar
make[1]: Leaving directory
/home/ubuntu/tsar/src'

ubuntu@ubuntu:~/tsar$ make
for i in modules src; do make -C $i; done
make[1]: Entering directory /home/ubuntu/tsar/modules'
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_swap.c -o mod_swap.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_partition.c -o mod_partition.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_cpu.c -o mod_cpu.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_mem.c -o mod_mem.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_lvs.c -o mod_lvs.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_haproxy.c -o mod_haproxy.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_traffic.c -o mod_traffic.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_squid.c -o mod_squid.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_load.c -o mod_load.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_tcp.c -o mod_tcp.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_udp.c -o mod_udp.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_tcpx.c -o mod_tcpx.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_proc.c -o mod_proc.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_apache.c -o mod_apache.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_pcsw.c -o mod_pcsw.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_io.c -o mod_io.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_nginx.c -o mod_nginx.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_cgblkio.c -o mod_cgblkio.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_cgcpu.c -o mod_cgcpu.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_cgmem.c -o mod_cgmem.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_ncpu.c -o mod_ncpu.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_rndc.c -o mod_rndc.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_ts_cache.c -o mod_ts_cache.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_ts_client.c -o mod_ts_client.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_ts_err.c -o mod_ts_err.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_ts_os.c -o mod_ts_os.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_ts_storage.c -o mod_ts_storage.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_ts_conn.c -o mod_ts_conn.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_ts_codes.c -o mod_ts_codes.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_swift.c -o mod_swift.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_swift_code.c -o mod_swift_code.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_swift_store.c -o mod_swift_store.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_swift_fwd.c -o mod_swift_fwd.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_swift_domain.c -o mod_swift_domain.so
mod_swift_domain.c: In function ‘parse_swift_code_info’:
mod_swift_domain.c:171:21: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_swift_swapdir.c -o mod_swift_swapdir.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_swift_purge.c -o mod_swift_purge.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_swift_tcmalloc.c -o mod_swift_tcmalloc.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_swift_sys.c -o mod_swift_sys.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_swift_esi.c -o mod_swift_esi.so
mod_swift_esi.c: In function ‘parse_swift_code_info’:
mod_swift_esi.c:186:21: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_swift_balancer.c -o mod_swift_balancer.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_swift_blc_fwd.c -o mod_swift_blc_fwd.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_tmd.c -o mod_tmd.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_percpu.c -o mod_percpu.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_rpi.c -o mod_rpi.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_tcprt.c -o mod_tcprt.so
mod_tcprt.c: In function ‘prepare_data’:
mod_tcprt.c:47:14: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_shell.c -o mod_shell.so
gcc -I../include -Wall -fPIC --shared -g -O2 -Wno-strict-aliasing mod_nginx_domain.c -o mod_nginx_domain.so
make[1]: Leaving directory
/home/ubuntu/tsar/modules'
make[1]: Entering directory /home/ubuntu/tsar/src'
gcc -o config.o -c -I../include -g -O2 -Wall config.c
gcc -o debug.o -c -I../include -g -O2 -Wall debug.c
gcc -o framework.o -c -I../include -g -O2 -Wall framework.c
gcc -o tsar.o -c -I../include -g -O2 -Wall tsar.c
gcc -o output_file.o -c -I../include -g -O2 -Wall output_file.c
gcc -o output_print.o -c -I../include -g -O2 -Wall output_print.c
gcc -o output_db.o -c -I../include -g -O2 -Wall output_db.c
gcc -o output_nagios.o -c -I../include -g -O2 -Wall output_nagios.c
gcc -o common.o -c -I../include -g -O2 -Wall common.c
gcc config.o debug.o framework.o tsar.o output_file.o output_print.o output_db.o output_nagios.o common.o -o tsar -I../include -g -Wall -ldl -rdynamic
make[1]: Leaving directory
/home/ubuntu/tsar/src'
ubuntu@ubuntu:~/tsar$

@kongjian
Alibaba member

没能重现,现在只有一个warnning的信息,你整理一下重新提交个pull吧,麻烦了
debug.c:38: warning: field precision should have type ‘int’, but argument 3 has type ‘size_t’

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment