#include "defs.h"
#include "xlat/syslog_action_type.h"
+#include "xlat/syslog_console_levels.h"
SYS_FUNC(syslog)
{
return 0;
}
break;
+
+ case SYSLOG_ACTION_CONSOLE_LEVEL: /* Uses len */
+ tprints(", ");
+ printaddr64(tcp->u_arg[1]);
+ tprints(", ");
+ printxval_ex(syslog_console_levels, len, "LOGLEVEL_???",
+ XLAT_STYLE_VERBOSE | XLAT_STYLE_FMT_D);
+ return RVAL_DECODED;
+
default:
tprints(", ");
printaddr64(tcp->u_arg[1]);
{ 11, "11 /* SYSLOG_ACTION_??? */" },
{ (1U << 31) - 1, "2147483647 /* SYSLOG_ACTION_??? */" },
};
+ static const struct cmd_str levels[] = {
+ { 0xfeedbeef, "-17973521 /* LOGLEVEL_??? */" },
+ { -1U, "-1 /* LOGLEVEL_??? */" },
+ { 0, "0 /* LOGLEVEL_EMERG */" },
+ { 7, "7 /* LOGLEVEL_DEBUG */" },
+ { 8, "8 /* LOGLEVEL_DEBUG+1 */" },
+ { 9, "9 /* LOGLEVEL_??? */" },
+ { (1U << 31) - 1, "2147483647 /* LOGLEVEL_??? */" },
+ };
static const kernel_ulong_t high =
(kernel_ulong_t) 0xbadc0ded00000000ULL;
const kernel_ulong_t addr = (kernel_ulong_t) 0xfacefeeddeadbeefULL;
sprintrc(rc));
}
+ for (size_t i = 0; i < ARRAY_SIZE(levels); i++) {
+ rc = syscall(__NR_syslog, high | 8, addr, levels[i].cmd);
+ printf("syslog(8 /* SYSLOG_ACTION_CONSOLE_LEVEL */, %#llx, %s)"
+ " = %s\n",
+ (unsigned long long) addr, levels[i].str, sprintrc(rc));
+ }
+
puts("+++ exited with 0 +++");
return 0;
}