Merge tag 'perf-tools-2020-12-24' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux

Pull more perf tools updates from Arnaldo Carvalho de Melo:

- Refactor 'perf stat' per CPU/socket/die/thread aggregation fixing use
cases in ARM machines.

- Fix memory leak when synthesizing SDT probes in 'perf probe'.

- Update kernel header copies related to KVM, epol_pwait. msr-index and
powerpc and s390 syscall tables.

* tag 'perf-tools-2020-12-24' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (24 commits)
perf probe: Fix memory leak when synthesizing SDT probes
perf stat aggregation: Add separate thread member
perf stat aggregation: Add separate core member
perf stat aggregation: Add separate die member
perf stat aggregation: Add separate socket member
perf stat aggregation: Add separate node member
perf stat aggregation: Start using cpu_aggr_id in map
perf cpumap: Drop in cpu_aggr_map struct
perf cpumap: Add new map type for aggregation
perf stat: Replace aggregation ID with a struct
perf cpumap: Add new struct for cpu aggregation
perf cpumap: Use existing allocator to avoid using malloc
perf tests: Improve topology test to check all aggregation types
perf tools: Update s390's syscall.tbl copy from the kernel sources
perf tools: Update powerpc's syscall.tbl copy from the kernel sources
perf s390: Move syscall.tbl check into check-headers.sh
perf powerpc: Move syscall.tbl check to check-headers.sh
tools headers UAPI: Synch KVM's svm.h header with the kernel
tools kvm headers: Update KVM headers from the kernel sources
tools headers UAPI: Sync KVM's vmx.h header with the kernel sources
...

+689 -392
-3
tools/arch/arm64/include/uapi/asm/kvm.h
··· 156 156 __u64 device_irq_level; 157 157 }; 158 158 159 - struct kvm_arch_memory_slot { 160 - }; 161 - 162 159 /* 163 160 * PMU filter structure. Describe a range of events with a particular 164 161 * action. To be used with KVM_ARM_VCPU_PMU_V3_FILTER.
+2
tools/arch/x86/include/asm/cpufeatures.h
··· 237 237 #define X86_FEATURE_VMCALL ( 8*32+18) /* "" Hypervisor supports the VMCALL instruction */ 238 238 #define X86_FEATURE_VMW_VMMCALL ( 8*32+19) /* "" VMware prefers VMMCALL hypercall instruction */ 239 239 #define X86_FEATURE_SEV_ES ( 8*32+20) /* AMD Secure Encrypted Virtualization - Encrypted State */ 240 + #define X86_FEATURE_VM_PAGE_FLUSH ( 8*32+21) /* "" VM Page Flush MSR is supported */ 240 241 241 242 /* Intel-defined CPU features, CPUID level 0x00000007:0 (EBX), word 9 */ 242 243 #define X86_FEATURE_FSGSBASE ( 9*32+ 0) /* RDFSBASE, WRFSBASE, RDGSBASE, WRGSBASE instructions*/ ··· 377 376 #define X86_FEATURE_TSXLDTRK (18*32+16) /* TSX Suspend Load Address Tracking */ 378 377 #define X86_FEATURE_PCONFIG (18*32+18) /* Intel PCONFIG */ 379 378 #define X86_FEATURE_ARCH_LBR (18*32+19) /* Intel ARCH LBR */ 379 + #define X86_FEATURE_AVX512_FP16 (18*32+23) /* AVX512 FP16 */ 380 380 #define X86_FEATURE_SPEC_CTRL (18*32+26) /* "" Speculation Control (IBRS + IBPB) */ 381 381 #define X86_FEATURE_INTEL_STIBP (18*32+27) /* "" Single Thread Indirect Branch Predictors */ 382 382 #define X86_FEATURE_FLUSH_L1D (18*32+28) /* Flush L1D cache */
+1
tools/arch/x86/include/asm/msr-index.h
··· 472 472 #define MSR_AMD64_ICIBSEXTDCTL 0xc001103c 473 473 #define MSR_AMD64_IBSOPDATA4 0xc001103d 474 474 #define MSR_AMD64_IBS_REG_COUNT_MAX 8 /* includes MSR_AMD64_IBSBRTARGET */ 475 + #define MSR_AMD64_VM_PAGE_FLUSH 0xc001011e 475 476 #define MSR_AMD64_SEV_ES_GHCB 0xc0010130 476 477 #define MSR_AMD64_SEV 0xc0010131 477 478 #define MSR_AMD64_SEV_ENABLED_BIT 0
+1
tools/arch/x86/include/uapi/asm/kvm.h
··· 12 12 13 13 #define KVM_PIO_PAGE_OFFSET 1 14 14 #define KVM_COALESCED_MMIO_PAGE_OFFSET 2 15 + #define KVM_DIRTY_LOG_PAGE_OFFSET 64 15 16 16 17 #define DE_VECTOR 0 17 18 #define DB_VECTOR 1
+28
tools/arch/x86/include/uapi/asm/svm.h
··· 77 77 #define SVM_EXIT_MWAIT_COND 0x08c 78 78 #define SVM_EXIT_XSETBV 0x08d 79 79 #define SVM_EXIT_RDPRU 0x08e 80 + #define SVM_EXIT_EFER_WRITE_TRAP 0x08f 81 + #define SVM_EXIT_CR0_WRITE_TRAP 0x090 82 + #define SVM_EXIT_CR1_WRITE_TRAP 0x091 83 + #define SVM_EXIT_CR2_WRITE_TRAP 0x092 84 + #define SVM_EXIT_CR3_WRITE_TRAP 0x093 85 + #define SVM_EXIT_CR4_WRITE_TRAP 0x094 86 + #define SVM_EXIT_CR5_WRITE_TRAP 0x095 87 + #define SVM_EXIT_CR6_WRITE_TRAP 0x096 88 + #define SVM_EXIT_CR7_WRITE_TRAP 0x097 89 + #define SVM_EXIT_CR8_WRITE_TRAP 0x098 90 + #define SVM_EXIT_CR9_WRITE_TRAP 0x099 91 + #define SVM_EXIT_CR10_WRITE_TRAP 0x09a 92 + #define SVM_EXIT_CR11_WRITE_TRAP 0x09b 93 + #define SVM_EXIT_CR12_WRITE_TRAP 0x09c 94 + #define SVM_EXIT_CR13_WRITE_TRAP 0x09d 95 + #define SVM_EXIT_CR14_WRITE_TRAP 0x09e 96 + #define SVM_EXIT_CR15_WRITE_TRAP 0x09f 80 97 #define SVM_EXIT_INVPCID 0x0a2 81 98 #define SVM_EXIT_NPF 0x400 82 99 #define SVM_EXIT_AVIC_INCOMPLETE_IPI 0x401 83 100 #define SVM_EXIT_AVIC_UNACCELERATED_ACCESS 0x402 101 + #define SVM_EXIT_VMGEXIT 0x403 84 102 85 103 /* SEV-ES software-defined VMGEXIT events */ 86 104 #define SVM_VMGEXIT_MMIO_READ 0x80000001 ··· 201 183 { SVM_EXIT_MONITOR, "monitor" }, \ 202 184 { SVM_EXIT_MWAIT, "mwait" }, \ 203 185 { SVM_EXIT_XSETBV, "xsetbv" }, \ 186 + { SVM_EXIT_EFER_WRITE_TRAP, "write_efer_trap" }, \ 187 + { SVM_EXIT_CR0_WRITE_TRAP, "write_cr0_trap" }, \ 188 + { SVM_EXIT_CR4_WRITE_TRAP, "write_cr4_trap" }, \ 189 + { SVM_EXIT_CR8_WRITE_TRAP, "write_cr8_trap" }, \ 204 190 { SVM_EXIT_INVPCID, "invpcid" }, \ 205 191 { SVM_EXIT_NPF, "npf" }, \ 206 192 { SVM_EXIT_AVIC_INCOMPLETE_IPI, "avic_incomplete_ipi" }, \ 207 193 { SVM_EXIT_AVIC_UNACCELERATED_ACCESS, "avic_unaccelerated_access" }, \ 194 + { SVM_EXIT_VMGEXIT, "vmgexit" }, \ 195 + { SVM_VMGEXIT_MMIO_READ, "vmgexit_mmio_read" }, \ 196 + { SVM_VMGEXIT_MMIO_WRITE, "vmgexit_mmio_write" }, \ 197 + { SVM_VMGEXIT_NMI_COMPLETE, "vmgexit_nmi_complete" }, \ 198 + { SVM_VMGEXIT_AP_HLT_LOOP, "vmgexit_ap_hlt_loop" }, \ 199 + { SVM_VMGEXIT_AP_JUMP_TABLE, "vmgexit_ap_jump_table" }, \ 208 200 { SVM_EXIT_ERR, "invalid_guest_state" } 209 201 210 202
+2
tools/arch/x86/include/uapi/asm/vmx.h
··· 32 32 #define EXIT_REASON_EXTERNAL_INTERRUPT 1 33 33 #define EXIT_REASON_TRIPLE_FAULT 2 34 34 #define EXIT_REASON_INIT_SIGNAL 3 35 + #define EXIT_REASON_SIPI_SIGNAL 4 35 36 36 37 #define EXIT_REASON_INTERRUPT_WINDOW 7 37 38 #define EXIT_REASON_NMI_WINDOW 8 ··· 95 94 { EXIT_REASON_EXTERNAL_INTERRUPT, "EXTERNAL_INTERRUPT" }, \ 96 95 { EXIT_REASON_TRIPLE_FAULT, "TRIPLE_FAULT" }, \ 97 96 { EXIT_REASON_INIT_SIGNAL, "INIT_SIGNAL" }, \ 97 + { EXIT_REASON_SIPI_SIGNAL, "SIPI_SIGNAL" }, \ 98 98 { EXIT_REASON_INTERRUPT_WINDOW, "INTERRUPT_WINDOW" }, \ 99 99 { EXIT_REASON_NMI_WINDOW, "NMI_WINDOW" }, \ 100 100 { EXIT_REASON_TASK_SWITCH, "TASK_SWITCH" }, \
+3 -1
tools/include/uapi/asm-generic/unistd.h
··· 859 859 __SYSCALL(__NR_faccessat2, sys_faccessat2) 860 860 #define __NR_process_madvise 440 861 861 __SYSCALL(__NR_process_madvise, sys_process_madvise) 862 + #define __NR_epoll_pwait2 441 863 + __SC_COMP(__NR_epoll_pwait2, sys_epoll_pwait2, compat_sys_epoll_pwait2) 862 864 863 865 #undef __NR_syscalls 864 - #define __NR_syscalls 441 866 + #define __NR_syscalls 442 865 867 866 868 /* 867 869 * 32 bit systems traditionally used different
+55 -1
tools/include/uapi/linux/kvm.h
··· 250 250 #define KVM_EXIT_ARM_NISV 28 251 251 #define KVM_EXIT_X86_RDMSR 29 252 252 #define KVM_EXIT_X86_WRMSR 30 253 + #define KVM_EXIT_DIRTY_RING_FULL 31 253 254 254 255 /* For KVM_EXIT_INTERNAL_ERROR */ 255 256 /* Emulate instruction failed. */ ··· 1054 1053 #define KVM_CAP_X86_USER_SPACE_MSR 188 1055 1054 #define KVM_CAP_X86_MSR_FILTER 189 1056 1055 #define KVM_CAP_ENFORCE_PV_FEATURE_CPUID 190 1056 + #define KVM_CAP_SYS_HYPERV_CPUID 191 1057 + #define KVM_CAP_DIRTY_LOG_RING 192 1057 1058 1058 1059 #ifdef KVM_CAP_IRQ_ROUTING 1059 1060 ··· 1514 1511 /* Available with KVM_CAP_MANUAL_DIRTY_LOG_PROTECT_2 */ 1515 1512 #define KVM_CLEAR_DIRTY_LOG _IOWR(KVMIO, 0xc0, struct kvm_clear_dirty_log) 1516 1513 1517 - /* Available with KVM_CAP_HYPERV_CPUID */ 1514 + /* Available with KVM_CAP_HYPERV_CPUID (vcpu) / KVM_CAP_SYS_HYPERV_CPUID (system) */ 1518 1515 #define KVM_GET_SUPPORTED_HV_CPUID _IOWR(KVMIO, 0xc1, struct kvm_cpuid2) 1519 1516 1520 1517 /* Available with KVM_CAP_ARM_SVE */ ··· 1559 1556 1560 1557 /* Available with KVM_CAP_X86_MSR_FILTER */ 1561 1558 #define KVM_X86_SET_MSR_FILTER _IOW(KVMIO, 0xc6, struct kvm_msr_filter) 1559 + 1560 + /* Available with KVM_CAP_DIRTY_LOG_RING */ 1561 + #define KVM_RESET_DIRTY_RINGS _IO(KVMIO, 0xc7) 1562 1562 1563 1563 /* Secure Encrypted Virtualization command */ 1564 1564 enum sev_cmd_id { ··· 1715 1709 1716 1710 #define KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE (1 << 0) 1717 1711 #define KVM_DIRTY_LOG_INITIALLY_SET (1 << 1) 1712 + 1713 + /* 1714 + * Arch needs to define the macro after implementing the dirty ring 1715 + * feature. KVM_DIRTY_LOG_PAGE_OFFSET should be defined as the 1716 + * starting page offset of the dirty ring structures. 1717 + */ 1718 + #ifndef KVM_DIRTY_LOG_PAGE_OFFSET 1719 + #define KVM_DIRTY_LOG_PAGE_OFFSET 0 1720 + #endif 1721 + 1722 + /* 1723 + * KVM dirty GFN flags, defined as: 1724 + * 1725 + * |---------------+---------------+--------------| 1726 + * | bit 1 (reset) | bit 0 (dirty) | Status | 1727 + * |---------------+---------------+--------------| 1728 + * | 0 | 0 | Invalid GFN | 1729 + * | 0 | 1 | Dirty GFN | 1730 + * | 1 | X | GFN to reset | 1731 + * |---------------+---------------+--------------| 1732 + * 1733 + * Lifecycle of a dirty GFN goes like: 1734 + * 1735 + * dirtied harvested reset 1736 + * 00 -----------> 01 -------------> 1X -------+ 1737 + * ^ | 1738 + * | | 1739 + * +------------------------------------------+ 1740 + * 1741 + * The userspace program is only responsible for the 01->1X state 1742 + * conversion after harvesting an entry. Also, it must not skip any 1743 + * dirty bits, so that dirty bits are always harvested in sequence. 1744 + */ 1745 + #define KVM_DIRTY_GFN_F_DIRTY BIT(0) 1746 + #define KVM_DIRTY_GFN_F_RESET BIT(1) 1747 + #define KVM_DIRTY_GFN_F_MASK 0x3 1748 + 1749 + /* 1750 + * KVM dirty rings should be mapped at KVM_DIRTY_LOG_PAGE_OFFSET of 1751 + * per-vcpu mmaped regions as an array of struct kvm_dirty_gfn. The 1752 + * size of the gfn buffer is decided by the first argument when 1753 + * enabling KVM_CAP_DIRTY_LOG_RING. 1754 + */ 1755 + struct kvm_dirty_gfn { 1756 + __u32 flags; 1757 + __u32 slot; 1758 + __u64 offset; 1759 + }; 1718 1760 1719 1761 #endif /* __LINUX_KVM_H */
-7
tools/perf/arch/powerpc/Makefile
··· 14 14 out := $(OUTPUT)arch/powerpc/include/generated/asm 15 15 header32 := $(out)/syscalls_32.c 16 16 header64 := $(out)/syscalls_64.c 17 - syskrn := $(srctree)/arch/powerpc/kernel/syscalls/syscall.tbl 18 17 sysprf := $(srctree)/tools/perf/arch/powerpc/entry/syscalls 19 18 sysdef := $(sysprf)/syscall.tbl 20 19 systbl := $(sysprf)/mksyscalltbl ··· 22 23 _dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)') 23 24 24 25 $(header64): $(sysdef) $(systbl) 25 - @(test -d ../../kernel -a -d ../../tools -a -d ../perf && ( \ 26 - (diff -B $(sysdef) $(syskrn) >/dev/null) \ 27 - || echo "Warning: Kernel ABI header at '$(sysdef)' differs from latest version at '$(syskrn)'" >&2 )) || true 28 26 $(Q)$(SHELL) '$(systbl)' '64' $(sysdef) > $@ 29 27 30 28 $(header32): $(sysdef) $(systbl) 31 - @(test -d ../../kernel -a -d ../../tools -a -d ../perf && ( \ 32 - (diff -B $(sysdef) $(syskrn) >/dev/null) \ 33 - || echo "Warning: Kernel ABI header at '$(sysdef)' differs from latest version at '$(syskrn)'" >&2 )) || true 34 29 $(Q)$(SHELL) '$(systbl)' '32' $(sysdef) > $@ 35 30 36 31 clean::
+19 -7
tools/perf/arch/powerpc/entry/syscalls/syscall.tbl
··· 9 9 # 10 10 0 nospu restart_syscall sys_restart_syscall 11 11 1 nospu exit sys_exit 12 - 2 nospu fork ppc_fork 12 + 2 32 fork ppc_fork sys_fork 13 + 2 64 fork sys_fork 14 + 2 spu fork sys_ni_syscall 13 15 3 common read sys_read 14 16 4 common write sys_write 15 17 5 common open sys_open compat_sys_open ··· 160 158 119 32 sigreturn sys_sigreturn compat_sys_sigreturn 161 159 119 64 sigreturn sys_ni_syscall 162 160 119 spu sigreturn sys_ni_syscall 163 - 120 nospu clone ppc_clone 161 + 120 32 clone ppc_clone sys_clone 162 + 120 64 clone sys_clone 163 + 120 spu clone sys_ni_syscall 164 164 121 common setdomainname sys_setdomainname 165 165 122 common uname sys_newuname 166 166 123 common modify_ldt sys_ni_syscall ··· 244 240 186 spu sendfile sys_sendfile64 245 241 187 common getpmsg sys_ni_syscall 246 242 188 common putpmsg sys_ni_syscall 247 - 189 nospu vfork ppc_vfork 243 + 189 32 vfork ppc_vfork sys_vfork 244 + 189 64 vfork sys_vfork 245 + 189 spu vfork sys_ni_syscall 248 246 190 common ugetrlimit sys_getrlimit compat_sys_getrlimit 249 247 191 common readahead sys_readahead compat_sys_readahead 250 248 192 32 mmap2 sys_mmap2 compat_sys_mmap2 ··· 322 316 248 32 clock_nanosleep sys_clock_nanosleep_time32 323 317 248 64 clock_nanosleep sys_clock_nanosleep 324 318 248 spu clock_nanosleep sys_clock_nanosleep 325 - 249 32 swapcontext ppc_swapcontext ppc32_swapcontext 326 - 249 64 swapcontext ppc64_swapcontext 319 + 249 32 swapcontext ppc_swapcontext compat_sys_swapcontext 320 + 249 64 swapcontext sys_swapcontext 327 321 249 spu swapcontext sys_ni_syscall 328 322 250 common tgkill sys_tgkill 329 323 251 32 utimes sys_utimes_time32 ··· 462 456 361 common bpf sys_bpf 463 457 362 nospu execveat sys_execveat compat_sys_execveat 464 458 363 32 switch_endian sys_ni_syscall 465 - 363 64 switch_endian ppc_switch_endian 459 + 363 64 switch_endian sys_switch_endian 466 460 363 spu switch_endian sys_ni_syscall 467 461 364 common userfaultfd sys_userfaultfd 468 462 365 common membarrier sys_membarrier ··· 522 516 432 common fsmount sys_fsmount 523 517 433 common fspick sys_fspick 524 518 434 common pidfd_open sys_pidfd_open 525 - 435 nospu clone3 ppc_clone3 519 + 435 32 clone3 ppc_clone3 sys_clone3 520 + 435 64 clone3 sys_clone3 521 + 435 spu clone3 sys_ni_syscall 522 + 436 common close_range sys_close_range 526 523 437 common openat2 sys_openat2 527 524 438 common pidfd_getfd sys_pidfd_getfd 525 + 439 common faccessat2 sys_faccessat2 526 + 440 common process_madvise sys_process_madvise 527 + 441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
-4
tools/perf/arch/s390/Makefile
··· 12 12 13 13 out := $(OUTPUT)arch/s390/include/generated/asm 14 14 header := $(out)/syscalls_64.c 15 - syskrn := $(srctree)/arch/s390/kernel/syscalls/syscall.tbl 16 15 sysprf := $(srctree)/tools/perf/arch/s390/entry/syscalls 17 16 sysdef := $(sysprf)/syscall.tbl 18 17 systbl := $(sysprf)/mksyscalltbl ··· 20 21 _dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)') 21 22 22 23 $(header): $(sysdef) $(systbl) 23 - @(test -d ../../kernel -a -d ../../tools -a -d ../perf && ( \ 24 - (diff -B $(sysdef) $(syskrn) >/dev/null) \ 25 - || echo "Warning: Kernel ABI header at '$(sysdef)' differs from latest version at '$(syskrn)'" >&2 )) || true 26 24 $(Q)$(SHELL) '$(systbl)' $(sysdef) > $@ 27 25 28 26 clean::
+226 -170
tools/perf/arch/s390/entry/syscalls/syscall.tbl
··· 15 15 5 common open sys_open compat_sys_open 16 16 6 common close sys_close sys_close 17 17 7 common restart_syscall sys_restart_syscall sys_restart_syscall 18 - 8 common creat sys_creat compat_sys_creat 19 - 9 common link sys_link compat_sys_link 20 - 10 common unlink sys_unlink compat_sys_unlink 18 + 8 common creat sys_creat sys_creat 19 + 9 common link sys_link sys_link 20 + 10 common unlink sys_unlink sys_unlink 21 21 11 common execve sys_execve compat_sys_execve 22 - 12 common chdir sys_chdir compat_sys_chdir 23 - 13 32 time - compat_sys_time 24 - 14 common mknod sys_mknod compat_sys_mknod 25 - 15 common chmod sys_chmod compat_sys_chmod 26 - 16 32 lchown - compat_sys_s390_lchown16 22 + 12 common chdir sys_chdir sys_chdir 23 + 13 32 time - sys_time32 24 + 14 common mknod sys_mknod sys_mknod 25 + 15 common chmod sys_chmod sys_chmod 26 + 16 32 lchown - sys_lchown16 27 27 19 common lseek sys_lseek compat_sys_lseek 28 28 20 common getpid sys_getpid sys_getpid 29 - 21 common mount sys_mount 30 - 22 common umount sys_oldumount compat_sys_oldumount 31 - 23 32 setuid - compat_sys_s390_setuid16 32 - 24 32 getuid - compat_sys_s390_getuid16 33 - 25 32 stime - compat_sys_stime 29 + 21 common mount sys_mount sys_mount 30 + 22 common umount sys_oldumount sys_oldumount 31 + 23 32 setuid - sys_setuid16 32 + 24 32 getuid - sys_getuid16 33 + 25 32 stime - sys_stime32 34 34 26 common ptrace sys_ptrace compat_sys_ptrace 35 35 27 common alarm sys_alarm sys_alarm 36 36 29 common pause sys_pause sys_pause 37 - 30 common utime sys_utime compat_sys_utime 38 - 33 common access sys_access compat_sys_access 37 + 30 common utime sys_utime sys_utime32 38 + 33 common access sys_access sys_access 39 39 34 common nice sys_nice sys_nice 40 40 36 common sync sys_sync sys_sync 41 41 37 common kill sys_kill sys_kill 42 - 38 common rename sys_rename compat_sys_rename 43 - 39 common mkdir sys_mkdir compat_sys_mkdir 44 - 40 common rmdir sys_rmdir compat_sys_rmdir 42 + 38 common rename sys_rename sys_rename 43 + 39 common mkdir sys_mkdir sys_mkdir 44 + 40 common rmdir sys_rmdir sys_rmdir 45 45 41 common dup sys_dup sys_dup 46 - 42 common pipe sys_pipe compat_sys_pipe 46 + 42 common pipe sys_pipe sys_pipe 47 47 43 common times sys_times compat_sys_times 48 - 45 common brk sys_brk compat_sys_brk 49 - 46 32 setgid - compat_sys_s390_setgid16 50 - 47 32 getgid - compat_sys_s390_getgid16 51 - 48 common signal sys_signal compat_sys_signal 52 - 49 32 geteuid - compat_sys_s390_geteuid16 53 - 50 32 getegid - compat_sys_s390_getegid16 54 - 51 common acct sys_acct compat_sys_acct 55 - 52 common umount2 sys_umount compat_sys_umount 48 + 45 common brk sys_brk sys_brk 49 + 46 32 setgid - sys_setgid16 50 + 47 32 getgid - sys_getgid16 51 + 48 common signal sys_signal sys_signal 52 + 49 32 geteuid - sys_geteuid16 53 + 50 32 getegid - sys_getegid16 54 + 51 common acct sys_acct sys_acct 55 + 52 common umount2 sys_umount sys_umount 56 56 54 common ioctl sys_ioctl compat_sys_ioctl 57 57 55 common fcntl sys_fcntl compat_sys_fcntl 58 58 57 common setpgid sys_setpgid sys_setpgid 59 59 60 common umask sys_umask sys_umask 60 - 61 common chroot sys_chroot compat_sys_chroot 60 + 61 common chroot sys_chroot sys_chroot 61 61 62 common ustat sys_ustat compat_sys_ustat 62 62 63 common dup2 sys_dup2 sys_dup2 63 63 64 common getppid sys_getppid sys_getppid 64 64 65 common getpgrp sys_getpgrp sys_getpgrp 65 65 66 common setsid sys_setsid sys_setsid 66 66 67 common sigaction sys_sigaction compat_sys_sigaction 67 - 70 32 setreuid - compat_sys_s390_setreuid16 68 - 71 32 setregid - compat_sys_s390_setregid16 69 - 72 common sigsuspend sys_sigsuspend compat_sys_sigsuspend 67 + 70 32 setreuid - sys_setreuid16 68 + 71 32 setregid - sys_setregid16 69 + 72 common sigsuspend sys_sigsuspend sys_sigsuspend 70 70 73 common sigpending sys_sigpending compat_sys_sigpending 71 - 74 common sethostname sys_sethostname compat_sys_sethostname 71 + 74 common sethostname sys_sethostname sys_sethostname 72 72 75 common setrlimit sys_setrlimit compat_sys_setrlimit 73 73 76 32 getrlimit - compat_sys_old_getrlimit 74 74 77 common getrusage sys_getrusage compat_sys_getrusage 75 75 78 common gettimeofday sys_gettimeofday compat_sys_gettimeofday 76 76 79 common settimeofday sys_settimeofday compat_sys_settimeofday 77 - 80 32 getgroups - compat_sys_s390_getgroups16 78 - 81 32 setgroups - compat_sys_s390_setgroups16 79 - 83 common symlink sys_symlink compat_sys_symlink 80 - 85 common readlink sys_readlink compat_sys_readlink 81 - 86 common uselib sys_uselib compat_sys_uselib 82 - 87 common swapon sys_swapon compat_sys_swapon 83 - 88 common reboot sys_reboot compat_sys_reboot 77 + 80 32 getgroups - sys_getgroups16 78 + 81 32 setgroups - sys_setgroups16 79 + 83 common symlink sys_symlink sys_symlink 80 + 85 common readlink sys_readlink sys_readlink 81 + 86 common uselib sys_uselib sys_uselib 82 + 87 common swapon sys_swapon sys_swapon 83 + 88 common reboot sys_reboot sys_reboot 84 84 89 common readdir - compat_sys_old_readdir 85 85 90 common mmap sys_old_mmap compat_sys_s390_old_mmap 86 - 91 common munmap sys_munmap compat_sys_munmap 86 + 91 common munmap sys_munmap sys_munmap 87 87 92 common truncate sys_truncate compat_sys_truncate 88 88 93 common ftruncate sys_ftruncate compat_sys_ftruncate 89 89 94 common fchmod sys_fchmod sys_fchmod 90 - 95 32 fchown - compat_sys_s390_fchown16 90 + 95 32 fchown - sys_fchown16 91 91 96 common getpriority sys_getpriority sys_getpriority 92 92 97 common setpriority sys_setpriority sys_setpriority 93 93 99 common statfs sys_statfs compat_sys_statfs 94 94 100 common fstatfs sys_fstatfs compat_sys_fstatfs 95 95 101 32 ioperm - - 96 96 102 common socketcall sys_socketcall compat_sys_socketcall 97 - 103 common syslog sys_syslog compat_sys_syslog 97 + 103 common syslog sys_syslog sys_syslog 98 98 104 common setitimer sys_setitimer compat_sys_setitimer 99 99 105 common getitimer sys_getitimer compat_sys_getitimer 100 100 106 common stat sys_newstat compat_sys_newstat ··· 104 104 111 common vhangup sys_vhangup sys_vhangup 105 105 112 common idle - - 106 106 114 common wait4 sys_wait4 compat_sys_wait4 107 - 115 common swapoff sys_swapoff compat_sys_swapoff 107 + 115 common swapoff sys_swapoff sys_swapoff 108 108 116 common sysinfo sys_sysinfo compat_sys_sysinfo 109 109 117 common ipc sys_s390_ipc compat_sys_s390_ipc 110 110 118 common fsync sys_fsync sys_fsync 111 111 119 common sigreturn sys_sigreturn compat_sys_sigreturn 112 - 120 common clone sys_clone compat_sys_clone 113 - 121 common setdomainname sys_setdomainname compat_sys_setdomainname 114 - 122 common uname sys_newuname compat_sys_newuname 115 - 124 common adjtimex sys_adjtimex compat_sys_adjtimex 116 - 125 common mprotect sys_mprotect compat_sys_mprotect 112 + 120 common clone sys_clone sys_clone 113 + 121 common setdomainname sys_setdomainname sys_setdomainname 114 + 122 common uname sys_newuname sys_newuname 115 + 124 common adjtimex sys_adjtimex sys_adjtimex_time32 116 + 125 common mprotect sys_mprotect sys_mprotect 117 117 126 common sigprocmask sys_sigprocmask compat_sys_sigprocmask 118 118 127 common create_module - - 119 - 128 common init_module sys_init_module compat_sys_init_module 120 - 129 common delete_module sys_delete_module compat_sys_delete_module 119 + 128 common init_module sys_init_module sys_init_module 120 + 129 common delete_module sys_delete_module sys_delete_module 121 121 130 common get_kernel_syms - - 122 - 131 common quotactl sys_quotactl compat_sys_quotactl 122 + 131 common quotactl sys_quotactl sys_quotactl 123 123 132 common getpgid sys_getpgid sys_getpgid 124 124 133 common fchdir sys_fchdir sys_fchdir 125 - 134 common bdflush sys_bdflush compat_sys_bdflush 126 - 135 common sysfs sys_sysfs compat_sys_sysfs 125 + 134 common bdflush sys_bdflush sys_bdflush 126 + 135 common sysfs sys_sysfs sys_sysfs 127 127 136 common personality sys_s390_personality sys_s390_personality 128 128 137 common afs_syscall - - 129 - 138 32 setfsuid - compat_sys_s390_setfsuid16 130 - 139 32 setfsgid - compat_sys_s390_setfsgid16 131 - 140 32 _llseek - compat_sys_llseek 129 + 138 32 setfsuid - sys_setfsuid16 130 + 139 32 setfsgid - sys_setfsgid16 131 + 140 32 _llseek - sys_llseek 132 132 141 common getdents sys_getdents compat_sys_getdents 133 133 142 32 _newselect - compat_sys_select 134 134 142 64 select sys_select - 135 135 143 common flock sys_flock sys_flock 136 - 144 common msync sys_msync compat_sys_msync 137 - 145 common readv sys_readv 138 - 146 common writev sys_writev 136 + 144 common msync sys_msync sys_msync 137 + 145 common readv sys_readv sys_readv 138 + 146 common writev sys_writev sys_writev 139 139 147 common getsid sys_getsid sys_getsid 140 140 148 common fdatasync sys_fdatasync sys_fdatasync 141 141 149 common _sysctl - - 142 - 150 common mlock sys_mlock compat_sys_mlock 143 - 151 common munlock sys_munlock compat_sys_munlock 142 + 150 common mlock sys_mlock sys_mlock 143 + 151 common munlock sys_munlock sys_munlock 144 144 152 common mlockall sys_mlockall sys_mlockall 145 145 153 common munlockall sys_munlockall sys_munlockall 146 - 154 common sched_setparam sys_sched_setparam compat_sys_sched_setparam 147 - 155 common sched_getparam sys_sched_getparam compat_sys_sched_getparam 148 - 156 common sched_setscheduler sys_sched_setscheduler compat_sys_sched_setscheduler 146 + 154 common sched_setparam sys_sched_setparam sys_sched_setparam 147 + 155 common sched_getparam sys_sched_getparam sys_sched_getparam 148 + 156 common sched_setscheduler sys_sched_setscheduler sys_sched_setscheduler 149 149 157 common sched_getscheduler sys_sched_getscheduler sys_sched_getscheduler 150 150 158 common sched_yield sys_sched_yield sys_sched_yield 151 151 159 common sched_get_priority_max sys_sched_get_priority_max sys_sched_get_priority_max 152 152 160 common sched_get_priority_min sys_sched_get_priority_min sys_sched_get_priority_min 153 - 161 common sched_rr_get_interval sys_sched_rr_get_interval compat_sys_sched_rr_get_interval 154 - 162 common nanosleep sys_nanosleep compat_sys_nanosleep 155 - 163 common mremap sys_mremap compat_sys_mremap 156 - 164 32 setresuid - compat_sys_s390_setresuid16 157 - 165 32 getresuid - compat_sys_s390_getresuid16 153 + 161 common sched_rr_get_interval sys_sched_rr_get_interval sys_sched_rr_get_interval_time32 154 + 162 common nanosleep sys_nanosleep sys_nanosleep_time32 155 + 163 common mremap sys_mremap sys_mremap 156 + 164 32 setresuid - sys_setresuid16 157 + 165 32 getresuid - sys_getresuid16 158 158 167 common query_module - - 159 - 168 common poll sys_poll compat_sys_poll 159 + 168 common poll sys_poll sys_poll 160 160 169 common nfsservctl - - 161 - 170 32 setresgid - compat_sys_s390_setresgid16 162 - 171 32 getresgid - compat_sys_s390_getresgid16 163 - 172 common prctl sys_prctl compat_sys_prctl 161 + 170 32 setresgid - sys_setresgid16 162 + 171 32 getresgid - sys_getresgid16 163 + 172 common prctl sys_prctl sys_prctl 164 164 173 common rt_sigreturn sys_rt_sigreturn compat_sys_rt_sigreturn 165 165 174 common rt_sigaction sys_rt_sigaction compat_sys_rt_sigaction 166 166 175 common rt_sigprocmask sys_rt_sigprocmask compat_sys_rt_sigprocmask 167 167 176 common rt_sigpending sys_rt_sigpending compat_sys_rt_sigpending 168 - 177 common rt_sigtimedwait sys_rt_sigtimedwait compat_sys_rt_sigtimedwait 168 + 177 common rt_sigtimedwait sys_rt_sigtimedwait compat_sys_rt_sigtimedwait_time32 169 169 178 common rt_sigqueueinfo sys_rt_sigqueueinfo compat_sys_rt_sigqueueinfo 170 170 179 common rt_sigsuspend sys_rt_sigsuspend compat_sys_rt_sigsuspend 171 171 180 common pread64 sys_pread64 compat_sys_s390_pread64 172 172 181 common pwrite64 sys_pwrite64 compat_sys_s390_pwrite64 173 - 182 32 chown - compat_sys_s390_chown16 174 - 183 common getcwd sys_getcwd compat_sys_getcwd 175 - 184 common capget sys_capget compat_sys_capget 176 - 185 common capset sys_capset compat_sys_capset 173 + 182 32 chown - sys_chown16 174 + 183 common getcwd sys_getcwd sys_getcwd 175 + 184 common capget sys_capget sys_capget 176 + 185 common capset sys_capset sys_capset 177 177 186 common sigaltstack sys_sigaltstack compat_sys_sigaltstack 178 178 187 common sendfile sys_sendfile64 compat_sys_sendfile 179 179 188 common getpmsg - - ··· 187 187 195 32 stat64 - compat_sys_s390_stat64 188 188 196 32 lstat64 - compat_sys_s390_lstat64 189 189 197 32 fstat64 - compat_sys_s390_fstat64 190 - 198 32 lchown32 - compat_sys_lchown 190 + 198 32 lchown32 - sys_lchown 191 191 198 64 lchown sys_lchown - 192 192 199 32 getuid32 - sys_getuid 193 193 199 64 getuid sys_getuid - ··· 201 201 203 64 setreuid sys_setreuid - 202 202 204 32 setregid32 - sys_setregid 203 203 204 64 setregid sys_setregid - 204 - 205 32 getgroups32 - compat_sys_getgroups 204 + 205 32 getgroups32 - sys_getgroups 205 205 205 64 getgroups sys_getgroups - 206 - 206 32 setgroups32 - compat_sys_setgroups 206 + 206 32 setgroups32 - sys_setgroups 207 207 206 64 setgroups sys_setgroups - 208 208 207 32 fchown32 - sys_fchown 209 209 207 64 fchown sys_fchown - 210 210 208 32 setresuid32 - sys_setresuid 211 211 208 64 setresuid sys_setresuid - 212 - 209 32 getresuid32 - compat_sys_getresuid 212 + 209 32 getresuid32 - sys_getresuid 213 213 209 64 getresuid sys_getresuid - 214 214 210 32 setresgid32 - sys_setresgid 215 215 210 64 setresgid sys_setresgid - 216 - 211 32 getresgid32 - compat_sys_getresgid 216 + 211 32 getresgid32 - sys_getresgid 217 217 211 64 getresgid sys_getresgid - 218 - 212 32 chown32 - compat_sys_chown 218 + 212 32 chown32 - sys_chown 219 219 212 64 chown sys_chown - 220 220 213 32 setuid32 - sys_setuid 221 221 213 64 setuid sys_setuid - ··· 225 225 215 64 setfsuid sys_setfsuid - 226 226 216 32 setfsgid32 - sys_setfsgid 227 227 216 64 setfsgid sys_setfsgid - 228 - 217 common pivot_root sys_pivot_root compat_sys_pivot_root 229 - 218 common mincore sys_mincore compat_sys_mincore 230 - 219 common madvise sys_madvise compat_sys_madvise 231 - 220 common getdents64 sys_getdents64 compat_sys_getdents64 228 + 217 common pivot_root sys_pivot_root sys_pivot_root 229 + 218 common mincore sys_mincore sys_mincore 230 + 219 common madvise sys_madvise sys_madvise 231 + 220 common getdents64 sys_getdents64 sys_getdents64 232 232 221 32 fcntl64 - compat_sys_fcntl64 233 233 222 common readahead sys_readahead compat_sys_s390_readahead 234 234 223 32 sendfile64 - compat_sys_sendfile64 235 - 224 common setxattr sys_setxattr compat_sys_setxattr 236 - 225 common lsetxattr sys_lsetxattr compat_sys_lsetxattr 237 - 226 common fsetxattr sys_fsetxattr compat_sys_fsetxattr 238 - 227 common getxattr sys_getxattr compat_sys_getxattr 239 - 228 common lgetxattr sys_lgetxattr compat_sys_lgetxattr 240 - 229 common fgetxattr sys_fgetxattr compat_sys_fgetxattr 241 - 230 common listxattr sys_listxattr compat_sys_listxattr 242 - 231 common llistxattr sys_llistxattr compat_sys_llistxattr 243 - 232 common flistxattr sys_flistxattr compat_sys_flistxattr 244 - 233 common removexattr sys_removexattr compat_sys_removexattr 245 - 234 common lremovexattr sys_lremovexattr compat_sys_lremovexattr 246 - 235 common fremovexattr sys_fremovexattr compat_sys_fremovexattr 235 + 224 common setxattr sys_setxattr sys_setxattr 236 + 225 common lsetxattr sys_lsetxattr sys_lsetxattr 237 + 226 common fsetxattr sys_fsetxattr sys_fsetxattr 238 + 227 common getxattr sys_getxattr sys_getxattr 239 + 228 common lgetxattr sys_lgetxattr sys_lgetxattr 240 + 229 common fgetxattr sys_fgetxattr sys_fgetxattr 241 + 230 common listxattr sys_listxattr sys_listxattr 242 + 231 common llistxattr sys_llistxattr sys_llistxattr 243 + 232 common flistxattr sys_flistxattr sys_flistxattr 244 + 233 common removexattr sys_removexattr sys_removexattr 245 + 234 common lremovexattr sys_lremovexattr sys_lremovexattr 246 + 235 common fremovexattr sys_fremovexattr sys_fremovexattr 247 247 236 common gettid sys_gettid sys_gettid 248 248 237 common tkill sys_tkill sys_tkill 249 - 238 common futex sys_futex compat_sys_futex 249 + 238 common futex sys_futex sys_futex_time32 250 250 239 common sched_setaffinity sys_sched_setaffinity compat_sys_sched_setaffinity 251 251 240 common sched_getaffinity sys_sched_getaffinity compat_sys_sched_getaffinity 252 252 241 common tgkill sys_tgkill sys_tgkill 253 253 243 common io_setup sys_io_setup compat_sys_io_setup 254 - 244 common io_destroy sys_io_destroy compat_sys_io_destroy 255 - 245 common io_getevents sys_io_getevents compat_sys_io_getevents 254 + 244 common io_destroy sys_io_destroy sys_io_destroy 255 + 245 common io_getevents sys_io_getevents sys_io_getevents_time32 256 256 246 common io_submit sys_io_submit compat_sys_io_submit 257 - 247 common io_cancel sys_io_cancel compat_sys_io_cancel 257 + 247 common io_cancel sys_io_cancel sys_io_cancel 258 258 248 common exit_group sys_exit_group sys_exit_group 259 259 249 common epoll_create sys_epoll_create sys_epoll_create 260 - 250 common epoll_ctl sys_epoll_ctl compat_sys_epoll_ctl 261 - 251 common epoll_wait sys_epoll_wait compat_sys_epoll_wait 262 - 252 common set_tid_address sys_set_tid_address compat_sys_set_tid_address 260 + 250 common epoll_ctl sys_epoll_ctl sys_epoll_ctl 261 + 251 common epoll_wait sys_epoll_wait sys_epoll_wait 262 + 252 common set_tid_address sys_set_tid_address sys_set_tid_address 263 263 253 common fadvise64 sys_fadvise64_64 compat_sys_s390_fadvise64 264 264 254 common timer_create sys_timer_create compat_sys_timer_create 265 - 255 common timer_settime sys_timer_settime compat_sys_timer_settime 266 - 256 common timer_gettime sys_timer_gettime compat_sys_timer_gettime 265 + 255 common timer_settime sys_timer_settime sys_timer_settime32 266 + 256 common timer_gettime sys_timer_gettime sys_timer_gettime32 267 267 257 common timer_getoverrun sys_timer_getoverrun sys_timer_getoverrun 268 268 258 common timer_delete sys_timer_delete sys_timer_delete 269 - 259 common clock_settime sys_clock_settime compat_sys_clock_settime 270 - 260 common clock_gettime sys_clock_gettime compat_sys_clock_gettime 271 - 261 common clock_getres sys_clock_getres compat_sys_clock_getres 272 - 262 common clock_nanosleep sys_clock_nanosleep compat_sys_clock_nanosleep 269 + 259 common clock_settime sys_clock_settime sys_clock_settime32 270 + 260 common clock_gettime sys_clock_gettime sys_clock_gettime32 271 + 261 common clock_getres sys_clock_getres sys_clock_getres_time32 272 + 262 common clock_nanosleep sys_clock_nanosleep sys_clock_nanosleep_time32 273 273 264 32 fadvise64_64 - compat_sys_s390_fadvise64_64 274 274 265 common statfs64 sys_statfs64 compat_sys_statfs64 275 275 266 common fstatfs64 sys_fstatfs64 compat_sys_fstatfs64 276 - 267 common remap_file_pages sys_remap_file_pages compat_sys_remap_file_pages 276 + 267 common remap_file_pages sys_remap_file_pages sys_remap_file_pages 277 277 268 common mbind sys_mbind compat_sys_mbind 278 278 269 common get_mempolicy sys_get_mempolicy compat_sys_get_mempolicy 279 279 270 common set_mempolicy sys_set_mempolicy compat_sys_set_mempolicy 280 280 271 common mq_open sys_mq_open compat_sys_mq_open 281 - 272 common mq_unlink sys_mq_unlink compat_sys_mq_unlink 282 - 273 common mq_timedsend sys_mq_timedsend compat_sys_mq_timedsend 283 - 274 common mq_timedreceive sys_mq_timedreceive compat_sys_mq_timedreceive 281 + 272 common mq_unlink sys_mq_unlink sys_mq_unlink 282 + 273 common mq_timedsend sys_mq_timedsend sys_mq_timedsend_time32 283 + 274 common mq_timedreceive sys_mq_timedreceive sys_mq_timedreceive_time32 284 284 275 common mq_notify sys_mq_notify compat_sys_mq_notify 285 285 276 common mq_getsetattr sys_mq_getsetattr compat_sys_mq_getsetattr 286 286 277 common kexec_load sys_kexec_load compat_sys_kexec_load 287 - 278 common add_key sys_add_key compat_sys_add_key 288 - 279 common request_key sys_request_key compat_sys_request_key 287 + 278 common add_key sys_add_key sys_add_key 288 + 279 common request_key sys_request_key sys_request_key 289 289 280 common keyctl sys_keyctl compat_sys_keyctl 290 290 281 common waitid sys_waitid compat_sys_waitid 291 291 282 common ioprio_set sys_ioprio_set sys_ioprio_set 292 292 283 common ioprio_get sys_ioprio_get sys_ioprio_get 293 293 284 common inotify_init sys_inotify_init sys_inotify_init 294 - 285 common inotify_add_watch sys_inotify_add_watch compat_sys_inotify_add_watch 294 + 285 common inotify_add_watch sys_inotify_add_watch sys_inotify_add_watch 295 295 286 common inotify_rm_watch sys_inotify_rm_watch sys_inotify_rm_watch 296 296 287 common migrate_pages sys_migrate_pages compat_sys_migrate_pages 297 297 288 common openat sys_openat compat_sys_openat 298 - 289 common mkdirat sys_mkdirat compat_sys_mkdirat 299 - 290 common mknodat sys_mknodat compat_sys_mknodat 300 - 291 common fchownat sys_fchownat compat_sys_fchownat 301 - 292 common futimesat sys_futimesat compat_sys_futimesat 298 + 289 common mkdirat sys_mkdirat sys_mkdirat 299 + 290 common mknodat sys_mknodat sys_mknodat 300 + 291 common fchownat sys_fchownat sys_fchownat 301 + 292 common futimesat sys_futimesat sys_futimesat_time32 302 302 293 32 fstatat64 - compat_sys_s390_fstatat64 303 303 293 64 newfstatat sys_newfstatat - 304 - 294 common unlinkat sys_unlinkat compat_sys_unlinkat 305 - 295 common renameat sys_renameat compat_sys_renameat 306 - 296 common linkat sys_linkat compat_sys_linkat 307 - 297 common symlinkat sys_symlinkat compat_sys_symlinkat 308 - 298 common readlinkat sys_readlinkat compat_sys_readlinkat 309 - 299 common fchmodat sys_fchmodat compat_sys_fchmodat 310 - 300 common faccessat sys_faccessat compat_sys_faccessat 311 - 301 common pselect6 sys_pselect6 compat_sys_pselect6 312 - 302 common ppoll sys_ppoll compat_sys_ppoll 313 - 303 common unshare sys_unshare compat_sys_unshare 304 + 294 common unlinkat sys_unlinkat sys_unlinkat 305 + 295 common renameat sys_renameat sys_renameat 306 + 296 common linkat sys_linkat sys_linkat 307 + 297 common symlinkat sys_symlinkat sys_symlinkat 308 + 298 common readlinkat sys_readlinkat sys_readlinkat 309 + 299 common fchmodat sys_fchmodat sys_fchmodat 310 + 300 common faccessat sys_faccessat sys_faccessat 311 + 301 common pselect6 sys_pselect6 compat_sys_pselect6_time32 312 + 302 common ppoll sys_ppoll compat_sys_ppoll_time32 313 + 303 common unshare sys_unshare sys_unshare 314 314 304 common set_robust_list sys_set_robust_list compat_sys_set_robust_list 315 315 305 common get_robust_list sys_get_robust_list compat_sys_get_robust_list 316 - 306 common splice sys_splice compat_sys_splice 316 + 306 common splice sys_splice sys_splice 317 317 307 common sync_file_range sys_sync_file_range compat_sys_s390_sync_file_range 318 - 308 common tee sys_tee compat_sys_tee 318 + 308 common tee sys_tee sys_tee 319 319 309 common vmsplice sys_vmsplice sys_vmsplice 320 320 310 common move_pages sys_move_pages compat_sys_move_pages 321 - 311 common getcpu sys_getcpu compat_sys_getcpu 321 + 311 common getcpu sys_getcpu sys_getcpu 322 322 312 common epoll_pwait sys_epoll_pwait compat_sys_epoll_pwait 323 - 313 common utimes sys_utimes compat_sys_utimes 323 + 313 common utimes sys_utimes sys_utimes_time32 324 324 314 common fallocate sys_fallocate compat_sys_s390_fallocate 325 - 315 common utimensat sys_utimensat compat_sys_utimensat 325 + 315 common utimensat sys_utimensat sys_utimensat_time32 326 326 316 common signalfd sys_signalfd compat_sys_signalfd 327 327 317 common timerfd - - 328 328 318 common eventfd sys_eventfd sys_eventfd 329 329 319 common timerfd_create sys_timerfd_create sys_timerfd_create 330 - 320 common timerfd_settime sys_timerfd_settime compat_sys_timerfd_settime 331 - 321 common timerfd_gettime sys_timerfd_gettime compat_sys_timerfd_gettime 330 + 320 common timerfd_settime sys_timerfd_settime sys_timerfd_settime32 331 + 321 common timerfd_gettime sys_timerfd_gettime sys_timerfd_gettime32 332 332 322 common signalfd4 sys_signalfd4 compat_sys_signalfd4 333 333 323 common eventfd2 sys_eventfd2 sys_eventfd2 334 334 324 common inotify_init1 sys_inotify_init1 sys_inotify_init1 335 - 325 common pipe2 sys_pipe2 compat_sys_pipe2 335 + 325 common pipe2 sys_pipe2 sys_pipe2 336 336 326 common dup3 sys_dup3 sys_dup3 337 337 327 common epoll_create1 sys_epoll_create1 sys_epoll_create1 338 338 328 common preadv sys_preadv compat_sys_preadv 339 339 329 common pwritev sys_pwritev compat_sys_pwritev 340 340 330 common rt_tgsigqueueinfo sys_rt_tgsigqueueinfo compat_sys_rt_tgsigqueueinfo 341 - 331 common perf_event_open sys_perf_event_open compat_sys_perf_event_open 341 + 331 common perf_event_open sys_perf_event_open sys_perf_event_open 342 342 332 common fanotify_init sys_fanotify_init sys_fanotify_init 343 343 333 common fanotify_mark sys_fanotify_mark compat_sys_fanotify_mark 344 - 334 common prlimit64 sys_prlimit64 compat_sys_prlimit64 345 - 335 common name_to_handle_at sys_name_to_handle_at compat_sys_name_to_handle_at 344 + 334 common prlimit64 sys_prlimit64 sys_prlimit64 345 + 335 common name_to_handle_at sys_name_to_handle_at sys_name_to_handle_at 346 346 336 common open_by_handle_at sys_open_by_handle_at compat_sys_open_by_handle_at 347 - 337 common clock_adjtime sys_clock_adjtime compat_sys_clock_adjtime 347 + 337 common clock_adjtime sys_clock_adjtime sys_clock_adjtime32 348 348 338 common syncfs sys_syncfs sys_syncfs 349 349 339 common setns sys_setns sys_setns 350 350 340 common process_vm_readv sys_process_vm_readv sys_process_vm_readv 351 351 341 common process_vm_writev sys_process_vm_writev sys_process_vm_writev 352 352 342 common s390_runtime_instr sys_s390_runtime_instr sys_s390_runtime_instr 353 - 343 common kcmp sys_kcmp compat_sys_kcmp 354 - 344 common finit_module sys_finit_module compat_sys_finit_module 355 - 345 common sched_setattr sys_sched_setattr compat_sys_sched_setattr 356 - 346 common sched_getattr sys_sched_getattr compat_sys_sched_getattr 357 - 347 common renameat2 sys_renameat2 compat_sys_renameat2 358 - 348 common seccomp sys_seccomp compat_sys_seccomp 359 - 349 common getrandom sys_getrandom compat_sys_getrandom 360 - 350 common memfd_create sys_memfd_create compat_sys_memfd_create 361 - 351 common bpf sys_bpf compat_sys_bpf 362 - 352 common s390_pci_mmio_write sys_s390_pci_mmio_write compat_sys_s390_pci_mmio_write 363 - 353 common s390_pci_mmio_read sys_s390_pci_mmio_read compat_sys_s390_pci_mmio_read 353 + 343 common kcmp sys_kcmp sys_kcmp 354 + 344 common finit_module sys_finit_module sys_finit_module 355 + 345 common sched_setattr sys_sched_setattr sys_sched_setattr 356 + 346 common sched_getattr sys_sched_getattr sys_sched_getattr 357 + 347 common renameat2 sys_renameat2 sys_renameat2 358 + 348 common seccomp sys_seccomp sys_seccomp 359 + 349 common getrandom sys_getrandom sys_getrandom 360 + 350 common memfd_create sys_memfd_create sys_memfd_create 361 + 351 common bpf sys_bpf sys_bpf 362 + 352 common s390_pci_mmio_write sys_s390_pci_mmio_write sys_s390_pci_mmio_write 363 + 353 common s390_pci_mmio_read sys_s390_pci_mmio_read sys_s390_pci_mmio_read 364 364 354 common execveat sys_execveat compat_sys_execveat 365 365 355 common userfaultfd sys_userfaultfd sys_userfaultfd 366 366 356 common membarrier sys_membarrier sys_membarrier 367 - 357 common recvmmsg sys_recvmmsg compat_sys_recvmmsg 367 + 357 common recvmmsg sys_recvmmsg compat_sys_recvmmsg_time32 368 368 358 common sendmmsg sys_sendmmsg compat_sys_sendmmsg 369 369 359 common socket sys_socket sys_socket 370 - 360 common socketpair sys_socketpair compat_sys_socketpair 371 - 361 common bind sys_bind compat_sys_bind 372 - 362 common connect sys_connect compat_sys_connect 370 + 360 common socketpair sys_socketpair sys_socketpair 371 + 361 common bind sys_bind sys_bind 372 + 362 common connect sys_connect sys_connect 373 373 363 common listen sys_listen sys_listen 374 - 364 common accept4 sys_accept4 compat_sys_accept4 374 + 364 common accept4 sys_accept4 sys_accept4 375 375 365 common getsockopt sys_getsockopt sys_getsockopt 376 376 366 common setsockopt sys_setsockopt sys_setsockopt 377 - 367 common getsockname sys_getsockname compat_sys_getsockname 378 - 368 common getpeername sys_getpeername compat_sys_getpeername 379 - 369 common sendto sys_sendto compat_sys_sendto 377 + 367 common getsockname sys_getsockname sys_getsockname 378 + 368 common getpeername sys_getpeername sys_getpeername 379 + 369 common sendto sys_sendto sys_sendto 380 380 370 common sendmsg sys_sendmsg compat_sys_sendmsg 381 381 371 common recvfrom sys_recvfrom compat_sys_recvfrom 382 382 372 common recvmsg sys_recvmsg compat_sys_recvmsg 383 383 373 common shutdown sys_shutdown sys_shutdown 384 - 374 common mlock2 sys_mlock2 compat_sys_mlock2 385 - 375 common copy_file_range sys_copy_file_range compat_sys_copy_file_range 384 + 374 common mlock2 sys_mlock2 sys_mlock2 385 + 375 common copy_file_range sys_copy_file_range sys_copy_file_range 386 386 376 common preadv2 sys_preadv2 compat_sys_preadv2 387 387 377 common pwritev2 sys_pwritev2 compat_sys_pwritev2 388 - 378 common s390_guarded_storage sys_s390_guarded_storage compat_sys_s390_guarded_storage 389 - 379 common statx sys_statx compat_sys_statx 390 - 380 common s390_sthyi sys_s390_sthyi compat_sys_s390_sthyi 388 + 378 common s390_guarded_storage sys_s390_guarded_storage sys_s390_guarded_storage 389 + 379 common statx sys_statx sys_statx 390 + 380 common s390_sthyi sys_s390_sthyi sys_s390_sthyi 391 + 381 common kexec_file_load sys_kexec_file_load sys_kexec_file_load 392 + 382 common io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents 393 + 383 common rseq sys_rseq sys_rseq 394 + 384 common pkey_mprotect sys_pkey_mprotect sys_pkey_mprotect 395 + 385 common pkey_alloc sys_pkey_alloc sys_pkey_alloc 396 + 386 common pkey_free sys_pkey_free sys_pkey_free 397 + # room for arch specific syscalls 398 + 392 64 semtimedop sys_semtimedop - 399 + 393 common semget sys_semget sys_semget 400 + 394 common semctl sys_semctl compat_sys_semctl 401 + 395 common shmget sys_shmget sys_shmget 402 + 396 common shmctl sys_shmctl compat_sys_shmctl 403 + 397 common shmat sys_shmat compat_sys_shmat 404 + 398 common shmdt sys_shmdt sys_shmdt 405 + 399 common msgget sys_msgget sys_msgget 406 + 400 common msgsnd sys_msgsnd compat_sys_msgsnd 407 + 401 common msgrcv sys_msgrcv compat_sys_msgrcv 408 + 402 common msgctl sys_msgctl compat_sys_msgctl 409 + 403 32 clock_gettime64 - sys_clock_gettime 410 + 404 32 clock_settime64 - sys_clock_settime 411 + 405 32 clock_adjtime64 - sys_clock_adjtime 412 + 406 32 clock_getres_time64 - sys_clock_getres 413 + 407 32 clock_nanosleep_time64 - sys_clock_nanosleep 414 + 408 32 timer_gettime64 - sys_timer_gettime 415 + 409 32 timer_settime64 - sys_timer_settime 416 + 410 32 timerfd_gettime64 - sys_timerfd_gettime 417 + 411 32 timerfd_settime64 - sys_timerfd_settime 418 + 412 32 utimensat_time64 - sys_utimensat 419 + 413 32 pselect6_time64 - compat_sys_pselect6_time64 420 + 414 32 ppoll_time64 - compat_sys_ppoll_time64 421 + 416 32 io_pgetevents_time64 - sys_io_pgetevents 422 + 417 32 recvmmsg_time64 - compat_sys_recvmmsg_time64 423 + 418 32 mq_timedsend_time64 - sys_mq_timedsend 424 + 419 32 mq_timedreceive_time64 - sys_mq_timedreceive 425 + 420 32 semtimedop_time64 - sys_semtimedop 426 + 421 32 rt_sigtimedwait_time64 - compat_sys_rt_sigtimedwait_time64 427 + 422 32 futex_time64 - sys_futex 428 + 423 32 sched_rr_get_interval_time64 - sys_sched_rr_get_interval 429 + 424 common pidfd_send_signal sys_pidfd_send_signal sys_pidfd_send_signal 430 + 425 common io_uring_setup sys_io_uring_setup sys_io_uring_setup 431 + 426 common io_uring_enter sys_io_uring_enter sys_io_uring_enter 432 + 427 common io_uring_register sys_io_uring_register sys_io_uring_register 433 + 428 common open_tree sys_open_tree sys_open_tree 434 + 429 common move_mount sys_move_mount sys_move_mount 435 + 430 common fsopen sys_fsopen sys_fsopen 436 + 431 common fsconfig sys_fsconfig sys_fsconfig 437 + 432 common fsmount sys_fsmount sys_fsmount 438 + 433 common fspick sys_fspick sys_fspick 439 + 434 common pidfd_open sys_pidfd_open sys_pidfd_open 440 + 435 common clone3 sys_clone3 sys_clone3 441 + 436 common close_range sys_close_range sys_close_range 442 + 437 common openat2 sys_openat2 sys_openat2 443 + 438 common pidfd_getfd sys_pidfd_getfd sys_pidfd_getfd 444 + 439 common faccessat2 sys_faccessat2 sys_faccessat2 445 + 440 common process_madvise sys_process_madvise sys_process_madvise 446 + 441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
+1
tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
··· 362 362 438 common pidfd_getfd sys_pidfd_getfd 363 363 439 common faccessat2 sys_faccessat2 364 364 440 common process_madvise sys_process_madvise 365 + 441 common epoll_pwait2 sys_epoll_pwait2 365 366 366 367 # 367 368 # Due to a historical design error, certain syscalls are numbered differently
+68 -60
tools/perf/builtin-stat.c
··· 1186 1186 OPT_END() 1187 1187 }; 1188 1188 1189 - static int perf_stat__get_socket(struct perf_stat_config *config __maybe_unused, 1189 + static struct aggr_cpu_id perf_stat__get_socket(struct perf_stat_config *config __maybe_unused, 1190 1190 struct perf_cpu_map *map, int cpu) 1191 1191 { 1192 1192 return cpu_map__get_socket(map, cpu, NULL); 1193 1193 } 1194 1194 1195 - static int perf_stat__get_die(struct perf_stat_config *config __maybe_unused, 1195 + static struct aggr_cpu_id perf_stat__get_die(struct perf_stat_config *config __maybe_unused, 1196 1196 struct perf_cpu_map *map, int cpu) 1197 1197 { 1198 1198 return cpu_map__get_die(map, cpu, NULL); 1199 1199 } 1200 1200 1201 - static int perf_stat__get_core(struct perf_stat_config *config __maybe_unused, 1201 + static struct aggr_cpu_id perf_stat__get_core(struct perf_stat_config *config __maybe_unused, 1202 1202 struct perf_cpu_map *map, int cpu) 1203 1203 { 1204 1204 return cpu_map__get_core(map, cpu, NULL); 1205 1205 } 1206 1206 1207 - static int perf_stat__get_node(struct perf_stat_config *config __maybe_unused, 1207 + static struct aggr_cpu_id perf_stat__get_node(struct perf_stat_config *config __maybe_unused, 1208 1208 struct perf_cpu_map *map, int cpu) 1209 1209 { 1210 1210 return cpu_map__get_node(map, cpu, NULL); 1211 1211 } 1212 1212 1213 - static int perf_stat__get_aggr(struct perf_stat_config *config, 1213 + static struct aggr_cpu_id perf_stat__get_aggr(struct perf_stat_config *config, 1214 1214 aggr_get_id_t get_id, struct perf_cpu_map *map, int idx) 1215 1215 { 1216 1216 int cpu; 1217 + struct aggr_cpu_id id = cpu_map__empty_aggr_cpu_id(); 1217 1218 1218 1219 if (idx >= map->nr) 1219 - return -1; 1220 + return id; 1220 1221 1221 1222 cpu = map->map[idx]; 1222 1223 1223 - if (config->cpus_aggr_map->map[cpu] == -1) 1224 + if (cpu_map__aggr_cpu_id_is_empty(config->cpus_aggr_map->map[cpu])) 1224 1225 config->cpus_aggr_map->map[cpu] = get_id(config, map, idx); 1225 1226 1226 - return config->cpus_aggr_map->map[cpu]; 1227 + id = config->cpus_aggr_map->map[cpu]; 1228 + return id; 1227 1229 } 1228 1230 1229 - static int perf_stat__get_socket_cached(struct perf_stat_config *config, 1231 + static struct aggr_cpu_id perf_stat__get_socket_cached(struct perf_stat_config *config, 1230 1232 struct perf_cpu_map *map, int idx) 1231 1233 { 1232 1234 return perf_stat__get_aggr(config, perf_stat__get_socket, map, idx); 1233 1235 } 1234 1236 1235 - static int perf_stat__get_die_cached(struct perf_stat_config *config, 1237 + static struct aggr_cpu_id perf_stat__get_die_cached(struct perf_stat_config *config, 1236 1238 struct perf_cpu_map *map, int idx) 1237 1239 { 1238 1240 return perf_stat__get_aggr(config, perf_stat__get_die, map, idx); 1239 1241 } 1240 1242 1241 - static int perf_stat__get_core_cached(struct perf_stat_config *config, 1243 + static struct aggr_cpu_id perf_stat__get_core_cached(struct perf_stat_config *config, 1242 1244 struct perf_cpu_map *map, int idx) 1243 1245 { 1244 1246 return perf_stat__get_aggr(config, perf_stat__get_core, map, idx); 1245 1247 } 1246 1248 1247 - static int perf_stat__get_node_cached(struct perf_stat_config *config, 1249 + static struct aggr_cpu_id perf_stat__get_node_cached(struct perf_stat_config *config, 1248 1250 struct perf_cpu_map *map, int idx) 1249 1251 { 1250 1252 return perf_stat__get_aggr(config, perf_stat__get_node, map, idx); ··· 1320 1318 * the aggregation translate cpumap. 1321 1319 */ 1322 1320 nr = perf_cpu_map__max(evsel_list->core.cpus); 1323 - stat_config.cpus_aggr_map = perf_cpu_map__empty_new(nr + 1); 1321 + stat_config.cpus_aggr_map = cpu_aggr_map__empty_new(nr + 1); 1324 1322 return stat_config.cpus_aggr_map ? 0 : -ENOMEM; 1323 + } 1324 + 1325 + static void cpu_aggr_map__delete(struct cpu_aggr_map *map) 1326 + { 1327 + if (map) { 1328 + WARN_ONCE(refcount_read(&map->refcnt) != 0, 1329 + "cpu_aggr_map refcnt unbalanced\n"); 1330 + free(map); 1331 + } 1332 + } 1333 + 1334 + static void cpu_aggr_map__put(struct cpu_aggr_map *map) 1335 + { 1336 + if (map && refcount_dec_and_test(&map->refcnt)) 1337 + cpu_aggr_map__delete(map); 1325 1338 } 1326 1339 1327 1340 static void perf_stat__exit_aggr_mode(void) 1328 1341 { 1329 - perf_cpu_map__put(stat_config.aggr_map); 1330 - perf_cpu_map__put(stat_config.cpus_aggr_map); 1342 + cpu_aggr_map__put(stat_config.aggr_map); 1343 + cpu_aggr_map__put(stat_config.cpus_aggr_map); 1331 1344 stat_config.aggr_map = NULL; 1332 1345 stat_config.cpus_aggr_map = NULL; 1333 1346 } ··· 1362 1345 return cpu; 1363 1346 } 1364 1347 1365 - static int perf_env__get_socket(struct perf_cpu_map *map, int idx, void *data) 1348 + static struct aggr_cpu_id perf_env__get_socket(struct perf_cpu_map *map, int idx, void *data) 1366 1349 { 1367 1350 struct perf_env *env = data; 1368 1351 int cpu = perf_env__get_cpu(env, map, idx); 1352 + struct aggr_cpu_id id = cpu_map__empty_aggr_cpu_id(); 1369 1353 1370 - return cpu == -1 ? -1 : env->cpu[cpu].socket_id; 1354 + if (cpu != -1) 1355 + id.socket = env->cpu[cpu].socket_id; 1356 + 1357 + return id; 1371 1358 } 1372 1359 1373 - static int perf_env__get_die(struct perf_cpu_map *map, int idx, void *data) 1360 + static struct aggr_cpu_id perf_env__get_die(struct perf_cpu_map *map, int idx, void *data) 1374 1361 { 1375 1362 struct perf_env *env = data; 1376 - int die_id = -1, cpu = perf_env__get_cpu(env, map, idx); 1363 + struct aggr_cpu_id id = cpu_map__empty_aggr_cpu_id(); 1364 + int cpu = perf_env__get_cpu(env, map, idx); 1377 1365 1378 1366 if (cpu != -1) { 1379 1367 /* 1380 - * Encode socket in bit range 15:8 1381 - * die_id is relative to socket, 1382 - * we need a global id. So we combine 1383 - * socket + die id 1368 + * die_id is relative to socket, so start 1369 + * with the socket ID and then add die to 1370 + * make a unique ID. 1384 1371 */ 1385 - if (WARN_ONCE(env->cpu[cpu].socket_id >> 8, "The socket id number is too big.\n")) 1386 - return -1; 1387 - 1388 - if (WARN_ONCE(env->cpu[cpu].die_id >> 8, "The die id number is too big.\n")) 1389 - return -1; 1390 - 1391 - die_id = (env->cpu[cpu].socket_id << 8) | (env->cpu[cpu].die_id & 0xff); 1372 + id.socket = env->cpu[cpu].socket_id; 1373 + id.die = env->cpu[cpu].die_id; 1392 1374 } 1393 1375 1394 - return die_id; 1376 + return id; 1395 1377 } 1396 1378 1397 - static int perf_env__get_core(struct perf_cpu_map *map, int idx, void *data) 1379 + static struct aggr_cpu_id perf_env__get_core(struct perf_cpu_map *map, int idx, void *data) 1398 1380 { 1399 1381 struct perf_env *env = data; 1400 - int core = -1, cpu = perf_env__get_cpu(env, map, idx); 1382 + struct aggr_cpu_id id = cpu_map__empty_aggr_cpu_id(); 1383 + int cpu = perf_env__get_cpu(env, map, idx); 1401 1384 1402 1385 if (cpu != -1) { 1403 1386 /* 1404 - * Encode socket in bit range 31:24 1405 - * encode die id in bit range 23:16 1406 1387 * core_id is relative to socket and die, 1407 - * we need a global id. So we combine 1408 - * socket + die id + core id 1388 + * we need a global id. So we set 1389 + * socket, die id and core id 1409 1390 */ 1410 - if (WARN_ONCE(env->cpu[cpu].socket_id >> 8, "The socket id number is too big.\n")) 1411 - return -1; 1412 - 1413 - if (WARN_ONCE(env->cpu[cpu].die_id >> 8, "The die id number is too big.\n")) 1414 - return -1; 1415 - 1416 - if (WARN_ONCE(env->cpu[cpu].core_id >> 16, "The core id number is too big.\n")) 1417 - return -1; 1418 - 1419 - core = (env->cpu[cpu].socket_id << 24) | 1420 - (env->cpu[cpu].die_id << 16) | 1421 - (env->cpu[cpu].core_id & 0xffff); 1391 + id.socket = env->cpu[cpu].socket_id; 1392 + id.die = env->cpu[cpu].die_id; 1393 + id.core = env->cpu[cpu].core_id; 1422 1394 } 1423 1395 1424 - return core; 1396 + return id; 1425 1397 } 1426 1398 1427 - static int perf_env__get_node(struct perf_cpu_map *map, int idx, void *data) 1399 + static struct aggr_cpu_id perf_env__get_node(struct perf_cpu_map *map, int idx, void *data) 1428 1400 { 1429 1401 int cpu = perf_env__get_cpu(data, map, idx); 1402 + struct aggr_cpu_id id = cpu_map__empty_aggr_cpu_id(); 1430 1403 1431 - return perf_env__numa_node(data, cpu); 1404 + id.node = perf_env__numa_node(data, cpu); 1405 + return id; 1432 1406 } 1433 1407 1434 1408 static int perf_env__build_socket_map(struct perf_env *env, struct perf_cpu_map *cpus, 1435 - struct perf_cpu_map **sockp) 1409 + struct cpu_aggr_map **sockp) 1436 1410 { 1437 1411 return cpu_map__build_map(cpus, sockp, perf_env__get_socket, env); 1438 1412 } 1439 1413 1440 1414 static int perf_env__build_die_map(struct perf_env *env, struct perf_cpu_map *cpus, 1441 - struct perf_cpu_map **diep) 1415 + struct cpu_aggr_map **diep) 1442 1416 { 1443 1417 return cpu_map__build_map(cpus, diep, perf_env__get_die, env); 1444 1418 } 1445 1419 1446 1420 static int perf_env__build_core_map(struct perf_env *env, struct perf_cpu_map *cpus, 1447 - struct perf_cpu_map **corep) 1421 + struct cpu_aggr_map **corep) 1448 1422 { 1449 1423 return cpu_map__build_map(cpus, corep, perf_env__get_core, env); 1450 1424 } 1451 1425 1452 1426 static int perf_env__build_node_map(struct perf_env *env, struct perf_cpu_map *cpus, 1453 - struct perf_cpu_map **nodep) 1427 + struct cpu_aggr_map **nodep) 1454 1428 { 1455 1429 return cpu_map__build_map(cpus, nodep, perf_env__get_node, env); 1456 1430 } 1457 1431 1458 - static int perf_stat__get_socket_file(struct perf_stat_config *config __maybe_unused, 1432 + static struct aggr_cpu_id perf_stat__get_socket_file(struct perf_stat_config *config __maybe_unused, 1459 1433 struct perf_cpu_map *map, int idx) 1460 1434 { 1461 1435 return perf_env__get_socket(map, idx, &perf_stat.session->header.env); 1462 1436 } 1463 - static int perf_stat__get_die_file(struct perf_stat_config *config __maybe_unused, 1437 + static struct aggr_cpu_id perf_stat__get_die_file(struct perf_stat_config *config __maybe_unused, 1464 1438 struct perf_cpu_map *map, int idx) 1465 1439 { 1466 1440 return perf_env__get_die(map, idx, &perf_stat.session->header.env); 1467 1441 } 1468 1442 1469 - static int perf_stat__get_core_file(struct perf_stat_config *config __maybe_unused, 1443 + static struct aggr_cpu_id perf_stat__get_core_file(struct perf_stat_config *config __maybe_unused, 1470 1444 struct perf_cpu_map *map, int idx) 1471 1445 { 1472 1446 return perf_env__get_core(map, idx, &perf_stat.session->header.env); 1473 1447 } 1474 1448 1475 - static int perf_stat__get_node_file(struct perf_stat_config *config __maybe_unused, 1449 + static struct aggr_cpu_id perf_stat__get_node_file(struct perf_stat_config *config __maybe_unused, 1476 1450 struct perf_cpu_map *map, int idx) 1477 1451 { 1478 1452 return perf_env__get_node(map, idx, &perf_stat.session->header.env);
+2
tools/perf/check-headers.sh
··· 144 144 145 145 # diff non-symmetric files 146 146 check_2 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl 147 + check_2 tools/perf/arch/powerpc/entry/syscalls/syscall.tbl arch/powerpc/kernel/syscalls/syscall.tbl 148 + check_2 tools/perf/arch/s390/entry/syscalls/syscall.tbl arch/s390/kernel/syscalls/syscall.tbl 147 149 148 150 for i in $BEAUTY_FILES; do 149 151 beauty_check $i -B
+58 -6
tools/perf/tests/topology.c
··· 65 65 .mode = PERF_DATA_MODE_READ, 66 66 }; 67 67 int i; 68 + struct aggr_cpu_id id; 68 69 69 70 session = perf_session__new(&data, false, NULL); 70 71 TEST_ASSERT_VAL("can't get session", !IS_ERR(session)); 72 + cpu__setup_cpunode_map(); 71 73 72 74 /* On platforms with large numbers of CPUs process_cpu_topology() 73 75 * might issue an error while reading the perf.data file section ··· 87 85 * "socket_id number is too big. You may need to upgrade the 88 86 * perf tool." 89 87 * 90 - * This is the reason why this test might be skipped. 88 + * This is the reason why this test might be skipped. aarch64 and 89 + * s390 always write this part of the header, even when the above 90 + * condition is true (see do_core_id_test in header.c). So always 91 + * run this test on those platforms. 91 92 */ 92 - if (!session->header.env.cpu) 93 + if (!session->header.env.cpu 94 + && strncmp(session->header.env.arch, "s390", 4) 95 + && strncmp(session->header.env.arch, "aarch64", 7)) 93 96 return TEST_SKIP; 97 + 98 + TEST_ASSERT_VAL("Session header CPU map not set", session->header.env.cpu); 94 99 95 100 for (i = 0; i < session->header.env.nr_cpus_avail; i++) { 96 101 if (!cpu_map__has(map, i)) ··· 107 98 session->header.env.cpu[i].socket_id); 108 99 } 109 100 101 + // Test that core ID contains socket, die and core 110 102 for (i = 0; i < map->nr; i++) { 111 - TEST_ASSERT_VAL("Core ID doesn't match", 112 - (session->header.env.cpu[map->map[i]].core_id == (cpu_map__get_core(map, i, NULL) & 0xffff))); 103 + id = cpu_map__get_core(map, i, NULL); 104 + TEST_ASSERT_VAL("Core map - Core ID doesn't match", 105 + session->header.env.cpu[map->map[i]].core_id == id.core); 113 106 114 - TEST_ASSERT_VAL("Socket ID doesn't match", 115 - (session->header.env.cpu[map->map[i]].socket_id == cpu_map__get_socket(map, i, NULL))); 107 + TEST_ASSERT_VAL("Core map - Socket ID doesn't match", 108 + session->header.env.cpu[map->map[i]].socket_id == id.socket); 109 + 110 + TEST_ASSERT_VAL("Core map - Die ID doesn't match", 111 + session->header.env.cpu[map->map[i]].die_id == id.die); 112 + TEST_ASSERT_VAL("Core map - Node ID is set", id.node == -1); 113 + TEST_ASSERT_VAL("Core map - Thread is set", id.thread == -1); 116 114 } 117 115 116 + // Test that die ID contains socket and die 117 + for (i = 0; i < map->nr; i++) { 118 + id = cpu_map__get_die(map, i, NULL); 119 + TEST_ASSERT_VAL("Die map - Socket ID doesn't match", 120 + session->header.env.cpu[map->map[i]].socket_id == id.socket); 121 + 122 + TEST_ASSERT_VAL("Die map - Die ID doesn't match", 123 + session->header.env.cpu[map->map[i]].die_id == id.die); 124 + 125 + TEST_ASSERT_VAL("Die map - Node ID is set", id.node == -1); 126 + TEST_ASSERT_VAL("Die map - Core is set", id.core == -1); 127 + TEST_ASSERT_VAL("Die map - Thread is set", id.thread == -1); 128 + } 129 + 130 + // Test that socket ID contains only socket 131 + for (i = 0; i < map->nr; i++) { 132 + id = cpu_map__get_socket(map, i, NULL); 133 + TEST_ASSERT_VAL("Socket map - Socket ID doesn't match", 134 + session->header.env.cpu[map->map[i]].socket_id == id.socket); 135 + 136 + TEST_ASSERT_VAL("Socket map - Node ID is set", id.node == -1); 137 + TEST_ASSERT_VAL("Socket map - Die ID is set", id.die == -1); 138 + TEST_ASSERT_VAL("Socket map - Core is set", id.core == -1); 139 + TEST_ASSERT_VAL("Socket map - Thread is set", id.thread == -1); 140 + } 141 + 142 + // Test that node ID contains only node 143 + for (i = 0; i < map->nr; i++) { 144 + id = cpu_map__get_node(map, i, NULL); 145 + TEST_ASSERT_VAL("Node map - Node ID doesn't match", 146 + cpu__get_node(map->map[i]) == id.node); 147 + TEST_ASSERT_VAL("Node map - Socket is set", id.socket == -1); 148 + TEST_ASSERT_VAL("Node map - Die ID is set", id.die == -1); 149 + TEST_ASSERT_VAL("Node map - Core is set", id.core == -1); 150 + TEST_ASSERT_VAL("Node map - Thread is set", id.thread == -1); 151 + } 118 152 perf_session__delete(session); 119 153 120 154 return 0;
+1 -1
tools/perf/trace/beauty/tracepoints/x86_msr.sh
··· 15 15 16 16 printf "static const char *x86_MSRs[] = {\n" 17 17 regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+MSR_([[:alnum:]][[:alnum:]_]+)[[:space:]]+(0x00000[[:xdigit:]]+)[[:space:]]*.*' 18 - egrep $regex ${x86_msr_index} | egrep -v 'MSR_(ATOM|P[46]|AMD64|IA32_TSCDEADLINE|IDT_FCR4)' | \ 18 + egrep $regex ${x86_msr_index} | egrep -v 'MSR_(ATOM|P[46]|IA32_(TSCDEADLINE|UCODE_REV)|IDT_FCR4)' | \ 19 19 sed -r "s/$regex/\2 \1/g" | sort -n | \ 20 20 xargs printf "\t[%s] = \"%s\",\n" 21 21 printf "};\n\n"
+115 -58
tools/perf/util/cpumap.c
··· 95 95 return cpus; 96 96 } 97 97 98 + struct cpu_aggr_map *cpu_aggr_map__empty_new(int nr) 99 + { 100 + struct cpu_aggr_map *cpus = malloc(sizeof(*cpus) + sizeof(struct aggr_cpu_id) * nr); 101 + 102 + if (cpus != NULL) { 103 + int i; 104 + 105 + cpus->nr = nr; 106 + for (i = 0; i < nr; i++) 107 + cpus->map[i] = cpu_map__empty_aggr_cpu_id(); 108 + 109 + refcount_set(&cpus->refcnt, 1); 110 + } 111 + 112 + return cpus; 113 + } 114 + 98 115 static int cpu__get_topology_int(int cpu, const char *name, int *value) 99 116 { 100 117 char path[PATH_MAX]; ··· 128 111 return ret ?: value; 129 112 } 130 113 131 - int cpu_map__get_socket(struct perf_cpu_map *map, int idx, void *data __maybe_unused) 114 + struct aggr_cpu_id cpu_map__get_socket(struct perf_cpu_map *map, int idx, 115 + void *data __maybe_unused) 132 116 { 133 117 int cpu; 118 + struct aggr_cpu_id id = cpu_map__empty_aggr_cpu_id(); 134 119 135 120 if (idx > map->nr) 136 - return -1; 121 + return id; 137 122 138 123 cpu = map->map[idx]; 139 124 140 - return cpu_map__get_socket_id(cpu); 125 + id.socket = cpu_map__get_socket_id(cpu); 126 + return id; 141 127 } 142 128 143 - static int cmp_ids(const void *a, const void *b) 129 + static int cmp_aggr_cpu_id(const void *a_pointer, const void *b_pointer) 144 130 { 145 - return *(int *)a - *(int *)b; 131 + struct aggr_cpu_id *a = (struct aggr_cpu_id *)a_pointer; 132 + struct aggr_cpu_id *b = (struct aggr_cpu_id *)b_pointer; 133 + 134 + if (a->node != b->node) 135 + return a->node - b->node; 136 + else if (a->socket != b->socket) 137 + return a->socket - b->socket; 138 + else if (a->die != b->die) 139 + return a->die - b->die; 140 + else if (a->core != b->core) 141 + return a->core - b->core; 142 + else 143 + return a->thread - b->thread; 146 144 } 147 145 148 - int cpu_map__build_map(struct perf_cpu_map *cpus, struct perf_cpu_map **res, 149 - int (*f)(struct perf_cpu_map *map, int cpu, void *data), 146 + int cpu_map__build_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **res, 147 + struct aggr_cpu_id (*f)(struct perf_cpu_map *map, int cpu, void *data), 150 148 void *data) 151 149 { 152 - struct perf_cpu_map *c; 153 150 int nr = cpus->nr; 154 - int cpu, s1, s2; 151 + struct cpu_aggr_map *c = cpu_aggr_map__empty_new(nr); 152 + int cpu, s2; 153 + struct aggr_cpu_id s1; 155 154 156 - /* allocate as much as possible */ 157 - c = calloc(1, sizeof(*c) + nr * sizeof(int)); 158 155 if (!c) 159 156 return -1; 157 + 158 + /* Reset size as it may only be partially filled */ 159 + c->nr = 0; 160 160 161 161 for (cpu = 0; cpu < nr; cpu++) { 162 162 s1 = f(cpus, cpu, data); 163 163 for (s2 = 0; s2 < c->nr; s2++) { 164 - if (s1 == c->map[s2]) 164 + if (cpu_map__compare_aggr_cpu_id(s1, c->map[s2])) 165 165 break; 166 166 } 167 167 if (s2 == c->nr) { ··· 187 153 } 188 154 } 189 155 /* ensure we process id in increasing order */ 190 - qsort(c->map, c->nr, sizeof(int), cmp_ids); 156 + qsort(c->map, c->nr, sizeof(struct aggr_cpu_id), cmp_aggr_cpu_id); 191 157 192 - refcount_set(&c->refcnt, 1); 193 158 *res = c; 194 159 return 0; 195 160 } ··· 200 167 return ret ?: value; 201 168 } 202 169 203 - int cpu_map__get_die(struct perf_cpu_map *map, int idx, void *data) 170 + struct aggr_cpu_id cpu_map__get_die(struct perf_cpu_map *map, int idx, void *data) 204 171 { 205 - int cpu, die_id, s; 172 + int cpu, die; 173 + struct aggr_cpu_id id = cpu_map__empty_aggr_cpu_id(); 206 174 207 175 if (idx > map->nr) 208 - return -1; 176 + return id; 209 177 210 178 cpu = map->map[idx]; 211 179 212 - die_id = cpu_map__get_die_id(cpu); 180 + die = cpu_map__get_die_id(cpu); 213 181 /* There is no die_id on legacy system. */ 214 - if (die_id == -1) 215 - die_id = 0; 216 - 217 - s = cpu_map__get_socket(map, idx, data); 218 - if (s == -1) 219 - return -1; 182 + if (die == -1) 183 + die = 0; 220 184 221 185 /* 222 - * Encode socket in bit range 15:8 223 - * die_id is relative to socket, and 224 - * we need a global id. So we combine 225 - * socket + die id 186 + * die_id is relative to socket, so start 187 + * with the socket ID and then add die to 188 + * make a unique ID. 226 189 */ 227 - if (WARN_ONCE(die_id >> 8, "The die id number is too big.\n")) 228 - return -1; 190 + id = cpu_map__get_socket(map, idx, data); 191 + if (cpu_map__aggr_cpu_id_is_empty(id)) 192 + return id; 229 193 230 - if (WARN_ONCE(s >> 8, "The socket id number is too big.\n")) 231 - return -1; 232 - 233 - return (s << 8) | (die_id & 0xff); 194 + id.die = die; 195 + return id; 234 196 } 235 197 236 198 int cpu_map__get_core_id(int cpu) ··· 239 211 return cpu__get_node(cpu); 240 212 } 241 213 242 - int cpu_map__get_core(struct perf_cpu_map *map, int idx, void *data) 214 + struct aggr_cpu_id cpu_map__get_core(struct perf_cpu_map *map, int idx, void *data) 243 215 { 244 - int cpu, s_die; 216 + int cpu; 217 + struct aggr_cpu_id id = cpu_map__empty_aggr_cpu_id(); 245 218 246 219 if (idx > map->nr) 247 - return -1; 220 + return id; 248 221 249 222 cpu = map->map[idx]; 250 223 251 224 cpu = cpu_map__get_core_id(cpu); 252 225 253 - /* s_die is the combination of socket + die id */ 254 - s_die = cpu_map__get_die(map, idx, data); 255 - if (s_die == -1) 256 - return -1; 226 + /* cpu_map__get_die returns a struct with socket and die set*/ 227 + id = cpu_map__get_die(map, idx, data); 228 + if (cpu_map__aggr_cpu_id_is_empty(id)) 229 + return id; 257 230 258 231 /* 259 - * encode socket in bit range 31:24 260 - * encode die id in bit range 23:16 261 - * core_id is relative to socket and die, 262 - * we need a global id. So we combine 263 - * socket + die id + core id 232 + * core_id is relative to socket and die, we need a global id. 233 + * So we combine the result from cpu_map__get_die with the core id 264 234 */ 265 - if (WARN_ONCE(cpu >> 16, "The core id number is too big.\n")) 266 - return -1; 267 - 268 - return (s_die << 16) | (cpu & 0xffff); 235 + id.core = cpu; 236 + return id; 269 237 } 270 238 271 - int cpu_map__get_node(struct perf_cpu_map *map, int idx, void *data __maybe_unused) 239 + struct aggr_cpu_id cpu_map__get_node(struct perf_cpu_map *map, int idx, void *data __maybe_unused) 272 240 { 273 - if (idx < 0 || idx >= map->nr) 274 - return -1; 241 + struct aggr_cpu_id id = cpu_map__empty_aggr_cpu_id(); 275 242 276 - return cpu_map__get_node_id(map->map[idx]); 243 + if (idx < 0 || idx >= map->nr) 244 + return id; 245 + 246 + id.node = cpu_map__get_node_id(map->map[idx]); 247 + return id; 277 248 } 278 249 279 - int cpu_map__build_socket_map(struct perf_cpu_map *cpus, struct perf_cpu_map **sockp) 250 + int cpu_map__build_socket_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **sockp) 280 251 { 281 252 return cpu_map__build_map(cpus, sockp, cpu_map__get_socket, NULL); 282 253 } 283 254 284 - int cpu_map__build_die_map(struct perf_cpu_map *cpus, struct perf_cpu_map **diep) 255 + int cpu_map__build_die_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **diep) 285 256 { 286 257 return cpu_map__build_map(cpus, diep, cpu_map__get_die, NULL); 287 258 } 288 259 289 - int cpu_map__build_core_map(struct perf_cpu_map *cpus, struct perf_cpu_map **corep) 260 + int cpu_map__build_core_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **corep) 290 261 { 291 262 return cpu_map__build_map(cpus, corep, cpu_map__get_core, NULL); 292 263 } 293 264 294 - int cpu_map__build_node_map(struct perf_cpu_map *cpus, struct perf_cpu_map **numap) 265 + int cpu_map__build_node_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **numap) 295 266 { 296 267 return cpu_map__build_map(cpus, numap, cpu_map__get_node, NULL); 297 268 } ··· 612 585 online = perf_cpu_map__new(NULL); /* from /sys/devices/system/cpu/online */ 613 586 614 587 return online; 588 + } 589 + 590 + bool cpu_map__compare_aggr_cpu_id(struct aggr_cpu_id a, struct aggr_cpu_id b) 591 + { 592 + return a.thread == b.thread && 593 + a.node == b.node && 594 + a.socket == b.socket && 595 + a.die == b.die && 596 + a.core == b.core; 597 + } 598 + 599 + bool cpu_map__aggr_cpu_id_is_empty(struct aggr_cpu_id a) 600 + { 601 + return a.thread == -1 && 602 + a.node == -1 && 603 + a.socket == -1 && 604 + a.die == -1 && 605 + a.core == -1; 606 + } 607 + 608 + struct aggr_cpu_id cpu_map__empty_aggr_cpu_id(void) 609 + { 610 + struct aggr_cpu_id ret = { 611 + .thread = -1, 612 + .node = -1, 613 + .socket = -1, 614 + .die = -1, 615 + .core = -1 616 + }; 617 + return ret; 615 618 }
+30 -25
tools/perf/util/cpumap.h
··· 7 7 #include <internal/cpumap.h> 8 8 #include <perf/cpumap.h> 9 9 10 + struct aggr_cpu_id { 11 + int thread; 12 + int node; 13 + int socket; 14 + int die; 15 + int core; 16 + }; 17 + 18 + struct cpu_aggr_map { 19 + refcount_t refcnt; 20 + int nr; 21 + struct aggr_cpu_id map[]; 22 + }; 23 + 10 24 struct perf_record_cpu_map_data; 11 25 12 26 struct perf_cpu_map *perf_cpu_map__empty_new(int nr); 27 + struct cpu_aggr_map *cpu_aggr_map__empty_new(int nr); 28 + 13 29 struct perf_cpu_map *cpu_map__new_data(struct perf_record_cpu_map_data *data); 14 30 size_t cpu_map__snprint(struct perf_cpu_map *map, char *buf, size_t size); 15 31 size_t cpu_map__snprint_mask(struct perf_cpu_map *map, char *buf, size_t size); 16 32 size_t cpu_map__fprintf(struct perf_cpu_map *map, FILE *fp); 17 33 int cpu_map__get_socket_id(int cpu); 18 - int cpu_map__get_socket(struct perf_cpu_map *map, int idx, void *data); 34 + struct aggr_cpu_id cpu_map__get_socket(struct perf_cpu_map *map, int idx, void *data); 19 35 int cpu_map__get_die_id(int cpu); 20 - int cpu_map__get_die(struct perf_cpu_map *map, int idx, void *data); 36 + struct aggr_cpu_id cpu_map__get_die(struct perf_cpu_map *map, int idx, void *data); 21 37 int cpu_map__get_core_id(int cpu); 22 - int cpu_map__get_core(struct perf_cpu_map *map, int idx, void *data); 38 + struct aggr_cpu_id cpu_map__get_core(struct perf_cpu_map *map, int idx, void *data); 23 39 int cpu_map__get_node_id(int cpu); 24 - int cpu_map__get_node(struct perf_cpu_map *map, int idx, void *data); 25 - int cpu_map__build_socket_map(struct perf_cpu_map *cpus, struct perf_cpu_map **sockp); 26 - int cpu_map__build_die_map(struct perf_cpu_map *cpus, struct perf_cpu_map **diep); 27 - int cpu_map__build_core_map(struct perf_cpu_map *cpus, struct perf_cpu_map **corep); 28 - int cpu_map__build_node_map(struct perf_cpu_map *cpus, struct perf_cpu_map **nodep); 40 + struct aggr_cpu_id cpu_map__get_node(struct perf_cpu_map *map, int idx, void *data); 41 + int cpu_map__build_socket_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **sockp); 42 + int cpu_map__build_die_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **diep); 43 + int cpu_map__build_core_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **corep); 44 + int cpu_map__build_node_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **nodep); 29 45 const struct perf_cpu_map *cpu_map__online(void); /* thread unsafe */ 30 46 31 47 static inline int cpu_map__socket(struct perf_cpu_map *sock, int s) ··· 51 35 return sock->map[s]; 52 36 } 53 37 54 - static inline int cpu_map__id_to_socket(int id) 55 - { 56 - return id >> 24; 57 - } 58 - 59 - static inline int cpu_map__id_to_die(int id) 60 - { 61 - return (id >> 16) & 0xff; 62 - } 63 - 64 - static inline int cpu_map__id_to_cpu(int id) 65 - { 66 - return id & 0xffff; 67 - } 68 - 69 38 int cpu__setup_cpunode_map(void); 70 39 71 40 int cpu__max_node(void); ··· 58 57 int cpu__max_present_cpu(void); 59 58 int cpu__get_node(int cpu); 60 59 61 - int cpu_map__build_map(struct perf_cpu_map *cpus, struct perf_cpu_map **res, 62 - int (*f)(struct perf_cpu_map *map, int cpu, void *data), 60 + int cpu_map__build_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **res, 61 + struct aggr_cpu_id (*f)(struct perf_cpu_map *map, int cpu, void *data), 63 62 void *data); 64 63 65 64 int cpu_map__cpu(struct perf_cpu_map *cpus, int idx); 66 65 bool cpu_map__has(struct perf_cpu_map *cpus, int cpu); 66 + 67 + bool cpu_map__compare_aggr_cpu_id(struct aggr_cpu_id a, struct aggr_cpu_id b); 68 + bool cpu_map__aggr_cpu_id_is_empty(struct aggr_cpu_id a); 69 + struct aggr_cpu_id cpu_map__empty_aggr_cpu_id(void); 67 70 68 71 #endif /* __PERF_CPUMAP_H */
+10 -3
tools/perf/util/probe-file.c
··· 791 791 const char *sdtgrp) 792 792 { 793 793 struct strbuf buf; 794 - char *ret = NULL, **args; 794 + char *ret = NULL; 795 795 int i, args_count, err; 796 796 unsigned long long ref_ctr_offset; 797 797 ··· 813 813 goto out; 814 814 815 815 if (note->args) { 816 - args = argv_split(note->args, &args_count); 816 + char **args = argv_split(note->args, &args_count); 817 + 818 + if (args == NULL) 819 + goto error; 817 820 818 821 for (i = 0; i < args_count; ++i) { 819 - if (synthesize_sdt_probe_arg(&buf, i, args[i]) < 0) 822 + if (synthesize_sdt_probe_arg(&buf, i, args[i]) < 0) { 823 + argv_free(args); 820 824 goto error; 825 + } 821 826 } 827 + 828 + argv_free(args); 822 829 } 823 830 824 831 out:
+61 -41
tools/perf/util/stat-display.c
··· 68 68 69 69 70 70 static void aggr_printout(struct perf_stat_config *config, 71 - struct evsel *evsel, int id, int nr) 71 + struct evsel *evsel, struct aggr_cpu_id id, int nr) 72 72 { 73 73 switch (config->aggr_mode) { 74 74 case AGGR_CORE: 75 75 fprintf(config->output, "S%d-D%d-C%*d%s%*d%s", 76 - cpu_map__id_to_socket(id), 77 - cpu_map__id_to_die(id), 76 + id.socket, 77 + id.die, 78 78 config->csv_output ? 0 : -8, 79 - cpu_map__id_to_cpu(id), 79 + id.core, 80 80 config->csv_sep, 81 81 config->csv_output ? 0 : 4, 82 82 nr, ··· 84 84 break; 85 85 case AGGR_DIE: 86 86 fprintf(config->output, "S%d-D%*d%s%*d%s", 87 - cpu_map__id_to_socket(id << 16), 87 + id.socket, 88 88 config->csv_output ? 0 : -8, 89 - cpu_map__id_to_die(id << 16), 89 + id.die, 90 90 config->csv_sep, 91 91 config->csv_output ? 0 : 4, 92 92 nr, ··· 95 95 case AGGR_SOCKET: 96 96 fprintf(config->output, "S%*d%s%*d%s", 97 97 config->csv_output ? 0 : -5, 98 - id, 98 + id.socket, 99 99 config->csv_sep, 100 100 config->csv_output ? 0 : 4, 101 101 nr, ··· 104 104 case AGGR_NODE: 105 105 fprintf(config->output, "N%*d%s%*d%s", 106 106 config->csv_output ? 0 : -5, 107 - id, 107 + id.node, 108 108 config->csv_sep, 109 109 config->csv_output ? 0 : 4, 110 110 nr, ··· 113 113 case AGGR_NONE: 114 114 if (evsel->percore && !config->percore_show_thread) { 115 115 fprintf(config->output, "S%d-D%d-C%*d%s", 116 - cpu_map__id_to_socket(id), 117 - cpu_map__id_to_die(id), 116 + id.socket, 117 + id.die, 118 118 config->csv_output ? 0 : -3, 119 - cpu_map__id_to_cpu(id), config->csv_sep); 120 - } else if (id > -1) { 119 + id.core, config->csv_sep); 120 + } else if (id.core > -1) { 121 121 fprintf(config->output, "CPU%*d%s", 122 122 config->csv_output ? 0 : -7, 123 - evsel__cpus(evsel)->map[id], 123 + evsel__cpus(evsel)->map[id.core], 124 124 config->csv_sep); 125 125 } 126 126 break; 127 127 case AGGR_THREAD: 128 128 fprintf(config->output, "%*s-%*d%s", 129 129 config->csv_output ? 0 : 16, 130 - perf_thread_map__comm(evsel->core.threads, id), 130 + perf_thread_map__comm(evsel->core.threads, id.thread), 131 131 config->csv_output ? 0 : -8, 132 - perf_thread_map__pid(evsel->core.threads, id), 132 + perf_thread_map__pid(evsel->core.threads, id.thread), 133 133 config->csv_sep); 134 134 break; 135 135 case AGGR_GLOBAL: ··· 144 144 bool newline; 145 145 const char *prefix; 146 146 int nfields; 147 - int id, nr; 147 + int nr; 148 + struct aggr_cpu_id id; 148 149 struct evsel *evsel; 149 150 }; 150 151 ··· 320 319 } 321 320 322 321 static int first_shadow_cpu(struct perf_stat_config *config, 323 - struct evsel *evsel, int id) 322 + struct evsel *evsel, struct aggr_cpu_id id) 324 323 { 325 324 struct evlist *evlist = evsel->evlist; 326 325 int i; 327 326 328 327 if (config->aggr_mode == AGGR_NONE) 329 - return id; 328 + return id.core; 330 329 331 330 if (!config->aggr_get_id) 332 331 return 0; ··· 334 333 for (i = 0; i < evsel__nr_cpus(evsel); i++) { 335 334 int cpu2 = evsel__cpus(evsel)->map[i]; 336 335 337 - if (config->aggr_get_id(config, evlist->core.cpus, cpu2) == id) 336 + if (cpu_map__compare_aggr_cpu_id( 337 + config->aggr_get_id(config, evlist->core.cpus, cpu2), 338 + id)) { 338 339 return cpu2; 340 + } 339 341 } 340 342 return 0; 341 343 } 342 344 343 345 static void abs_printout(struct perf_stat_config *config, 344 - int id, int nr, struct evsel *evsel, double avg) 346 + struct aggr_cpu_id id, int nr, struct evsel *evsel, double avg) 345 347 { 346 348 FILE *output = config->output; 347 349 double sc = evsel->scale; ··· 397 393 return false; 398 394 } 399 395 400 - static void printout(struct perf_stat_config *config, int id, int nr, 396 + static void printout(struct perf_stat_config *config, struct aggr_cpu_id id, int nr, 401 397 struct evsel *counter, double uval, 402 398 char *prefix, u64 run, u64 ena, double noise, 403 399 struct runtime_stat *st) ··· 500 496 static void aggr_update_shadow(struct perf_stat_config *config, 501 497 struct evlist *evlist) 502 498 { 503 - int cpu, s2, id, s; 499 + int cpu, s; 500 + struct aggr_cpu_id s2, id; 504 501 u64 val; 505 502 struct evsel *counter; 506 503 ··· 511 506 val = 0; 512 507 for (cpu = 0; cpu < evsel__nr_cpus(counter); cpu++) { 513 508 s2 = config->aggr_get_id(config, evlist->core.cpus, cpu); 514 - if (s2 != id) 509 + if (!cpu_map__compare_aggr_cpu_id(s2, id)) 515 510 continue; 516 511 val += perf_counts(counter->counts, cpu, 0)->val; 517 512 } ··· 589 584 590 585 struct aggr_data { 591 586 u64 ena, run, val; 592 - int id; 587 + struct aggr_cpu_id id; 593 588 int nr; 594 589 int cpu; 595 590 }; ··· 598 593 struct evsel *counter, void *data, bool first) 599 594 { 600 595 struct aggr_data *ad = data; 601 - int cpu, s2; 596 + int cpu; 597 + struct aggr_cpu_id s2; 602 598 603 599 for (cpu = 0; cpu < evsel__nr_cpus(counter); cpu++) { 604 600 struct perf_counts_values *counts; 605 601 606 602 s2 = config->aggr_get_id(config, evsel__cpus(counter), cpu); 607 - if (s2 != ad->id) 603 + if (!cpu_map__compare_aggr_cpu_id(s2, ad->id)) 608 604 continue; 609 605 if (first) 610 606 ad->nr++; ··· 634 628 struct aggr_data ad; 635 629 FILE *output = config->output; 636 630 u64 ena, run, val; 637 - int id, nr; 631 + int nr; 632 + struct aggr_cpu_id id; 638 633 double uval; 639 634 640 635 ad.id = id = config->aggr_map->map[s]; ··· 656 649 fprintf(output, "%s", prefix); 657 650 658 651 uval = val * counter->scale; 659 - printout(config, cpu != -1 ? cpu : id, nr, counter, uval, prefix, 660 - run, ena, 1.0, &rt_stat); 652 + if (cpu != -1) { 653 + id = cpu_map__empty_aggr_cpu_id(); 654 + id.core = cpu; 655 + } 656 + printout(config, id, nr, counter, uval, 657 + prefix, run, ena, 1.0, &rt_stat); 661 658 if (!metric_only) 662 659 fputc('\n', output); 663 660 } ··· 739 728 continue; 740 729 741 730 buf[i].counter = counter; 742 - buf[i].id = thread; 731 + buf[i].id = cpu_map__empty_aggr_cpu_id(); 732 + buf[i].id.thread = thread; 743 733 buf[i].uval = uval; 744 734 buf[i].val = val; 745 735 buf[i].run = run; ··· 763 751 FILE *output = config->output; 764 752 int nthreads = perf_thread_map__nr(counter->core.threads); 765 753 int ncpus = perf_cpu_map__nr(counter->core.cpus); 766 - int thread, sorted_threads, id; 754 + int thread, sorted_threads; 755 + struct aggr_cpu_id id; 767 756 struct perf_aggr_thread_value *buf; 768 757 769 758 buf = sort_aggr_thread(counter, nthreads, ncpus, &sorted_threads, _target); ··· 781 768 if (config->stats) 782 769 printout(config, id, 0, buf[thread].counter, buf[thread].uval, 783 770 prefix, buf[thread].run, buf[thread].ena, 1.0, 784 - &config->stats[id]); 771 + &config->stats[id.thread]); 785 772 else 786 773 printout(config, id, 0, buf[thread].counter, buf[thread].uval, 787 774 prefix, buf[thread].run, buf[thread].ena, 1.0, ··· 827 814 fprintf(output, "%s", prefix); 828 815 829 816 uval = cd.avg * counter->scale; 830 - printout(config, -1, 0, counter, uval, prefix, cd.avg_running, cd.avg_enabled, 831 - cd.avg, &rt_stat); 817 + printout(config, cpu_map__empty_aggr_cpu_id(), 0, counter, uval, prefix, cd.avg_running, 818 + cd.avg_enabled, cd.avg, &rt_stat); 832 819 if (!metric_only) 833 820 fprintf(output, "\n"); 834 821 } ··· 855 842 u64 ena, run, val; 856 843 double uval; 857 844 int cpu; 845 + struct aggr_cpu_id id; 858 846 859 847 for (cpu = 0; cpu < evsel__nr_cpus(counter); cpu++) { 860 848 struct aggr_data ad = { .cpu = cpu }; ··· 870 856 fprintf(output, "%s", prefix); 871 857 872 858 uval = val * counter->scale; 873 - printout(config, cpu, 0, counter, uval, prefix, run, ena, 1.0, 874 - &rt_stat); 859 + id = cpu_map__empty_aggr_cpu_id(); 860 + id.core = cpu; 861 + printout(config, id, 0, counter, uval, prefix, 862 + run, ena, 1.0, &rt_stat); 875 863 876 864 fputc('\n', output); 877 865 } ··· 888 872 struct evsel *counter; 889 873 u64 ena, run, val; 890 874 double uval; 875 + struct aggr_cpu_id id; 891 876 892 877 nrcpus = evlist->core.cpus->nr; 893 878 for (cpu = 0; cpu < nrcpus; cpu++) { ··· 897 880 if (prefix) 898 881 fputs(prefix, config->output); 899 882 evlist__for_each_entry(evlist, counter) { 883 + id = cpu_map__empty_aggr_cpu_id(); 884 + id.core = cpu; 900 885 if (first) { 901 - aggr_printout(config, counter, cpu, 0); 886 + aggr_printout(config, counter, id, 0); 902 887 first = false; 903 888 } 904 889 val = perf_counts(counter->counts, cpu, 0)->val; ··· 908 889 run = perf_counts(counter->counts, cpu, 0)->run; 909 890 910 891 uval = val * counter->scale; 911 - printout(config, cpu, 0, counter, uval, prefix, run, ena, 1.0, 912 - &rt_stat); 892 + printout(config, id, 0, counter, uval, prefix, 893 + run, ena, 1.0, &rt_stat); 913 894 } 914 895 fputc('\n', config->output); 915 896 } ··· 1159 1140 static void print_percore_thread(struct perf_stat_config *config, 1160 1141 struct evsel *counter, char *prefix) 1161 1142 { 1162 - int s, s2, id; 1143 + int s; 1144 + struct aggr_cpu_id s2, id; 1163 1145 bool first = true; 1164 1146 1165 1147 for (int i = 0; i < evsel__nr_cpus(counter); i++) { 1166 1148 s2 = config->aggr_get_id(config, evsel__cpus(counter), i); 1167 1149 for (s = 0; s < config->aggr_map->nr; s++) { 1168 1150 id = config->aggr_map->map[s]; 1169 - if (s2 == id) 1151 + if (cpu_map__compare_aggr_cpu_id(s2, id)) 1170 1152 break; 1171 1153 } 1172 1154
+1 -1
tools/perf/util/stat.c
··· 313 313 if (!(vals->run && vals->ena)) 314 314 return 0; 315 315 316 - s = cpu_map__get_socket(cpus, cpu, NULL); 316 + s = cpu_map__get_socket(cpus, cpu, NULL).socket; 317 317 if (s < 0) 318 318 return -1; 319 319
+5 -4
tools/perf/util/stat.h
··· 6 6 #include <stdio.h> 7 7 #include <sys/types.h> 8 8 #include <sys/resource.h> 9 + #include "cpumap.h" 9 10 #include "rblist.h" 10 11 11 12 struct perf_cpu_map; ··· 100 99 struct rblist value_list; 101 100 }; 102 101 103 - typedef int (*aggr_get_id_t)(struct perf_stat_config *config, 102 + typedef struct aggr_cpu_id (*aggr_get_id_t)(struct perf_stat_config *config, 104 103 struct perf_cpu_map *m, int cpu); 105 104 106 105 struct perf_stat_config { ··· 139 138 const char *csv_sep; 140 139 struct stats *walltime_nsecs_stats; 141 140 struct rusage ru_data; 142 - struct perf_cpu_map *aggr_map; 141 + struct cpu_aggr_map *aggr_map; 143 142 aggr_get_id_t aggr_get_id; 144 - struct perf_cpu_map *cpus_aggr_map; 143 + struct cpu_aggr_map *cpus_aggr_map; 145 144 u64 *walltime_run; 146 145 struct rblist metric_events; 147 146 int ctl_fd; ··· 171 170 172 171 struct perf_aggr_thread_value { 173 172 struct evsel *counter; 174 - int id; 173 + struct aggr_cpu_id id; 175 174 double uval; 176 175 u64 val; 177 176 u64 run;