* [GIT PULL 0/7] perf/urgent fixes
@ 2015-02-25 21:05 Arnaldo Carvalho de Melo
2015-02-25 21:05 ` [PATCH 1/7] perf bench: Fix order of arguments to memcpy_alloc_mem Arnaldo Carvalho de Melo
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-02-25 21:05 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
Bruce Merry, David Ahern, Jiri Olsa, Josh Boyer, Paul Mackerras,
Peter Zijlstra, Stephane Eranian, Victor Kamensky, Vineet Gupta,
Arnaldo Carvalho de Melo
Hi Ingo,
Please consider pulling,
- Arnaldo
The following changes since commit 2a6730c8b6e075adf826a89a3e2caa705807afdb:
kprobes/x86: Check for invalid ftrace location in __recover_probed_insn() (2015-02-21 10:33:31 +0100)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo
for you to fetch changes up to 4861f87cd3d133f03e3b39b6650f4e12f1a9e421:
perf tools: Make sparc64 arch point to sparc (2015-02-25 17:39:17 -0300)
----------------------------------------------------------------
perf/urgent fixes:
Infrastructure:
- pthread_attr_setaffinity_np feature detection build fixes (Adrian Hunter, Josh Boyer)
- Fix probing for PERF_FLAG_FD_CLOEXEC flag (Adrian Hunter)
- Fix order of arguments to memcpy_alloc_mem in 'perf bench' (Bruce Merry)
- Sparc64 and Aarch64 build and segfault fixes (David Ahern)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Adrian Hunter (2):
perf tools: Fix pthread_attr_setaffinity_np build error
perf tools: Fix probing for PERF_FLAG_FD_CLOEXEC flag
Bruce Merry (1):
perf bench: Fix order of arguments to memcpy_alloc_mem
David Ahern (3):
perf top: Fix SIGBUS on sparc64
perf symbols: Define EM_AARCH64 for older OSes
perf tools: Make sparc64 arch point to sparc
Josh Boyer (1):
perf tools: Define _GNU_SOURCE on pthread_attr_setaffinity_np feature check
tools/perf/bench/mem-memcpy.c | 4 ++--
tools/perf/config/Makefile.arch | 4 ++++
tools/perf/config/feature-checks/Makefile | 2 +-
.../feature-checks/test-pthread-attr-setaffinity-np.c | 3 ++-
tools/perf/util/cloexec.c | 18 +++++++++++++++---
tools/perf/util/evlist.h | 2 +-
tools/perf/util/symbol-elf.c | 5 +++++
7 files changed, 30 insertions(+), 8 deletions(-)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/7] perf bench: Fix order of arguments to memcpy_alloc_mem
2015-02-25 21:05 [GIT PULL 0/7] perf/urgent fixes Arnaldo Carvalho de Melo
@ 2015-02-25 21:05 ` Arnaldo Carvalho de Melo
2015-02-25 21:05 ` [PATCH 2/7] perf tools: Define _GNU_SOURCE on pthread_attr_setaffinity_np feature check Arnaldo Carvalho de Melo
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-02-25 21:05 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Bruce Merry, Paul Mackerras, Peter Zijlstra,
Arnaldo Carvalho de Melo
From: Bruce Merry <bmerry@ska.ac.za>
This was causing the destination instead of the source to be filled. As
a result, the source was typically all mapped to one zero page, and
hence very cacheable.
Signed-off-by: Bruce Merry <bmerry@ska.ac.za>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20150115092022.GA11292@kryton
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/bench/mem-memcpy.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/bench/mem-memcpy.c b/tools/perf/bench/mem-memcpy.c
index 6c14afe8c1b1..db1d3a29d97f 100644
--- a/tools/perf/bench/mem-memcpy.c
+++ b/tools/perf/bench/mem-memcpy.c
@@ -289,7 +289,7 @@ static u64 do_memcpy_cycle(const struct routine *r, size_t len, bool prefault)
memcpy_t fn = r->fn.memcpy;
int i;
- memcpy_alloc_mem(&src, &dst, len);
+ memcpy_alloc_mem(&dst, &src, len);
if (prefault)
fn(dst, src, len);
@@ -312,7 +312,7 @@ static double do_memcpy_gettimeofday(const struct routine *r, size_t len,
void *src = NULL, *dst = NULL;
int i;
- memcpy_alloc_mem(&src, &dst, len);
+ memcpy_alloc_mem(&dst, &src, len);
if (prefault)
fn(dst, src, len);
--
1.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/7] perf tools: Define _GNU_SOURCE on pthread_attr_setaffinity_np feature check
2015-02-25 21:05 [GIT PULL 0/7] perf/urgent fixes Arnaldo Carvalho de Melo
2015-02-25 21:05 ` [PATCH 1/7] perf bench: Fix order of arguments to memcpy_alloc_mem Arnaldo Carvalho de Melo
@ 2015-02-25 21:05 ` Arnaldo Carvalho de Melo
2015-02-25 21:05 ` [PATCH 3/7] perf tools: Fix pthread_attr_setaffinity_np build error Arnaldo Carvalho de Melo
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-02-25 21:05 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Josh Boyer, Jiri Olsa, Peter Zijlstra, Vineet Gupta,
Arnaldo Carvalho de Melo
From: Josh Boyer <jwboyer@fedoraproject.org>
The man page for pthread_attr_set_affinity_np states that _GNU_SOURCE
must be defined before pthread.h is included in order to get the proper
function declaration. Define this in the Makefile.
Without this defined, the feature check fails on a Fedora system with
gcc5 and then the perf build later fails with conflicting prototypes for
the function.
Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
Link: http://lkml.kernel.org/r/20150211162404.GA15522@hansolo.redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/config/feature-checks/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/config/feature-checks/Makefile b/tools/perf/config/feature-checks/Makefile
index 42ac05aaf8ac..b32ff3372514 100644
--- a/tools/perf/config/feature-checks/Makefile
+++ b/tools/perf/config/feature-checks/Makefile
@@ -49,7 +49,7 @@ test-hello.bin:
$(BUILD)
test-pthread-attr-setaffinity-np.bin:
- $(BUILD) -Werror -lpthread
+ $(BUILD) -D_GNU_SOURCE -Werror -lpthread
test-stackprotector-all.bin:
$(BUILD) -Werror -fstack-protector-all
--
1.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/7] perf tools: Fix pthread_attr_setaffinity_np build error
2015-02-25 21:05 [GIT PULL 0/7] perf/urgent fixes Arnaldo Carvalho de Melo
2015-02-25 21:05 ` [PATCH 1/7] perf bench: Fix order of arguments to memcpy_alloc_mem Arnaldo Carvalho de Melo
2015-02-25 21:05 ` [PATCH 2/7] perf tools: Define _GNU_SOURCE on pthread_attr_setaffinity_np feature check Arnaldo Carvalho de Melo
@ 2015-02-25 21:05 ` Arnaldo Carvalho de Melo
2015-02-25 21:05 ` [PATCH 5/7] perf top: Fix SIGBUS on sparc64 Arnaldo Carvalho de Melo
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-02-25 21:05 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Adrian Hunter, Jiri Olsa, Arnaldo Carvalho de Melo
From: Adrian Hunter <adrian.hunter@intel.com>
Feature detection for pthread_attr_setaffinity_np was failing, producing
this error:
In file included from bench/futex-hash.c:17:0:
bench/futex.h:73:19: error: conflicting types for ‘pthread_attr_setaffinity_np’
static inline int pthread_attr_setaffinity_np(pthread_attr_t *attr,
^
In file included from bench/futex.h:72:0,
from bench/futex-hash.c:17:
/usr/include/pthread.h:407:12: note: previous declaration of ‘pthread_attr_setaffinity_np’ was here
extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr,
^
make[3]: *** [bench/futex-hash.o] Error 1
make[2]: *** [bench] Error 2
make[2]: *** Waiting for unfinished jobs....
This was because compiling test-pthread-attr-setaffinity-np.c
failed due to the function arguments:
test-pthread-attr-setaffinity-np.c: In function ‘main’:
test-pthread-attr-setaffinity-np.c:11:2: warning: null argument where non-null required (argument 3) [-Wnonnull]
ret = pthread_attr_setaffinity_np(&thread_attr, 0, NULL);
^
So fix the arguments.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Tested-by: Stephane Eranian <eranian@google.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1424774766-24194-1-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c b/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c
index 0a0d3ecb4e8a..2b81b72eca23 100644
--- a/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c
+++ b/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c
@@ -5,10 +5,11 @@ int main(void)
{
int ret = 0;
pthread_attr_t thread_attr;
+ cpu_set_t cs;
pthread_attr_init(&thread_attr);
/* don't care abt exact args, just the API itself in libpthread */
- ret = pthread_attr_setaffinity_np(&thread_attr, 0, NULL);
+ ret = pthread_attr_setaffinity_np(&thread_attr, sizeof(cs), &cs);
return ret;
}
--
1.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 5/7] perf top: Fix SIGBUS on sparc64
2015-02-25 21:05 [GIT PULL 0/7] perf/urgent fixes Arnaldo Carvalho de Melo
` (2 preceding siblings ...)
2015-02-25 21:05 ` [PATCH 3/7] perf tools: Fix pthread_attr_setaffinity_np build error Arnaldo Carvalho de Melo
@ 2015-02-25 21:05 ` Arnaldo Carvalho de Melo
2015-02-25 21:05 ` [PATCH 6/7] perf symbols: Define EM_AARCH64 for older OSes Arnaldo Carvalho de Melo
2015-02-25 21:05 ` [PATCH 7/7] perf tools: Make sparc64 arch point to sparc Arnaldo Carvalho de Melo
5 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-02-25 21:05 UTC (permalink / raw)
To: Ingo Molnar; +Cc: linux-kernel, David Ahern, Arnaldo Carvalho de Melo
From: David Ahern <david.ahern@oracle.com>
perf-top is terminating due to SIGBUS on sparc64. git bisect points to:
commit 82396986032915c1572bfb74b224fcc2e4e8ba7c
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
Date: Mon Sep 8 13:26:35 2014 -0300
perf evlist: Refcount mmaps
We need to know how many fds are using a perf mmap via
PERF_EVENT_IOC_SET_OUTPUT, so that we can know when to ditch an mmap,
refcount it.
This commit added 'int refcnt' to struct perf_mmap and the addition makes the
event_copy element no longer 8-byte aligned.
Fix by adding __attribute__((aligned(8))) to the event_copy struct
member.
Signed-off-by: David Ahern <david.ahern@oracle.com>
Link: http://lkml.kernel.org/r/1424304198-92028-1-git-send-email-david.ahern@oracle.com
[ Switched from 'int pad;' to using __attribute__, David tested/acked that ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/evlist.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index c94a9e03ecf1..e99a67632831 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -28,7 +28,7 @@ struct perf_mmap {
int mask;
int refcnt;
unsigned int prev;
- char event_copy[PERF_SAMPLE_MAX_SIZE];
+ char event_copy[PERF_SAMPLE_MAX_SIZE] __attribute__((aligned(8)));
};
struct perf_evlist {
--
1.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 6/7] perf symbols: Define EM_AARCH64 for older OSes
2015-02-25 21:05 [GIT PULL 0/7] perf/urgent fixes Arnaldo Carvalho de Melo
` (3 preceding siblings ...)
2015-02-25 21:05 ` [PATCH 5/7] perf top: Fix SIGBUS on sparc64 Arnaldo Carvalho de Melo
@ 2015-02-25 21:05 ` Arnaldo Carvalho de Melo
2015-02-25 21:05 ` [PATCH 7/7] perf tools: Make sparc64 arch point to sparc Arnaldo Carvalho de Melo
5 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-02-25 21:05 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, David Ahern, Victor Kamensky,
Arnaldo Carvalho de Melo
From: David Ahern <david.ahern@oracle.com>
4886f2ca19f6f added an arm-64 check, but the EM_AARCH64 macro is not
defined in older releases (e.g., RHEL6). Define if it is not defined.
Signed-off-by: David Ahern <david.ahern@oracle.com>
Cc: Victor Kamensky <victor.kamensky@linaro.org>
Link: http://lkml.kernel.org/r/1424306017-96797-1-git-send-email-david.ahern@oracle.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/symbol-elf.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index b24f9d8727a8..33b7a2aef713 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -11,6 +11,11 @@
#include <symbol/kallsyms.h>
#include "debug.h"
+#ifndef EM_AARCH64
+#define EM_AARCH64 183 /* ARM 64 bit */
+#endif
+
+
#ifdef HAVE_CPLUS_DEMANGLE_SUPPORT
extern char *cplus_demangle(const char *, int);
--
1.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 7/7] perf tools: Make sparc64 arch point to sparc
2015-02-25 21:05 [GIT PULL 0/7] perf/urgent fixes Arnaldo Carvalho de Melo
` (4 preceding siblings ...)
2015-02-25 21:05 ` [PATCH 6/7] perf symbols: Define EM_AARCH64 for older OSes Arnaldo Carvalho de Melo
@ 2015-02-25 21:05 ` Arnaldo Carvalho de Melo
5 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-02-25 21:05 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, David Ahern, Jiri Olsa, Arnaldo Carvalho de Melo
From: David Ahern <david.ahern@oracle.com>
The recent build changes cause perf to not compile for sparc64 since the
arch/sparc64/Build file does not exist:
/home/dahern/kernels/linux.git/tools/build/Makefile.build:40: arch/sparc64/Build: No such file or directory
Fix by converting the sparc64 RAW_ARCH to sparc ARCH -- similar to what
is done for x86_64.
Signed-off-by: David Ahern <david.ahern@oracle.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1424306222-96843-1-git-send-email-david.ahern@oracle.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/config/Makefile.arch | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/perf/config/Makefile.arch b/tools/perf/config/Makefile.arch
index ff95a68741d1..ac8721ffa6c8 100644
--- a/tools/perf/config/Makefile.arch
+++ b/tools/perf/config/Makefile.arch
@@ -21,6 +21,10 @@ ifeq ($(RAW_ARCH),x86_64)
endif
endif
+ifeq ($(RAW_ARCH),sparc64)
+ ARCH ?= sparc
+endif
+
ARCH ?= $(RAW_ARCH)
LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
--
1.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-02-25 21:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-25 21:05 [GIT PULL 0/7] perf/urgent fixes Arnaldo Carvalho de Melo
2015-02-25 21:05 ` [PATCH 1/7] perf bench: Fix order of arguments to memcpy_alloc_mem Arnaldo Carvalho de Melo
2015-02-25 21:05 ` [PATCH 2/7] perf tools: Define _GNU_SOURCE on pthread_attr_setaffinity_np feature check Arnaldo Carvalho de Melo
2015-02-25 21:05 ` [PATCH 3/7] perf tools: Fix pthread_attr_setaffinity_np build error Arnaldo Carvalho de Melo
2015-02-25 21:05 ` [PATCH 5/7] perf top: Fix SIGBUS on sparc64 Arnaldo Carvalho de Melo
2015-02-25 21:05 ` [PATCH 6/7] perf symbols: Define EM_AARCH64 for older OSes Arnaldo Carvalho de Melo
2015-02-25 21:05 ` [PATCH 7/7] perf tools: Make sparc64 arch point to sparc Arnaldo Carvalho de Melo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox