FP: Argument and type names for Linux?

4 views
Skip to first unread message

Bartłomiej Gajda

unread,
Jul 1, 2026, 5:55:47 PM (8 days ago) Jul 1
to Dr. Memory Users
Hi,
I've been building a Linux-main DynamoRIO/DrMemory tracer client, whose one of the task is logging syscalls using drsys_iterate_args() and noticed that drsys_arg_t.arg_name is always NULL for Linux syscalls, while Windows works much better. I think I understand why, and wanted to raise and discuss it before attempting a patch:

arg_name is only written at report_memarg_ex() in drsyscall/drsyscall.c, which is in turn reached from report_memarg_type(). On Windows, most NtXYZ syscalls have dedicated handlers, e.g. in drsyscall_windows.c. On Linux, we mostly rely on the static table in table_linux.c.
Furthermore, report_memarg_ex is only called for memory-referencing arguments. Inlined scalar args (fd, flags, counts, anything with SYSARG_INLINED) go through a completely separate path in the drsys_iterate_args() iterator that never calls report_memarg_ex, so arg_name is never set for them regardless of platform.

I think that a good solution would be to introduce a const char* arg_name field in sysinfo_arg_t from drsyscall_os.h - it already defines type_name, add arg->arg_name = sysinfo->arg[compacted].arg_name in the inline scalar branch and populate the field in table_linux.c for the syscalls that need it.
As I said, that's my first contribution to this framework, so I mightve missed something, but I'm willing to work on it
Greets, Bartek

Derek Bruening

unread,
Jul 7, 2026, 8:55:58 PM (2 days ago) Jul 7
to drmemor...@googlegroups.com
Thank you for your interest in contributing. Your plan sounds reasonable to me: happy to look at a pull request. Note that drsyscall was moved to the dynamorio repository as part of https://github.com/DynamoRIO/dynamorio/issues/7303 (drmemory still needs to be updated to use the new location and then remove it from the drmemory repository).

--

---
You received this message because you are subscribed to the Google Groups "Dr. Memory Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drmemory-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/drmemory-users/1538a759-74b7-471b-82a9-a51ffeb35dccn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages