diff options
author | Rafael Kitover <rkitover@gmail.com> | 2021-10-15 04:40:03 +0000 |
---|---|---|
committer | Craig Small <csmall@dropbear.xyz> | 2022-09-01 22:44:05 +0000 |
commit | 20c328bdcc0311555b87c72d770e7b4cbdb53871 (patch) | |
tree | b1dce542acbfd46573b78ab42e4ea21469adada7 | |
parent | 2ba7e39f2b541a6941f3492dea296829ea487e2a (diff) | |
download | procps-ng-20c328bdcc0311555b87c72d770e7b4cbdb53871.tar.gz |
Improve trace().
Turn on trace() with the TRACE macro and remove the ## token paste
preprocessor operator which is unnecessary here and causes these errors:
ps/common.h:176:26: error: pasting "(" and ""ps_argv[thisarg] is %s\n""
does no t give a valid preprocessing token
.
Send trace output to STDERR.
Tracing can be enabled by adding TRACE to CPPFLAGS as follows:
./configure CPPFLAGS="-DTRACE"
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
-rw-r--r-- | src/ps/common.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ps/common.h b/src/ps/common.h index ee08cdc..26bd38c 100644 --- a/src/ps/common.h +++ b/src/ps/common.h @@ -181,8 +181,8 @@ makEXT(noop) // --- <pids> interface end |||||||||||||||||||||||||||||||||||||||||||||| -#if 0 -#define trace(...) printf(## __VA_ARGS__) +#if TRACE +#define trace(...) fprintf(stderr, __VA_ARGS__) #else #define trace(...) #endif |