From ff3e6bcbec1aaff66a8480475baa35ffb18a0fea Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 19 Feb 2010 17:55:27 +0000 Subject: [PATCH] utils/ChangeLog: * strace.cc (mnemonic_table): Add pthread mask option. (usage): Document strace pthread mask option. * utils.sgml: Ditto. cygwin/ChangeLog: * include/sys/strace.h: Remove old code. Add support for ptrace tracing. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/include/sys/strace.h | 36 +++++------------------------- winsup/utils/ChangeLog | 6 +++++ winsup/utils/strace.cc | 2 ++ winsup/utils/utils.sgml | 1 + 5 files changed, 20 insertions(+), 30 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index ddbe805de..03b41748c 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2010-02-19 Christopher Faylor + + * include/sys/strace.h: Remove old code. Add support for ptrace + tracing. + 2010-02-19 Corinna Vinschen * lc_era.h: New file. diff --git a/winsup/cygwin/include/sys/strace.h b/winsup/cygwin/include/sys/strace.h index 4685e5f36..f4d58cb44 100644 --- a/winsup/cygwin/include/sys/strace.h +++ b/winsup/cygwin/include/sys/strace.h @@ -77,11 +77,12 @@ extern strace strace; #define _STRACE_WM 0x00400 // trace windows messages (enable _strace_wm) #define _STRACE_SIGP 0x00800 // trace signal and process handling #define _STRACE_MINIMAL 0x01000 // very minimal strace output +#define _STRACE_PTHREAD 0x02000 // pthread calls #define _STRACE_EXITDUMP 0x04000 // dump strace cache on exit #define _STRACE_SYSTEM 0x08000 // cache strace messages #define _STRACE_NOMUTEX 0x10000 // don't use mutex for synchronization #define _STRACE_MALLOC 0x20000 // trace malloc calls -#define _STRACE_THREAD 0x40000 // thread-locking calls +#define _STRACE_THREAD 0x40000 // cygthread calls #define _STRACE_NOTALL 0x80000 // don't include if _STRACE_ALL #ifdef __cplusplus @@ -101,31 +102,6 @@ void strace_printf (unsigned, const char *func, const char *, ...); #define define_strace(c, f) #define define_strace1(c, f) #else -#ifdef NEW_MACRO_VARARGS -/* Output message to strace log */ - -#define define_strace0(c,...) \ - do { \ - if ((c & _STRACE_SYSTEM) || strace.active ()) \ - strace.prntf (c, __PRETTY_FUNCTION__, __VA_ARGS__); \ - } \ - while (0) - -#define define_strace(c, ...) define_strace0 (_STRACE_ ## c, __VA_ARGS__) -#define define_strace1(c, ...) define_strace0 ((_STRACE_ ## c | _STRACE_NOTALL), __VA_ARGS__) - -#define debug_printf(...) define_strace (DEBUG, __VA_ARGS__) -#define paranoid_printf(...) define_strace1 (PARANOID, __VA_ARGS__) -#define select_printf(...) define_strace (SELECT, __VA_ARGS__) -#define sigproc_printf(...) define_strace (SIGP, __VA_ARGS__) -#define syscall_printf(...) define_strace (SYSCALL, __VA_ARGS__) -#define system_printf(...) define_strace (SYSTEM, __VA_ARGS__) -#define termios_printf(...) define_strace (TERMIOS, __VA_ARGS__) -#define wm_printf(...) define_strace (WM, __VA_ARGS__) -#define minimal_printf(...) define_strace1 (MINIMAL, __VA_ARGS__) -#define malloc_printf(...) define_strace1 (MALLOC, __VA_ARGS__) -#define thread_printf(...) define_strace1 (THREAD, __VA_ARGS__) -#else #define strace_printf_wrap(what, fmt, args...) \ ((void) ({\ if ((_STRACE_ ## what & _STRACE_SYSTEM) || strace.active ()) \ @@ -140,17 +116,17 @@ void strace_printf (unsigned, const char *func, const char *, ...); })) #define debug_printf(fmt, args...) strace_printf_wrap(DEBUG, fmt , ## args) +#define malloc_printf(fmt, args...) strace_printf_wrap1(MALLOC, fmt , ## args) +#define minimal_printf(fmt, args...) strace_printf_wrap1(MINIMAL, fmt , ## args) #define paranoid_printf(fmt, args...) strace_printf_wrap1(PARANOID, fmt , ## args) +#define pthread_printf(fmt, args...) strace_printf_wrap1(PTHREAD, fmt , ## args) #define select_printf(fmt, args...) strace_printf_wrap(SELECT, fmt , ## args) #define sigproc_printf(fmt, args...) strace_printf_wrap(SIGP, fmt , ## args) #define syscall_printf(fmt, args...) strace_printf_wrap(SYSCALL, fmt , ## args) #define system_printf(fmt, args...) strace_printf_wrap(SYSTEM, fmt , ## args) #define termios_printf(fmt, args...) strace_printf_wrap(TERMIOS, fmt , ## args) -#define wm_printf(fmt, args...) strace_printf_wrap(WM, fmt , ## args) -#define minimal_printf(fmt, args...) strace_printf_wrap1(MINIMAL, fmt , ## args) -#define malloc_printf(fmt, args...) strace_printf_wrap1(MALLOC, fmt , ## args) #define thread_printf(fmt, args...) strace_printf_wrap1(THREAD, fmt , ## args) -#endif /*NEW_MACRO_VARARGS*/ +#define wm_printf(fmt, args...) strace_printf_wrap(WM, fmt , ## args) #endif /*NOSTRACE*/ #endif /* __cplusplus */ #endif /* _SYS_STRACE_H */ diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index 345d3c3ea..6cab4c8a8 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,9 @@ +2010-02-19 Christopher Faylor + + * strace.cc (mnemonic_table): Add pthread mask option. + (usage): Document strace pthread mask option. + * utils.sgml: Ditto. + 2010-02-19 Corinna Vinschen * locale.cc (print_lc_mstrings): New function to print diff --git a/winsup/utils/strace.cc b/winsup/utils/strace.cc index f3acec68f..664eeb6c3 100644 --- a/winsup/utils/strace.cc +++ b/winsup/utils/strace.cc @@ -731,6 +731,7 @@ static const mask_mnemonic mnemonic_table[] = { {_STRACE_NOMUTEX, "nomutex"}, {_STRACE_MALLOC, "malloc"}, {_STRACE_THREAD, "thread"}, + {_STRACE_PTHREAD, "pthread"}, {0, NULL} }; @@ -872,6 +873,7 @@ Trace system calls and signals\n\ wm 0x00400 (_STRACE_WM) Trace Windows msgs (enable _strace_wm).\n\ sigp 0x00800 (_STRACE_SIGP) Trace signal and process handling.\n\ minimal 0x01000 (_STRACE_MINIMAL) Very minimal strace output.\n\ + pthread 0x02000 (_STRACE_PTHREAD) Pthread calls.\n\ exitdump 0x04000 (_STRACE_EXITDUMP) Dump strace cache on exit.\n\ system 0x08000 (_STRACE_SYSTEM) Serious error; goes to console and log.\n\ nomutex 0x10000 (_STRACE_NOMUTEX) Don't use mutex for synchronization.\n\ diff --git a/winsup/utils/utils.sgml b/winsup/utils/utils.sgml index fcd259a6d..b100d5047 100644 --- a/winsup/utils/utils.sgml +++ b/winsup/utils/utils.sgml @@ -1877,6 +1877,7 @@ Trace system calls and signals wm 0x00400 (_STRACE_WM) Trace Windows msgs (enable _strace_wm). sigp 0x00800 (_STRACE_SIGP) Trace signal and process handling. minimal 0x01000 (_STRACE_MINIMAL) Very minimal strace output. + pthread 0x02000 (_STRACE_PTHREAD) Pthread calls. exitdump 0x04000 (_STRACE_EXITDUMP) Dump strace cache on exit. system 0x08000 (_STRACE_SYSTEM) Serious error; goes to console and log. nomutex 0x10000 (_STRACE_NOMUTEX) Don't use mutex for synchronization.