Skip to contentSkip to conversation

ia64 support for tools/perf/

PATCH Applied Luck, Tony 3 participants 7 messages Nov 17, 2009 – Nov 19, 2009 perf events

lore
Share & tools
lore

Luck, Tony

author
#0 lore raw

PATCH 1/1 ia64 support for tools/perf/

Compiler on ia64 rejects the "-m64" option.
Add arch specific pieces to perf.h

---

I expect there is a more elegant solution to the Makefile issue. Feel free to throw away that part of this patch and replace it with something prettier :-)

 tools/perf/Makefile |    8 +++++---
 tools/perf/perf.h   |    6 ++++++
 2 files changed, 11 insertions(+), 3 deletions(-)
tools/perf/Makefile +5 -3
index 7e190d5..078bcef 100644
@@ -164,10 +164,12 @@ ifdef NO_64BIT
   MBITS := -m32
 else
   #
-  # If we're on a 64-bit kernel, use -m64:
+  # If we're on a 64-bit kernel (except ia64), use -m64:
   #
-  ifneq ($(patsubst %64,%,$(uname_M)),$(uname_M))
-    MBITS := -m64
+  ifneq ($(uname_M),ia64)
+    ifneq ($(patsubst %64,%,$(uname_M)),$(uname_M))
+      MBITS := -m64
+    endif
   endif
 endif
 
tools/perf/perf.h +6 -0
index 8cc4623..26be918 100644
@@ -47,6 +47,12 @@
 #define cpu_relax()	asm volatile("":::"memory")
 #endif
 
+#ifdef __ia64__
+#include "../../arch/ia64/include/asm/unistd.h"
+#define rmb()		asm volatile ("mf" ::: "memory")
+#define cpu_relax()	asm volatile ("hint @pause" ::: "memory")
+#endif
+
 #include <time.h>
 #include <unistd.h>
 #include <sys/types.h>
#1 lore raw

[tip:perf/core] perf tools: Add ia64 support for tools/perf/

Commit-ID:  5960a8b22f5015d6e36b2a095c47bc27e8e685c8
Gitweb:     http://git.kernel.org/tip/5960a8b22f5015d6e36b2a095c47bc27e8e685c8
Author:     Luck, Tony <[email protected]>
AuthorDate: Tue, 17 Nov 2009 09:05:56 -0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 17 Nov 2009 18:14:24 +0100

perf tools: Add ia64 support for tools/perf/

Compiler on ia64 rejects the "-m64" option. Add arch specific pieces to perf.h

Cc Peter Zijlstra <[email protected]>
Cc Paul Mackerras <[email protected]>

LKML-Reference: <[email protected]>

---
 tools/perf/Makefile |    8 +++++---
 tools/perf/perf.h   |    6 ++++++
 2 files changed, 11 insertions(+), 3 deletions(-)
tools/perf/Makefile +5 -3
index b356987..53e663a 100644
@@ -166,10 +166,12 @@ ifdef NO_64BIT
   MBITS := -m32
 else
   #
-  # If we're on a 64-bit kernel, use -m64:
+  # If we're on a 64-bit kernel (except ia64), use -m64:
   #
-  ifneq ($(patsubst %64,%,$(uname_M)),$(uname_M))
-    MBITS := -m64
+  ifneq ($(uname_M),ia64)
+    ifneq ($(patsubst %64,%,$(uname_M)),$(uname_M))
+      MBITS := -m64
+    endif
   endif
 endif
 
tools/perf/perf.h +6 -0
index 216bdb2..454d5d5 100644
@@ -53,6 +53,12 @@
 #define cpu_relax()	asm volatile("" ::: "memory")
 #endif
 
+#ifdef __ia64__
+#include "../../arch/ia64/include/asm/unistd.h"
+#define rmb()		asm volatile ("mf" ::: "memory")
+#define cpu_relax()	asm volatile ("hint @pause" ::: "memory")
+#endif
+
 #include <time.h>
 #include <unistd.h>
 #include <sys/types.h>
Applied
#2 lore raw
In reply to Luck, Tony
Quoted 4 lines · Luck, Tony

Compiler on ia64 rejects the "-m64" option.
Add arch specific pieces to perf.h

Applied, thanks Tony!

Quoted 5 lines

---

I expect there is a more elegant solution to the Makefile issue. Feel free to throw away that part of this patch and replace it with something prettier :-)

We looked into including the barrier definition from the kernel header but that looks a bit messy too.

Btw., are you planning HAVE_PERF_EVENTS support for IA64? (It's nice stuff, i can only recommend it! ;-)

Ingo

author
#3 lore raw
Quoted 2 lines

Btw., are you planning HAVE_PERF_EVENTS support for IA64? (It's nice stuff, i can only recommend it! ;-)

My first goal is getting the s/w events hooked up and working. I'm still wondering about how to get the h/w counters to co-exist with perfmon (which has been part of ia64 API for many years).

-Tony

maintainer
#4 lore raw
Quoted 6 lines · Tony
Quoted 2 lines

Btw., are you planning HAVE_PERF_EVENTS support for IA64? (It's nice stuff, i can only recommend it! ;-)

My first goal is getting the s/w events hooked up and working. I'm still wondering about how to get the h/w counters to co-exist with perfmon (which has been part of ia64 API for many years).

A first approach could be to make them mutually exclusive at runtime. When there's a perf_event user, perfmon users get FAIL and vs.

This is basically the state for x86 perf_event vs oprofile atm.

#5 lore raw
Quoted 4 lines · Peter Zijlstra
Quoted 3 lines · Tony
Quoted 2 lines

Btw., are you planning HAVE_PERF_EVENTS support for IA64? (It's nice stuff, i can only recommend it! ;-)

Quoted 8 lines
Quoted 3 lines

My first goal is getting the s/w events hooked up and working. I'm still wondering about how to get the h/w counters to co-exist with perfmon (which has been part of ia64 API for many years).

A first approach could be to make them mutually exclusive at runtime. When there's a perf_event user, perfmon users get FAIL and vs.

This is basically the state for x86 perf_event vs oprofile atm.

Yep, this is probably the least intrusive approach. Mixing the implementations beyond trivial exclusion would probably be pain.

Ingo

#6 lore raw

[tip:perf/core] perf tools: Add ia64 support for tools/perf/

In reply to Luck, Tony
Commit-ID:  11ada26c78febe4662a8e848f3bff74e3200c920
Gitweb:     http://git.kernel.org/tip/11ada26c78febe4662a8e848f3bff74e3200c920
Author:     Luck, Tony <[email protected]>
AuthorDate: Tue, 17 Nov 2009 09:05:56 -0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 19 Nov 2009 06:03:33 +0100

perf tools: Add ia64 support for tools/perf/

Compiler on ia64 rejects the "-m64" option. Add arch specific pieces to perf.h

Cc Peter Zijlstra <[email protected]>
Cc Paul Mackerras <[email protected]>

LKML-Reference: <[email protected]>

---
 tools/perf/Makefile |    8 +++++---
 tools/perf/perf.h   |    6 ++++++
 2 files changed, 11 insertions(+), 3 deletions(-)
tools/perf/Makefile +5 -3
index 5d1a8b0..3f0666a 100644
@@ -166,10 +166,12 @@ ifdef NO_64BIT
   MBITS := -m32
 else
   #
-  # If we're on a 64-bit kernel, use -m64:
+  # If we're on a 64-bit kernel (except ia64), use -m64:
   #
-  ifneq ($(patsubst %64,%,$(uname_M)),$(uname_M))
-    MBITS := -m64
+  ifneq ($(uname_M),ia64)
+    ifneq ($(patsubst %64,%,$(uname_M)),$(uname_M))
+      MBITS := -m64
+    endif
   endif
 endif
 
tools/perf/perf.h +6 -0
index 216bdb2..454d5d5 100644
@@ -53,6 +53,12 @@
 #define cpu_relax()	asm volatile("" ::: "memory")
 #endif
 
+#ifdef __ia64__
+#include "../../arch/ia64/include/asm/unistd.h"
+#define rmb()		asm volatile ("mf" ::: "memory")
+#define cpu_relax()	asm volatile ("hint @pause" ::: "memory")
+#endif
+
 #include <time.h>
 #include <unistd.h>
 #include <sys/types.h>