mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-22 20:31:04 +01:00
kdump: Add a facility to print numbers in decimal format always
To help grepping kdump output by pid or tid it makes sence to print some numbers in decimal format always. Eg, process or thread identifier at least, as they already printed in decimal format. Switch to print pid/tid arguments of some Linux signal related syscalls in decimal format. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D40099 MFC after: 1 week
This commit is contained in:
parent
829f3d7d26
commit
c2c9ac88c2
@ -34,7 +34,7 @@
|
||||
|
||||
extern bool decimal, fancy, resolv;
|
||||
|
||||
#define print_number64(first,i,n,c) do { \
|
||||
#define _print_number64(first,i,n,c,d) do { \
|
||||
uint64_t __v; \
|
||||
\
|
||||
if (quad_align && (((ptrdiff_t)((i) - (first))) & 1) == 1) { \
|
||||
@ -46,7 +46,7 @@ extern bool decimal, fancy, resolv;
|
||||
((uint64_t)(uint32_t)(i)[1]) << 32; \
|
||||
else \
|
||||
__v = (uint64_t)*(i); \
|
||||
if (decimal) \
|
||||
if (d) \
|
||||
printf("%c%jd", (c), (intmax_t)__v); \
|
||||
else \
|
||||
printf("%c%#jx", (c), (uintmax_t)__v); \
|
||||
@ -55,8 +55,8 @@ extern bool decimal, fancy, resolv;
|
||||
(c) = ','; \
|
||||
} while (0)
|
||||
|
||||
#define print_number(i,n,c) do { \
|
||||
if (decimal) \
|
||||
#define _print_number(i,n,c,d) do { \
|
||||
if (d) \
|
||||
printf("%c%jd", c, (intmax_t)*i); \
|
||||
else \
|
||||
printf("%c%#jx", c, (uintmax_t)(u_register_t)*i); \
|
||||
@ -65,6 +65,11 @@ extern bool decimal, fancy, resolv;
|
||||
c = ','; \
|
||||
} while (0)
|
||||
|
||||
#define print_number(i,n,c) _print_number(i,n,c,decimal)
|
||||
#define print_decimal_number(i,n,c) _print_number(i,n,c,true)
|
||||
#define print_number64(first,i,n,c) _print_number64(first,i,n,c,decimal)
|
||||
#define print_decimal_number64(first,i,n,c) _print_number64(first,i,n,c,true)
|
||||
|
||||
void decode_filemode(int value);
|
||||
void print_integer_arg(const char *(*decoder)(int), int value);
|
||||
void print_integer_arg_valid(const char *(*decoder)(int), int value);
|
||||
|
@ -202,7 +202,7 @@ ktrsyscall_linux(struct ktr_syscall *ktr, register_t **resip,
|
||||
case LINUX_SYS_linux_kill:
|
||||
case LINUX_SYS_linux_tkill:
|
||||
case LINUX_SYS_linux_rt_sigqueueinfo:
|
||||
print_number(ip, narg, c);
|
||||
print_decimal_number(ip, narg, c);
|
||||
putchar(',');
|
||||
print_linux_signal(*ip);
|
||||
ip++;
|
||||
@ -210,8 +210,8 @@ ktrsyscall_linux(struct ktr_syscall *ktr, register_t **resip,
|
||||
break;
|
||||
case LINUX_SYS_linux_tgkill:
|
||||
case LINUX_SYS_linux_rt_tgsigqueueinfo:
|
||||
print_number(ip, narg, c);
|
||||
print_number(ip, narg, c);
|
||||
print_decimal_number(ip, narg, c);
|
||||
print_decimal_number(ip, narg, c);
|
||||
putchar(',');
|
||||
print_linux_signal(*ip);
|
||||
ip++;
|
||||
@ -411,7 +411,7 @@ ktrsyscall_linux32(struct ktr_syscall *ktr, register_t **resip,
|
||||
case LINUX32_SYS_linux_kill:
|
||||
case LINUX32_SYS_linux_tkill:
|
||||
case LINUX32_SYS_linux_rt_sigqueueinfo:
|
||||
print_number(ip, narg, c);
|
||||
print_decimal_number(ip, narg, c);
|
||||
putchar(',');
|
||||
print_linux_signal(*ip);
|
||||
ip++;
|
||||
@ -419,8 +419,8 @@ ktrsyscall_linux32(struct ktr_syscall *ktr, register_t **resip,
|
||||
break;
|
||||
case LINUX32_SYS_linux_tgkill:
|
||||
case LINUX32_SYS_linux_rt_tgsigqueueinfo:
|
||||
print_number(ip, narg, c);
|
||||
print_number(ip, narg, c);
|
||||
print_decimal_number(ip, narg, c);
|
||||
print_decimal_number(ip, narg, c);
|
||||
putchar(',');
|
||||
print_linux_signal(*ip);
|
||||
ip++;
|
||||
|
Loading…
Reference in New Issue
Block a user