vdso

High System CPU usage because of system.currentTimeMillis()

假如想象 提交于 2021-02-08 12:22:41
问题 I was debugging high System CPU usage (Not user CPU usage) on of our storm supervisors (Wheezy machine). Here are the observations Output of perf for the relevant process: Events: 10K cpu-clock 16.40% java [kernel.kallsyms] [k] system_call_after_swapgs 13.95% java [kernel.kallsyms] [k] pvclock_clocksource_read 12.76% java [kernel.kallsyms] [k] do_gettimeofday 12.61% java [vdso] [.] 0x7ffe0fea898f 9.02% java perf-17609.map [.] 0x7fcabb8b85dc 7.16% java [kernel.kallsyms] [k] copy_user_enhanced

Capture vDSO in strace

感情迁移 提交于 2019-12-08 17:40:06
问题 I was wondering if there is a way to capture (in other words observe) vDSO calls like gettimeofday in strace . Also, is there a way to execute a binary without loading linux-vdso.so.1 (a flag or env variable)? And lastly, what if I write a program that delete the linux-vdso.so.1 address from the auxiliary vector and then execve my program? Has anyone ever tried that? 回答1: You can capture calls to system calls which have been implemented via the vDSO by using ltrace instead of strace . This is

Linux syscall, libc, VDSO and implementation dissection

狂风中的少年 提交于 2019-12-01 16:47:10
I dissects the syscall call in the last libc: git clone git://sourceware.org/git/glibc.git And I have this code in sysdeps/unix/sysv/linux/i386/sysdep.h: # define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \ LOADREGS_##nr(args) \ asm volatile ( \ "call *%%gs:%P2" \ : "=a" (resultvar) \ : "a" (__NR_##name), "i" (offsetof (tcbhead_t, sysinfo)) \ ASMARGS_##nr(args) : "memory", "cc") If I understand well this code, the LOADREGS_##nr(args) macro loads the argument in the registers ebx, ecx, edx, esi, edx and ebp. sysdeps/unix/sysv/linux/i386/sysdep.h # define LOADREGS_0() # define ASMARGS

Linux syscall, libc, VDSO and implementation dissection

旧巷老猫 提交于 2019-12-01 15:27:49
问题 I dissects the syscall call in the last libc: git clone git://sourceware.org/git/glibc.git And I have this code in sysdeps/unix/sysv/linux/i386/sysdep.h: # define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \ LOADREGS_##nr(args) \ asm volatile ( \ "call *%%gs:%P2" \ : "=a" (resultvar) \ : "a" (__NR_##name), "i" (offsetof (tcbhead_t, sysinfo)) \ ASMARGS_##nr(args) : "memory", "cc") If I understand well this code, the LOADREGS_##nr(args) macro loads the argument in the registers ebx,

What are vdso and vsyscall?

余生颓废 提交于 2019-11-26 15:42:15
I did sudo cat /proc/1/maps -vv I am attempting to make sense of the output.I can see a lot of shared libraries being mapped to the memory mapping segment as expected. 7f3c00137000-7f3c00179000 r-xp 00000000 08:01 21233923 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7f3c00179000-7f3c00379000 ---p 00042000 08:01 21233923 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7f3c00379000-7f3c0037a000 r--p 00042000 08:01 21233923 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7f3c0037a000-7f3c0037b000 rw-p 00043000 08:01 21233923 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7f3c0037b000-7f3c00383000 r-xp 00000000 08:01

What are vdso and vsyscall?

谁说胖子不能爱 提交于 2019-11-26 04:34:01
问题 I did sudo cat /proc/1/maps -vv I am attempting to make sense of the output.I can see a lot of shared libraries being mapped to the memory mapping segment as expected. 7f3c00137000-7f3c00179000 r-xp 00000000 08:01 21233923 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7f3c00179000-7f3c00379000 ---p 00042000 08:01 21233923 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7f3c00379000-7f3c0037a000 r--p 00042000 08:01 21233923 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7f3c0037a000-7f3c0037b000 rw-p 00043000