syscall/names: export the syscall name in STUB module

Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an
2022-03-15 00:05:41 +08:00
committed by Petro Karashchenko
parent d398ffb930
commit ea42981cc6
4 changed files with 26 additions and 6 deletions
+11
View File
@@ -58,7 +58,18 @@ static void dump_syscall(const char *tag, uint32_t cmd, const uint32_t *regs)
* and R1..R7 = variable number of arguments depending on the system call. * and R1..R7 = variable number of arguments depending on the system call.
*/ */
#ifdef CONFIG_LIB_SYSCALL
if (cmd >= CONFIG_SYS_RESERVED)
{
svcinfo("SYSCALL %s: regs: %p cmd: %" PRId32 " name: %s\n", tag,
regs, cmd, g_funcnames[cmd - CONFIG_SYS_RESERVED]);
}
else
#endif
{
svcinfo("SYSCALL %s: regs: %p cmd: %" PRId32 "\n", tag, regs, cmd); svcinfo("SYSCALL %s: regs: %p cmd: %" PRId32 "\n", tag, regs, cmd);
}
svcinfo(" R0: %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 svcinfo(" R0: %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32
" %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 "\n", " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 "\n",
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
+11
View File
@@ -55,7 +55,18 @@ static void dump_syscall(const char *tag, uint32_t cmd, const uint32_t *regs)
* and R1..R7 = variable number of arguments depending on the system call. * and R1..R7 = variable number of arguments depending on the system call.
*/ */
#ifdef CONFIG_LIB_SYSCALL
if (cmd >= CONFIG_SYS_RESERVED)
{
svcinfo("SYSCALL %s: regs: %p cmd: %" PRId32 " name: %s\n", tag,
regs, cmd, g_funcnames[cmd - CONFIG_SYS_RESERVED]);
}
else
#endif
{
svcinfo("SYSCALL %s: regs: %p cmd: %" PRId32 "\n", tag, regs, cmd); svcinfo("SYSCALL %s: regs: %p cmd: %" PRId32 "\n", tag, regs, cmd);
}
svcinfo(" R0: %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 svcinfo(" R0: %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32
" %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 "\n", " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 "\n",
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
-4
View File
@@ -89,16 +89,12 @@ EXTERN const uintptr_t g_stublookup[SYS_nsyscalls];
#endif #endif
#ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL
/* Given the system call number, the corresponding entry in this table /* Given the system call number, the corresponding entry in this table
* provides the name of the function. * provides the name of the function.
*/ */
EXTERN const char *g_funcnames[SYS_nsyscalls]; EXTERN const char *g_funcnames[SYS_nsyscalls];
#endif
/**************************************************************************** /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
****************************************************************************/ ****************************************************************************/
+2
View File
@@ -27,6 +27,8 @@ include wraps/Make.defs
MKSYSCALL = "$(TOPDIR)$(DELIM)tools$(DELIM)mksyscall$(HOSTEXEEXT)" MKSYSCALL = "$(TOPDIR)$(DELIM)tools$(DELIM)mksyscall$(HOSTEXEEXT)"
CSVFILE = "$(TOPDIR)$(DELIM)syscall$(DELIM)syscall.csv" CSVFILE = "$(TOPDIR)$(DELIM)syscall$(DELIM)syscall.csv"
STUB_SRCS += syscall_names.c
ifeq ($(CONFIG_SCHED_INSTRUMENTATION_SYSCALL),y) ifeq ($(CONFIG_SCHED_INSTRUMENTATION_SYSCALL),y)
ifeq ($(CONFIG_LIB_SYSCALL),y) ifeq ($(CONFIG_LIB_SYSCALL),y)
PROXY_SRCS += syscall_names.c PROXY_SRCS += syscall_names.c