* [PATCH] converted COLOR_ARG macro to a function
@ 2013-10-01 0:43 Ildar Muslukhov
2013-10-01 1:10 ` Dave Jones
0 siblings, 1 reply; 4+ messages in thread
From: Ildar Muslukhov @ 2013-10-01 0:43 UTC (permalink / raw)
To: trinity; +Cc: davej
This patch converts COLOR_ARG macro to a function. The sole purpose is to
make the code a bit more readable.
Signed-off-by: Ildar Muslukhov <ildarm@google.com>
---
include/log.h | 3 ++
syscall.c | 164 ++++++++++++++++++++++++++++++----------------------------
2 files changed, 87 insertions(+), 80 deletions(-)
diff --git a/include/log.h b/include/log.h
index f3fc7c4..627985c 100644
--- a/include/log.h
+++ b/include/log.h
@@ -19,6 +19,9 @@
#define WHITE if (monochrome == FALSE) sptr += sprintf(sptr, "%s", ANSI_WHITE);
#define CRESET if (monochrome == FALSE) sptr += sprintf(sptr, "%s", ANSI_RESET);
+#define CYANPTR if (monochrome == FALSE) *sptr += sprintf(*sptr, "%s", ANSI_CYAN);
+#define CRESETPTR if (monochrome == FALSE) *sptr += sprintf(*sptr, "%s", ANSI_RESET);
+
#define MAX_LOGLEVEL 3
unsigned int highest_logfile(void);
void synclogs(void);
diff --git a/syscall.c b/syscall.c
index 824102a..b0611f5 100644
--- a/syscall.c
+++ b/syscall.c
@@ -41,14 +41,14 @@ long syscall32(int num_args, unsigned int call,
if (num_args <= 6) {
long __res;
-#if defined( __i386__)
+#if defined(__i386__)
__asm__ volatile (
"pushl %%ebp\n\t"
"movl %7, %%ebp\n\t"
"int $0x80\n\t"
"popl %%ebp\n\t"
: "=a" (__res)
- : "0" (call),"b" ((long)(a1)),"c" ((long)(a2)),"d" ((long)(a3)), "S" ((long)(a4)),"D" ((long)(a5)), "g" ((long)(a6))
+ : "0" (call), "b" ((long)(a1)), "c" ((long)(a2)), "d" ((long)(a3)), "S" ((long)(a4)), "D" ((long)(a5)), "g" ((long)(a6))
: "%ebp" /* mark EBP reg as dirty */
);
#elif defined(__x86_64__)
@@ -58,7 +58,7 @@ long syscall32(int num_args, unsigned int call,
"int $0x80\n\t"
"popq %%rbp\n\t"
: "=a" (__res)
- : "0" (call),"b" ((long)(a1)),"c" ((long)(a2)),"d" ((long)(a3)), "S" ((long)(a4)),"D" ((long)(a5)), "g" ((long)(a6))
+ : "0" (call), "b" ((long)(a1)), "c" ((long)(a2)), "d" ((long)(a3)), "S" ((long)(a4)), "D" ((long)(a5)), "g" ((long)(a6))
: "%rbp" /* mark EBP reg as dirty */
);
#else
@@ -73,7 +73,7 @@ long syscall32(int num_args, unsigned int call,
UNUSED(a5);
UNUSED(a6);
#endif
- __syscall_return(long,__res);
+ __syscall_return(long, __res);
}
#else
@@ -131,6 +131,71 @@ static unsigned long do_syscall(int childno, int *errno_saved)
return ret;
}
+static void color_arg(unsigned int call, unsigned int argnum, const char *name, unsigned long oldreg, unsigned long reg, int type, char **sptr)
+{
+ if (syscalls[call].entry->num_args >= argnum) {
+ if (!name)
+ return;
+
+ if (argnum != 1) {
+ CRESETPTR
+ *sptr += sprintf(*sptr, ", ");
+ }
+ if (name)
+ *sptr += sprintf(*sptr, "%s=", name);
+
+ if (oldreg == reg) {
+ CRESETPTR
+ } else {
+ CYANPTR
+ }
+
+ switch (type) {
+ case ARG_PATHNAME:
+ *sptr += sprintf(*sptr, "\"%s\"", (char *) reg);
+ break;
+ case ARG_PID:
+ case ARG_FD:
+ CRESETPTR
+ *sptr += sprintf(*sptr, "%ld", reg);
+ break;
+ case ARG_MODE_T:
+ CRESETPTR
+ *sptr += sprintf(*sptr, "%o", (mode_t) reg);
+ break;
+ case ARG_UNDEFINED:
+ case ARG_LEN:
+ case ARG_ADDRESS:
+ case ARG_NON_NULL_ADDRESS:
+ case ARG_RANGE:
+ case ARG_OP:
+ case ARG_LIST:
+ case ARG_RANDPAGE:
+ case ARG_CPU:
+ case ARG_RANDOM_LONG:
+ case ARG_IOVEC:
+ case ARG_IOVECLEN:
+ case ARG_SOCKADDR:
+ case ARG_SOCKADDRLEN:
+ default:
+ if (reg > 8 * 1024)
+ *sptr += sprintf(*sptr, "0x%lx", reg);
+ else
+ *sptr += sprintf(*sptr, "%ld", reg);
+ CRESETPTR
+ break;
+ }
+ if (reg == (((unsigned long)page_zeros) & PAGE_MASK))
+ *sptr += sprintf(*sptr, "[page_zeros]");
+ if (reg == (((unsigned long)page_rand) & PAGE_MASK))
+ *sptr += sprintf(*sptr, "[page_rand]");
+ if (reg == (((unsigned long)page_0xff) & PAGE_MASK))
+ *sptr += sprintf(*sptr, "[page_0xff]");
+ if (reg == (((unsigned long)page_allocs) & PAGE_MASK))
+ *sptr += sprintf(*sptr, "[page_allocs]");
+ }
+}
+
/*
* Generate arguments, print them out, then call the syscall.
*/
@@ -168,85 +233,24 @@ long mkcall(int childno)
if (syscalls[call].entry->sanitise)
syscalls[call].entry->sanitise(childno);
-/*
- * I *really* loathe how this macro has grown. It should be a real function one day.
- */
-#define COLOR_ARG(ARGNUM, NAME, BIT, OLDREG, REG, TYPE) \
- if ((logging == FALSE) && (quiet_level < MAX_LOGLEVEL)) \
- goto args_done; \
- \
- if (syscalls[call].entry->num_args >= ARGNUM) { \
- if (!NAME) \
- goto args_done; \
- if (ARGNUM != 1) { \
- CRESET \
- sptr += sprintf(sptr, ", "); \
- } \
- if (NAME) \
- sptr += sprintf(sptr, "%s=", NAME); \
- \
- if (OLDREG == REG) { \
- CRESET \
- } else { \
- CYAN \
- } \
- \
- switch(TYPE) { \
- case ARG_PATHNAME: \
- sptr += sprintf(sptr, "\"%s\"", (char *) REG); \
- break; \
- case ARG_PID: \
- case ARG_FD: \
- CRESET \
- sptr += sprintf(sptr, "%ld", REG); \
- break; \
- case ARG_MODE_T: \
- CRESET \
- sptr += sprintf(sptr, "%o", (mode_t) REG); \
- break; \
- case ARG_UNDEFINED: \
- case ARG_LEN: \
- case ARG_ADDRESS: \
- case ARG_NON_NULL_ADDRESS: \
- case ARG_RANGE: \
- case ARG_OP: \
- case ARG_LIST: \
- case ARG_RANDPAGE: \
- case ARG_CPU: \
- case ARG_RANDOM_LONG: \
- case ARG_IOVEC: \
- case ARG_IOVECLEN: \
- case ARG_SOCKADDR: \
- case ARG_SOCKADDRLEN: \
- default: \
- if (REG > 8 * 1024) \
- sptr += sprintf(sptr, "0x%lx", REG); \
- else \
- sptr += sprintf(sptr, "%ld", REG); \
- CRESET \
- break; \
- } \
- if (REG == (((unsigned long)page_zeros) & PAGE_MASK)) \
- sptr += sprintf(sptr, "[page_zeros]"); \
- if (REG == (((unsigned long)page_rand) & PAGE_MASK)) \
- sptr += sprintf(sptr, "[page_rand]"); \
- if (REG == (((unsigned long)page_0xff) & PAGE_MASK)) \
- sptr += sprintf(sptr, "[page_0xff]"); \
- if (REG == (((unsigned long)page_allocs) & PAGE_MASK)) \
- sptr += sprintf(sptr, "[page_allocs]"); \
+ if ((logging == TRUE) && (quiet_level == MAX_LOGLEVEL)) {
+ CRESET
+ sptr += sprintf(sptr, "(");
+ color_arg(call, 1, syscalls[call].entry->arg1name, olda1, shm->a1[childno],
+ syscalls[call].entry->arg1type, &sptr);
+ color_arg(call, 2, syscalls[call].entry->arg2name, olda2, shm->a2[childno],
+ syscalls[call].entry->arg2type, &sptr);
+ color_arg(call, 3, syscalls[call].entry->arg3name, olda3, shm->a3[childno],
+ syscalls[call].entry->arg3type, &sptr);
+ color_arg(call, 4, syscalls[call].entry->arg4name, olda4, shm->a4[childno],
+ syscalls[call].entry->arg4type, &sptr);
+ color_arg(call, 5, syscalls[call].entry->arg5name, olda5, shm->a5[childno],
+ syscalls[call].entry->arg5type, &sptr);
+ color_arg(call, 6, syscalls[call].entry->arg6name, olda6, shm->a6[childno],
+ syscalls[call].entry->arg6type, &sptr);
}
CRESET
- sptr += sprintf(sptr, "(");
-
- COLOR_ARG(1, syscalls[call].entry->arg1name, 1<<5, olda1, shm->a1[childno], syscalls[call].entry->arg1type);
- COLOR_ARG(2, syscalls[call].entry->arg2name, 1<<4, olda2, shm->a2[childno], syscalls[call].entry->arg2type);
- COLOR_ARG(3, syscalls[call].entry->arg3name, 1<<3, olda3, shm->a3[childno], syscalls[call].entry->arg3type);
- COLOR_ARG(4, syscalls[call].entry->arg4name, 1<<2, olda4, shm->a4[childno], syscalls[call].entry->arg4type);
- COLOR_ARG(5, syscalls[call].entry->arg5name, 1<<1, olda5, shm->a5[childno], syscalls[call].entry->arg5type);
- COLOR_ARG(6, syscalls[call].entry->arg6name, 1<<0, olda6, shm->a6[childno], syscalls[call].entry->arg6type);
-args_done:
- CRESET
sptr += sprintf(sptr, ") ");
*sptr = '\0';
--
1.8.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] converted COLOR_ARG macro to a function
2013-10-01 0:43 [PATCH] converted COLOR_ARG macro to a function Ildar Muslukhov
@ 2013-10-01 1:10 ` Dave Jones
2013-10-01 1:21 ` Ildar Muslukhov
0 siblings, 1 reply; 4+ messages in thread
From: Dave Jones @ 2013-10-01 1:10 UTC (permalink / raw)
To: Ildar Muslukhov; +Cc: trinity
On Mon, Sep 30, 2013 at 05:43:01PM -0700, Ildar Muslukhov wrote:
>
> This patch converts COLOR_ARG macro to a function. The sole purpose is to
> make the code a bit more readable.
>
> Signed-off-by: Ildar Muslukhov <ildarm@google.com>
>
> ---
> include/log.h | 3 ++
> syscall.c | 164 ++++++++++++++++++++++++++++++----------------------------
> 2 files changed, 87 insertions(+), 80 deletions(-)
>
> diff --git a/include/log.h b/include/log.h
> index f3fc7c4..627985c 100644
> --- a/include/log.h
> +++ b/include/log.h
> @@ -19,6 +19,9 @@
> #define WHITE if (monochrome == FALSE) sptr += sprintf(sptr, "%s", ANSI_WHITE);
> #define CRESET if (monochrome == FALSE) sptr += sprintf(sptr, "%s", ANSI_RESET);
>
> +#define CYANPTR if (monochrome == FALSE) *sptr += sprintf(*sptr, "%s", ANSI_CYAN);
> +#define CRESETPTR if (monochrome == FALSE) *sptr += sprintf(*sptr, "%s", ANSI_RESET);
We only use CYANPTR once. Might as well just inline it ?
> --- a/syscall.c
> +++ b/syscall.c
> @@ -41,14 +41,14 @@ long syscall32(int num_args, unsigned int call,
>
> if (num_args <= 6) {
> long __res;
> -#if defined( __i386__)
> +#if defined(__i386__)
> __asm__ volatile (
> "pushl %%ebp\n\t"
> "movl %7, %%ebp\n\t"
> "int $0x80\n\t"
> "popl %%ebp\n\t"
> : "=a" (__res)
> - : "0" (call),"b" ((long)(a1)),"c" ((long)(a2)),"d" ((long)(a3)), "S" ((long)(a4)),"D" ((long)(a5)), "g" ((long)(a6))
> + : "0" (call), "b" ((long)(a1)), "c" ((long)(a2)), "d" ((long)(a3)), "S" ((long)(a4)), "D" ((long)(a5)), "g" ((long)(a6))
> : "%ebp" /* mark EBP reg as dirty */
> );
> #elif defined(__x86_64__)
> @@ -58,7 +58,7 @@ long syscall32(int num_args, unsigned int call,
> "int $0x80\n\t"
> "popq %%rbp\n\t"
> : "=a" (__res)
> - : "0" (call),"b" ((long)(a1)),"c" ((long)(a2)),"d" ((long)(a3)), "S" ((long)(a4)),"D" ((long)(a5)), "g" ((long)(a6))
> + : "0" (call), "b" ((long)(a1)), "c" ((long)(a2)), "d" ((long)(a3)), "S" ((long)(a4)), "D" ((long)(a5)), "g" ((long)(a6))
> : "%rbp" /* mark EBP reg as dirty */
> );
> #else
> @@ -73,7 +73,7 @@ long syscall32(int num_args, unsigned int call,
> UNUSED(a5);
> UNUSED(a6);
> #endif
> - __syscall_return(long,__res);
> + __syscall_return(long, __res);
> }
I suspect this belongs in a different diff ;)
Otherwise, looks ok.
Dave
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] converted COLOR_ARG macro to a function
2013-10-01 1:10 ` Dave Jones
@ 2013-10-01 1:21 ` Ildar Muslukhov
0 siblings, 0 replies; 4+ messages in thread
From: Ildar Muslukhov @ 2013-10-01 1:21 UTC (permalink / raw)
To: Dave Jones; +Cc: trinity
WRT to CYANPTR, just tried to be consistent with the way we do it
right now. But, sure will inline it.
The rest is just fixes after running checkpatch.pl on the patch.
On Mon, Sep 30, 2013 at 6:10 PM, Dave Jones <davej@redhat.com> wrote:
> On Mon, Sep 30, 2013 at 05:43:01PM -0700, Ildar Muslukhov wrote:
> >
> > This patch converts COLOR_ARG macro to a function. The sole purpose is to
> > make the code a bit more readable.
> >
> > Signed-off-by: Ildar Muslukhov <ildarm@google.com>
> >
> > ---
> > include/log.h | 3 ++
> > syscall.c | 164 ++++++++++++++++++++++++++++++----------------------------
> > 2 files changed, 87 insertions(+), 80 deletions(-)
> >
> > diff --git a/include/log.h b/include/log.h
> > index f3fc7c4..627985c 100644
> > --- a/include/log.h
> > +++ b/include/log.h
> > @@ -19,6 +19,9 @@
> > #define WHITE if (monochrome == FALSE) sptr += sprintf(sptr, "%s", ANSI_WHITE);
> > #define CRESET if (monochrome == FALSE) sptr += sprintf(sptr, "%s", ANSI_RESET);
> >
> > +#define CYANPTR if (monochrome == FALSE) *sptr += sprintf(*sptr, "%s", ANSI_CYAN);
> > +#define CRESETPTR if (monochrome == FALSE) *sptr += sprintf(*sptr, "%s", ANSI_RESET);
>
> We only use CYANPTR once. Might as well just inline it ?
>
> > --- a/syscall.c
> > +++ b/syscall.c
> > @@ -41,14 +41,14 @@ long syscall32(int num_args, unsigned int call,
> >
> > if (num_args <= 6) {
> > long __res;
> > -#if defined( __i386__)
> > +#if defined(__i386__)
> > __asm__ volatile (
> > "pushl %%ebp\n\t"
> > "movl %7, %%ebp\n\t"
> > "int $0x80\n\t"
> > "popl %%ebp\n\t"
> > : "=a" (__res)
> > - : "0" (call),"b" ((long)(a1)),"c" ((long)(a2)),"d" ((long)(a3)), "S" ((long)(a4)),"D" ((long)(a5)), "g" ((long)(a6))
> > + : "0" (call), "b" ((long)(a1)), "c" ((long)(a2)), "d" ((long)(a3)), "S" ((long)(a4)), "D" ((long)(a5)), "g" ((long)(a6))
> > : "%ebp" /* mark EBP reg as dirty */
> > );
> > #elif defined(__x86_64__)
> > @@ -58,7 +58,7 @@ long syscall32(int num_args, unsigned int call,
> > "int $0x80\n\t"
> > "popq %%rbp\n\t"
> > : "=a" (__res)
> > - : "0" (call),"b" ((long)(a1)),"c" ((long)(a2)),"d" ((long)(a3)), "S" ((long)(a4)),"D" ((long)(a5)), "g" ((long)(a6))
> > + : "0" (call), "b" ((long)(a1)), "c" ((long)(a2)), "d" ((long)(a3)), "S" ((long)(a4)), "D" ((long)(a5)), "g" ((long)(a6))
> > : "%rbp" /* mark EBP reg as dirty */
> > );
> > #else
> > @@ -73,7 +73,7 @@ long syscall32(int num_args, unsigned int call,
> > UNUSED(a5);
> > UNUSED(a6);
> > #endif
> > - __syscall_return(long,__res);
> > + __syscall_return(long, __res);
> > }
>
> I suspect this belongs in a different diff ;)
>
>
> Otherwise, looks ok.
>
> Dave
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] converted COLOR_ARG macro to a function
@ 2013-10-01 17:54 Ildar Muslukhov
0 siblings, 0 replies; 4+ messages in thread
From: Ildar Muslukhov @ 2013-10-01 17:54 UTC (permalink / raw)
To: trinity; +Cc: davej
Revised the previous patch that refactors COLOR_ARG macro into a function.
Signed-off-by: Ildar Muslukhov <ildarm@google.com>
---
include/log.h | 2 +
syscall.c | 156 ++++++++++++++++++++++++++++++----------------------------
2 files changed, 82 insertions(+), 76 deletions(-)
diff --git a/include/log.h b/include/log.h
index f3fc7c4..2497988 100644
--- a/include/log.h
+++ b/include/log.h
@@ -19,6 +19,8 @@
#define WHITE if (monochrome == FALSE) sptr += sprintf(sptr, "%s", ANSI_WHITE);
#define CRESET if (monochrome == FALSE) sptr += sprintf(sptr, "%s", ANSI_RESET);
+#define CRESETPTR if (monochrome == FALSE) *sptr += sprintf(*sptr, "%s", ANSI_RESET);
+
#define MAX_LOGLEVEL 3
unsigned int highest_logfile(void);
void synclogs(void);
diff --git a/syscall.c b/syscall.c
index 824102a..71f0a16 100644
--- a/syscall.c
+++ b/syscall.c
@@ -131,6 +131,71 @@ static unsigned long do_syscall(int childno, int *errno_saved)
return ret;
}
+static void color_arg(unsigned int call, unsigned int argnum, const char *name, unsigned long oldreg, unsigned long reg, int type, char **sptr)
+{
+ if (syscalls[call].entry->num_args >= argnum) {
+ if (!name)
+ return;
+
+ if (argnum != 1) {
+ CRESETPTR
+ *sptr += sprintf(*sptr, ", ");
+ }
+ if (name)
+ *sptr += sprintf(*sptr, "%s=", name);
+
+ if (oldreg == reg) {
+ CRESETPTR
+ } else {
+ *sptr += sprintf(*sptr, "%s", ANSI_CYAN);
+ }
+
+ switch (type) {
+ case ARG_PATHNAME:
+ *sptr += sprintf(*sptr, "\"%s\"", (char *) reg);
+ break;
+ case ARG_PID:
+ case ARG_FD:
+ CRESETPTR
+ *sptr += sprintf(*sptr, "%ld", reg);
+ break;
+ case ARG_MODE_T:
+ CRESETPTR
+ *sptr += sprintf(*sptr, "%o", (mode_t) reg);
+ break;
+ case ARG_UNDEFINED:
+ case ARG_LEN:
+ case ARG_ADDRESS:
+ case ARG_NON_NULL_ADDRESS:
+ case ARG_RANGE:
+ case ARG_OP:
+ case ARG_LIST:
+ case ARG_RANDPAGE:
+ case ARG_CPU:
+ case ARG_RANDOM_LONG:
+ case ARG_IOVEC:
+ case ARG_IOVECLEN:
+ case ARG_SOCKADDR:
+ case ARG_SOCKADDRLEN:
+ default:
+ if (reg > 8 * 1024)
+ *sptr += sprintf(*sptr, "0x%lx", reg);
+ else
+ *sptr += sprintf(*sptr, "%ld", reg);
+ CRESETPTR
+ break;
+ }
+ if (reg == (((unsigned long)page_zeros) & PAGE_MASK))
+ *sptr += sprintf(*sptr, "[page_zeros]");
+ if (reg == (((unsigned long)page_rand) & PAGE_MASK))
+ *sptr += sprintf(*sptr, "[page_rand]");
+ if (reg == (((unsigned long)page_0xff) & PAGE_MASK))
+ *sptr += sprintf(*sptr, "[page_0xff]");
+ if (reg == (((unsigned long)page_allocs) & PAGE_MASK))
+ *sptr += sprintf(*sptr, "[page_allocs]");
+ }
+}
+
/*
* Generate arguments, print them out, then call the syscall.
*/
@@ -168,85 +233,24 @@ long mkcall(int childno)
if (syscalls[call].entry->sanitise)
syscalls[call].entry->sanitise(childno);
-/*
- * I *really* loathe how this macro has grown. It should be a real function one day.
- */
-#define COLOR_ARG(ARGNUM, NAME, BIT, OLDREG, REG, TYPE) \
- if ((logging == FALSE) && (quiet_level < MAX_LOGLEVEL)) \
- goto args_done; \
- \
- if (syscalls[call].entry->num_args >= ARGNUM) { \
- if (!NAME) \
- goto args_done; \
- if (ARGNUM != 1) { \
- CRESET \
- sptr += sprintf(sptr, ", "); \
- } \
- if (NAME) \
- sptr += sprintf(sptr, "%s=", NAME); \
- \
- if (OLDREG == REG) { \
- CRESET \
- } else { \
- CYAN \
- } \
- \
- switch(TYPE) { \
- case ARG_PATHNAME: \
- sptr += sprintf(sptr, "\"%s\"", (char *) REG); \
- break; \
- case ARG_PID: \
- case ARG_FD: \
- CRESET \
- sptr += sprintf(sptr, "%ld", REG); \
- break; \
- case ARG_MODE_T: \
- CRESET \
- sptr += sprintf(sptr, "%o", (mode_t) REG); \
- break; \
- case ARG_UNDEFINED: \
- case ARG_LEN: \
- case ARG_ADDRESS: \
- case ARG_NON_NULL_ADDRESS: \
- case ARG_RANGE: \
- case ARG_OP: \
- case ARG_LIST: \
- case ARG_RANDPAGE: \
- case ARG_CPU: \
- case ARG_RANDOM_LONG: \
- case ARG_IOVEC: \
- case ARG_IOVECLEN: \
- case ARG_SOCKADDR: \
- case ARG_SOCKADDRLEN: \
- default: \
- if (REG > 8 * 1024) \
- sptr += sprintf(sptr, "0x%lx", REG); \
- else \
- sptr += sprintf(sptr, "%ld", REG); \
- CRESET \
- break; \
- } \
- if (REG == (((unsigned long)page_zeros) & PAGE_MASK)) \
- sptr += sprintf(sptr, "[page_zeros]"); \
- if (REG == (((unsigned long)page_rand) & PAGE_MASK)) \
- sptr += sprintf(sptr, "[page_rand]"); \
- if (REG == (((unsigned long)page_0xff) & PAGE_MASK)) \
- sptr += sprintf(sptr, "[page_0xff]"); \
- if (REG == (((unsigned long)page_allocs) & PAGE_MASK)) \
- sptr += sprintf(sptr, "[page_allocs]"); \
+ if ((logging == TRUE) && (quiet_level == MAX_LOGLEVEL)) {
+ CRESET
+ sptr += sprintf(sptr, "(");
+ color_arg(call, 1, syscalls[call].entry->arg1name, olda1, shm->a1[childno],
+ syscalls[call].entry->arg1type, &sptr);
+ color_arg(call, 2, syscalls[call].entry->arg2name, olda2, shm->a2[childno],
+ syscalls[call].entry->arg2type, &sptr);
+ color_arg(call, 3, syscalls[call].entry->arg3name, olda3, shm->a3[childno],
+ syscalls[call].entry->arg3type, &sptr);
+ color_arg(call, 4, syscalls[call].entry->arg4name, olda4, shm->a4[childno],
+ syscalls[call].entry->arg4type, &sptr);
+ color_arg(call, 5, syscalls[call].entry->arg5name, olda5, shm->a5[childno],
+ syscalls[call].entry->arg5type, &sptr);
+ color_arg(call, 6, syscalls[call].entry->arg6name, olda6, shm->a6[childno],
+ syscalls[call].entry->arg6type, &sptr);
}
CRESET
- sptr += sprintf(sptr, "(");
-
- COLOR_ARG(1, syscalls[call].entry->arg1name, 1<<5, olda1, shm->a1[childno], syscalls[call].entry->arg1type);
- COLOR_ARG(2, syscalls[call].entry->arg2name, 1<<4, olda2, shm->a2[childno], syscalls[call].entry->arg2type);
- COLOR_ARG(3, syscalls[call].entry->arg3name, 1<<3, olda3, shm->a3[childno], syscalls[call].entry->arg3type);
- COLOR_ARG(4, syscalls[call].entry->arg4name, 1<<2, olda4, shm->a4[childno], syscalls[call].entry->arg4type);
- COLOR_ARG(5, syscalls[call].entry->arg5name, 1<<1, olda5, shm->a5[childno], syscalls[call].entry->arg5type);
- COLOR_ARG(6, syscalls[call].entry->arg6name, 1<<0, olda6, shm->a6[childno], syscalls[call].entry->arg6type);
-args_done:
- CRESET
sptr += sprintf(sptr, ") ");
*sptr = '\0';
--
1.8.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-10-01 17:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-01 0:43 [PATCH] converted COLOR_ARG macro to a function Ildar Muslukhov
2013-10-01 1:10 ` Dave Jones
2013-10-01 1:21 ` Ildar Muslukhov
-- strict thread matches above, loose matches on Subject: below --
2013-10-01 17:54 Ildar Muslukhov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.