Skip to content

Commit

Permalink
perf tools: Allow building for tile
Browse files Browse the repository at this point in the history
Tested by building perf:
- Cross-compiled for tile on x86_64
- Built natively on tile

Signed-off-by: Zhigang Lu <zlu@tilera.com>
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
  • Loading branch information
Zhigang Lu authored and Chris Metcalf committed Mar 7, 2014
1 parent 8d61dd7 commit 620830b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/perf/config/Makefile.arch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
-e s/arm.*/arm/ -e s/sa110/arm/ \
-e s/s390x/s390/ -e s/parisc64/parisc/ \
-e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
-e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ )
-e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \
-e s/tile.*/tile/ )

# Additional ARCH settings for x86
ifeq ($(ARCH),i386)
Expand Down
8 changes: 8 additions & 0 deletions tools/perf/perf.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@
#define CPUINFO_PROC "core ID"
#endif

#ifdef __tile__
#define mb() asm volatile ("mf" ::: "memory")
#define wmb() asm volatile ("mf" ::: "memory")
#define rmb() asm volatile ("mf" ::: "memory")
#define cpu_relax() asm volatile ("mfspr zero, PASS" ::: "memory")
#define CPUINFO_PROC "model name"
#endif

#define barrier() asm volatile ("" ::: "memory")

#ifndef cpu_relax
Expand Down

0 comments on commit 620830b

Please sign in to comment.