perf fixes
Subsystems (2)
Linus,
Please pull the latest perf-urgent-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf-urgent-for-linus
# HEAD: fb7df12d645cfba6a76a45fdcc7e3f7fbbcda661 tools/headers: Synchronize kernel ABI headers
Various fixes:
- synchronize kernel and tooling headers
- cgroup support fix
- two tooling fixes
Thanks,
Ingo
------------------>
Ingo Molnar (1):
tools/headers: Synchronize kernel ABI headers
Jiri Olsa (1):
perf tools: Unwind properly location after REJECT
Ravi Bangoria (1):
perf symbols: Fix memory corruption because of zero length symbols
Tejun Heo (1):
perf/cgroup: Fix perf cgroup hierarchy support
include/uapi/sound/asound.h | 6 +++--- kernel/events/core.c | 6 ++++-- tools/arch/x86/include/asm/disabled-features.h | 1 - tools/arch/x86/include/asm/required-features.h | 1 - tools/arch/x86/include/uapi/asm/unistd.h | 1 + tools/arch/x86/lib/memcpy_64.S | 5 ++++- tools/include/asm-generic/bitops/__fls.h | 1 + tools/include/asm-generic/bitops/arch_hweight.h | 1 + tools/include/asm-generic/bitops/const_hweight.h | 1 + tools/include/asm-generic/bitops/fls.h | 1 + tools/include/asm-generic/bitops/fls64.h | 1 + tools/include/asm/export.h | 7 +++++++ tools/include/linux/hash.h | 1 - tools/include/uapi/asm-generic/ioctls.h | 1 + tools/include/uapi/asm-generic/mman-common.h | 1 + tools/include/uapi/asm-generic/mman.h | 4 ++-- tools/include/uapi/linux/bpf.h | 4 ++-- tools/include/uapi/linux/bpf_common.h | 2 +- tools/include/uapi/linux/fcntl.h | 2 +- tools/include/uapi/linux/hw_breakpoint.h | 2 +- tools/include/uapi/linux/kvm.h | 1 + tools/include/uapi/linux/mman.h | 2 +- tools/include/uapi/linux/perf_event.h | 1 + tools/include/uapi/linux/sched.h | 1 + tools/include/uapi/linux/stat.h | 2 +- tools/include/uapi/linux/vhost.h | 1 + tools/include/uapi/sound/asound.h | 1 + tools/perf/util/annotate.c | 12 +++++++++++- tools/perf/util/parse-events.l | 8 ++++++-- 29 files changed, 57 insertions(+), 21 deletions(-) create mode 100644 tools/include/asm/export.h
include/uapi/sound/asound.h +3 -3
@@ -94,7 +94,7 @@ enum {SNDRV_HWDEP_IFACE_VX ,/* Digigram VX cards */ SNDRV_HWDEP_IFACE_MIXART ,/* Digigram miXart cards */ SNDRV_HWDEP_IFACE_USX2Y ,/* Tascam US122, US224 & US428 usb */ -SNDRV_HWDEP_IFACE_EMUX_WAVETABLE ,/* EmuX wavetable */ +SNDRV_HWDEP_IFACE_EMUX_WAVETABLE ,/* EmuX wavetable */ SNDRV_HWDEP_IFACE_BLUETOOTH ,/* Bluetooth audio */ SNDRV_HWDEP_IFACE_USX2Y_PCM ,/* Tascam US122, US224 & US428 rawusb pcm */ SNDRV_HWDEP_IFACE_PCXHR, /* Digigram PCXHR */
@@ -384,7 +384,7 @@ struct snd_mask {struct snd_pcm_hw_params {unsigned int flags; -struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - +struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK -SNDRV_PCM_HW_PARAM_FIRST_MASK +1 ];struct snd_mask mres[5 ];/* reserved masks */ struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL -
@@ -857,7 +857,7 @@ typedef int __bitwise snd_ctl_elem_iface_t;#define SNDRV_CTL_ELEM_ACCESS_INACTIVE (1<<8)/* control does actually nothing, but may be updated */ #define SNDRV_CTL_ELEM_ACCESS_LOCK (1<<9)/* write lock */ #define SNDRV_CTL_ELEM_ACCESS_OWNER (1<<10)/* write lock owner */ -#define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK (1<<28)/* kernel use a TLV callback */ +#define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK (1<<28)/* kernel use a TLV callback */ #define SNDRV_CTL_ELEM_ACCESS_USER (1<<29)/* user space element */ /* bits 30 and 31 are obsoleted (for indirect access) */
kernel/events/core.c +4 -2
@@ -901,9 +901,11 @@ list_update_cgroup_event(struct perf_event *event, cpuctx_entry = &cpuctx->cgrp_cpuctx_entry;/* cpuctx->cgrp is NULL unless a cgroup event is active in this CPU .*/ if (add) { +struct perf_cgroup *cgrp =perf_cgroup_from_task (current, ctx); +list_add (cpuctx_entry,this_cpu_ptr (&cgrp_cpuctx_list)); -if (perf_cgroup_from_task (current, ctx) == event->cgrp) - cpuctx->cgrp = event->cgrp; +if (cgroup_is_descendant (cgrp->css.cgroup, event->cgrp->css.cgroup)) + cpuctx->cgrp = cgrp; }else {list_del (cpuctx_entry); cpuctx->cgrp =NULL ;
tools/arch/x86/include/asm/disabled-features.h +0 -1
@@ -1,4 +1,3 @@ -/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_X86_DISABLED_FEATURES_H#define _ASM_X86_DISABLED_FEATURES_H
tools/arch/x86/include/asm/required-features.h +0 -1
@@ -1,4 +1,3 @@ -/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_X86_REQUIRED_FEATURES_H#define _ASM_X86_REQUIRED_FEATURES_H
tools/arch/x86/include/uapi/asm/unistd.h +1 -0
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef _UAPI_ASM_X86_UNISTD_H#define _UAPI_ASM_X86_UNISTD_H
tools/arch/x86/lib/memcpy_64.S +4 -1
@@ -1,10 +1,10 @@ -/* SPDX-License-Identifier: GPL-2.0 */ /* Copyright 2002 Andi Kleen */ #include <linux/linkage.h> #include <asm/errno.h> #include <asm/cpufeatures.h> #include <asm/alternative-asm.h> +#include <asm/export.h> /* * We build a jump to memcpy_orig by default which gets NOPped out on
@@ -41,6 +41,8 @@ ENTRY(memcpy) ret ENDPROC(memcpy) ENDPROC(__memcpy) +EXPORT_SYMBOL(memcpy) +EXPORT_SYMBOL(__memcpy) /* * memcpy_erms() - enhanced fast string memcpy. This is faster and
@@ -275,6 +277,7 @@ ENTRY(memcpy_mcsafe_unrolled) xorq %rax, %rax ret ENDPROC(memcpy_mcsafe_unrolled) +EXPORT_SYMBOL_GPL(memcpy_mcsafe_unrolled) .section .fixup, "ax" /* Return -EFAULT for any failure */
tools/include/asm-generic/bitops/__fls.h +1 -0
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS___FLS_H_#define _ASM_GENERIC_BITOPS___FLS_H_
tools/include/asm-generic/bitops/arch_hweight.h +1 -0
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_ARCH_HWEIGHT_H_#define _ASM_GENERIC_BITOPS_ARCH_HWEIGHT_H_
tools/include/asm-generic/bitops/const_hweight.h +1 -0
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_CONST_HWEIGHT_H_#define _ASM_GENERIC_BITOPS_CONST_HWEIGHT_H_
tools/include/asm-generic/bitops/fls.h +1 -0
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_FLS_H_#define _ASM_GENERIC_BITOPS_FLS_H_
tools/include/asm-generic/bitops/fls64.h +1 -0
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_FLS64_H_#define _ASM_GENERIC_BITOPS_FLS64_H_
tools/include/asm/export.h new file +7 -0
@@ -0,0 +1,7 @@ +#ifndef _TOOLS_ASM_EXPORT_H +#define _TOOLS_ASM_EXPORT_H + +#define EXPORT_SYMBOL (x) +#define EXPORT_SYMBOL_GPL (x) + +#endif /* _TOOLS_ASM_EXPORT_H */
tools/include/linux/hash.h +0 -1
@@ -1,4 +1,3 @@ -/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _LINUX_HASH_H#define _LINUX_HASH_H/* Fast hashing routine for ints, longs and pointers.
tools/include/uapi/asm-generic/ioctls.h +1 -0
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef __ASM_GENERIC_IOCTLS_H#define __ASM_GENERIC_IOCTLS_H
tools/include/uapi/asm-generic/mman-common.h +1 -0
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef __ASM_GENERIC_MMAN_COMMON_H#define __ASM_GENERIC_MMAN_COMMON_H
tools/include/uapi/asm-generic/mman.h +2 -2
@@ -1,8 +1,8 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef __ASM_GENERIC_MMAN_H#define __ASM_GENERIC_MMAN_H -#include <uapi/asm-generic/mman-common.h> +#include <asm-generic/mman-common.h> #define MAP_GROWSDOWN 0x0100/* stack-like segment */ #define MAP_DENYWRITE 0x0800/* ETXTBSY */
tools/include/uapi/linux/bpf.h +2 -2
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com * * This program is free software; you can redistribute it and/or
@@ -569,10 +570,9 @@ union bpf_attr {* @flags: reserved for future use * Return: 0 on success or negative error code * -* int bpf_sk_redirect_map(skb, map, key, flags) +* int bpf_sk_redirect_map(map, key, flags) * Redirect skb to a sock in map using key as a lookup key for the * sock in map. -* @skb: pointer to skb * @map: pointer to sockmap * @key: key to lookup sock in map * @flags: reserved for future use
tools/include/uapi/linux/bpf_common.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef _UAPI__LINUX_BPF_COMMON_H__#define _UAPI__LINUX_BPF_COMMON_H__
tools/include/uapi/linux/fcntl.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef _UAPI_LINUX_FCNTL_H#define _UAPI_LINUX_FCNTL_H
tools/include/uapi/linux/hw_breakpoint.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef _UAPI_LINUX_HW_BREAKPOINT_H#define _UAPI_LINUX_HW_BREAKPOINT_H
tools/include/uapi/linux/kvm.h +1 -0
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef __LINUX_KVM_H#define __LINUX_KVM_H
tools/include/uapi/linux/mman.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef _UAPI_LINUX_MMAN_H#define _UAPI_LINUX_MMAN_H
tools/include/uapi/linux/perf_event.h +1 -0
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* * Performance events: *
tools/include/uapi/linux/sched.h +1 -0
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef _UAPI_LINUX_SCHED_H#define _UAPI_LINUX_SCHED_H
tools/include/uapi/linux/stat.h +1 -1
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef _UAPI_LINUX_STAT_H#define _UAPI_LINUX_STAT_H
tools/include/uapi/linux/vhost.h +1 -0
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef _LINUX_VHOST_H#define _LINUX_VHOST_H/* Userspace interface for in-kernel virtio accelerators. */
tools/include/uapi/sound/asound.h +1 -0
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ /* * Advanced Linux Sound Architecture - ALSA - Driver * Copyright (c) 1994-2003 by Jaroslav Kysela <[email protected]>,
tools/perf/util/annotate.c +11 -1
@@ -606,9 +606,19 @@ static struct arch *arch__find(const char *name)int symbol__alloc_hist (struct symbol *sym) {struct annotation *notes =symbol__annotation (sym); -const size_t size =symbol__size (sym); +size_t size =symbol__size (sym);size_t sizeof_sym_hist; +/* +* Add buffer of one element for zero length symbol. +* When sample is taken from first instruction of +* zero length symbol, perf still resolves it and +* shows symbol name in perf report and allows to +* annotate it. +*/ +if (size ==0 ) + size =1 ; +/* Check for overflow when calculating sizeof_sym_hist */ if (size > (SIZE_MAX -sizeof (struct sym_hist )) /sizeof (struct sym_hist_entry ))return -1 ;
tools/perf/util/parse-events.l +6 -2
@@ -154,6 +154,10 @@ do { \ yycolumn += yyleng; \ } while (0); +#define USER_REJECT \ + yycolumn -= yyleng; \ + REJECT + %} %x mem
@@ -335,8 +339,8 @@ r{num_raw_hex} { return raw(yyscanner); } {num_hex} { return value(yyscanner, 16); } {modifier_event} { return str(yyscanner, PE_MODIFIER_EVENT); } -{bpf_object} { if (!isbpf(yyscanner)) REJECT; return str(yyscanner, PE_BPF_OBJECT); } -{bpf_source} { if (!isbpf(yyscanner)) REJECT; return str(yyscanner, PE_BPF_SOURCE); } +{bpf_object} { if (!isbpf(yyscanner)) USER_REJECT; return str(yyscanner, PE_BPF_OBJECT); } +{bpf_source} { if (!isbpf(yyscanner)) USER_REJECT; return str(yyscanner, PE_BPF_SOURCE); } {name} { return pmu_str_check(yyscanner); } "/" { BEGIN(config); return '/'; } - { return '-'; }
Quoted 8 lines · Ingo Molnar
Linus,
Please pull the latest perf-urgent-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.gitperf-urgent-for-linusJiri Olsa (1):
perf tools: Unwind properly location after REJECT
The patch above breaks the build for me:
util/parse-events.l: In function ‘parse_events_lex’:util/parse-events-flex.c:4722:16: error: ‘reject_used_but_not_detected’ undeclared (first use in this function)
*/
^
util/parse-events.l:159:2: note: in expansion of macro ‘REJECT’
REJECT
^~~~~~
util/parse-events.l:343:26: note: in expansion of macro ‘USER_REJECT’
{bpf_source} { if (!isbpf(yyscanner)) USER_REJECT; return str(yyscanner, PE_BPF_SOURCE); }
^~~~~~~~~~~
util/parse-events-flex.c:4722:16: note: each undeclared identifier is reported only once for each function it appears in
*/
^util/parse-events.l:159:2: note: in expansion of macro ‘REJECT’
REJECT
^~~~~~
util/parse-events.l:343:26: note: in expansion of macro ‘USER_REJECT’
{bpf_source} { if (!isbpf(yyscanner)) USER_REJECT; return str(yyscanner, PE_BPF_SOURCE); }
^~~~~~~~~~~
mv: cannot stat 'util/.parse-events-flex.o.tmp': No such file or directory
--
Markus