mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-22 19:07:20 +03:00
strace: Add formatting for clock_gettime
This commit is contained in:
parent
78de54f0f1
commit
1409cc8395
Notes:
sideshowbarker
2024-07-18 02:48:02 +09:00
Author: https://github.com/rtobar Commit: https://github.com/SerenityOS/serenity/commit/1409cc8395f Pull-request: https://github.com/SerenityOS/serenity/pull/10439
@ -195,6 +195,13 @@ HANDLE(PF_INET)
|
||||
HANDLE(PF_INET6)
|
||||
END_VALUES_TO_NAMES()
|
||||
|
||||
VALUES_TO_NAMES(clockid_name)
|
||||
HANDLE(CLOCK_REALTIME)
|
||||
HANDLE(CLOCK_MONOTONIC)
|
||||
HANDLE(CLOCK_REALTIME_COARSE)
|
||||
HANDLE(CLOCK_MONOTONIC_COARSE)
|
||||
END_VALUES_TO_NAMES()
|
||||
|
||||
static int g_pid = -1;
|
||||
|
||||
#if ARCH(I386)
|
||||
@ -619,6 +626,11 @@ static void format_set_mmap_name(FormattedSyscallBuilder& builder, Syscall::SC_s
|
||||
builder.add_string_argument(params.name);
|
||||
}
|
||||
|
||||
static void format_clock_gettime(FormattedSyscallBuilder& builder, clockid_t clockid, struct timespec* time)
|
||||
{
|
||||
builder.add_arguments(clockid_name(clockid), copy_from_process(time));
|
||||
}
|
||||
|
||||
static void format_syscall(FormattedSyscallBuilder& builder, Syscall::Function syscall_function, syscall_arg_t arg1, syscall_arg_t arg2, syscall_arg_t arg3, syscall_arg_t res)
|
||||
{
|
||||
enum ResultType {
|
||||
@ -693,6 +705,9 @@ static void format_syscall(FormattedSyscallBuilder& builder, Syscall::Function s
|
||||
case SC_set_mmap_name:
|
||||
format_set_mmap_name(builder, (Syscall::SC_set_mmap_name_params*)arg1);
|
||||
break;
|
||||
case SC_clock_gettime:
|
||||
format_clock_gettime(builder, (clockid_t)arg1, (struct timespec*)arg2);
|
||||
break;
|
||||
default:
|
||||
builder.add_arguments((void*)arg1, (void*)arg2, (void*)arg3);
|
||||
result_type = VoidP;
|
||||
|
Loading…
Reference in New Issue
Block a user