1
0
Fork 0
forked from nuttx/nuttx-update

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

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.
*/
svcinfo("SYSCALL %s: regs: %p cmd: %" PRId32 "\n", tag, regs, cmd);
#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(" R0: %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32
" %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 "\n",
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],

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.
*/
svcinfo("SYSCALL %s: regs: %p cmd: %" PRId32 "\n", tag, regs, cmd);
#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(" R0: %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32
" %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 "\n",
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],

View file

@ -89,16 +89,12 @@ EXTERN const uintptr_t g_stublookup[SYS_nsyscalls];
#endif
#ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL
/* Given the system call number, the corresponding entry in this table
* provides the name of the function.
*/
EXTERN const char *g_funcnames[SYS_nsyscalls];
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/

View file

@ -27,6 +27,8 @@ include wraps/Make.defs
MKSYSCALL = "$(TOPDIR)$(DELIM)tools$(DELIM)mksyscall$(HOSTEXEEXT)"
CSVFILE = "$(TOPDIR)$(DELIM)syscall$(DELIM)syscall.csv"
STUB_SRCS += syscall_names.c
ifeq ($(CONFIG_SCHED_INSTRUMENTATION_SYSCALL),y)
ifeq ($(CONFIG_LIB_SYSCALL),y)
PROXY_SRCS += syscall_names.c