diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/perf/arch/s390/Makefile | 1 | ||||
| -rw-r--r-- | tools/perf/arch/s390/util/header.c | 28 | ||||
| -rw-r--r-- | tools/perf/perf-sys.h | 1 |
3 files changed, 30 insertions, 0 deletions
diff --git a/tools/perf/arch/s390/Makefile b/tools/perf/arch/s390/Makefile index 15130b50dfe3..744e629797be 100644 --- a/tools/perf/arch/s390/Makefile +++ b/tools/perf/arch/s390/Makefile | |||
| @@ -2,3 +2,4 @@ ifndef NO_DWARF | |||
| 2 | PERF_HAVE_DWARF_REGS := 1 | 2 | PERF_HAVE_DWARF_REGS := 1 |
| 3 | LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o | 3 | LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o |
| 4 | endif | 4 | endif |
| 5 | LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/header.o | ||
diff --git a/tools/perf/arch/s390/util/header.c b/tools/perf/arch/s390/util/header.c new file mode 100644 index 000000000000..9fa6c3e5782c --- /dev/null +++ b/tools/perf/arch/s390/util/header.c | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | /* | ||
| 2 | * Implementation of get_cpuid(). | ||
| 3 | * | ||
| 4 | * Copyright 2014 IBM Corp. | ||
| 5 | * Author(s): Alexander Yarygin <yarygin@linux.vnet.ibm.com> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License (version 2 only) | ||
| 9 | * as published by the Free Software Foundation. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #include <sys/types.h> | ||
| 13 | #include <unistd.h> | ||
| 14 | #include <stdio.h> | ||
| 15 | #include <string.h> | ||
| 16 | |||
| 17 | #include "../../util/header.h" | ||
| 18 | |||
| 19 | int get_cpuid(char *buffer, size_t sz) | ||
| 20 | { | ||
| 21 | const char *cpuid = "IBM/S390"; | ||
| 22 | |||
| 23 | if (strlen(cpuid) + 1 > sz) | ||
| 24 | return -1; | ||
| 25 | |||
| 26 | strcpy(buffer, cpuid); | ||
| 27 | return 0; | ||
| 28 | } | ||
diff --git a/tools/perf/perf-sys.h b/tools/perf/perf-sys.h index 5268a1481d23..937e4324ad94 100644 --- a/tools/perf/perf-sys.h +++ b/tools/perf/perf-sys.h | |||
| @@ -54,6 +54,7 @@ | |||
| 54 | #define mb() asm volatile("bcr 15,0" ::: "memory") | 54 | #define mb() asm volatile("bcr 15,0" ::: "memory") |
| 55 | #define wmb() asm volatile("bcr 15,0" ::: "memory") | 55 | #define wmb() asm volatile("bcr 15,0" ::: "memory") |
| 56 | #define rmb() asm volatile("bcr 15,0" ::: "memory") | 56 | #define rmb() asm volatile("bcr 15,0" ::: "memory") |
| 57 | #define CPUINFO_PROC "vendor_id" | ||
| 57 | #endif | 58 | #endif |
| 58 | 59 | ||
| 59 | #ifdef __sh__ | 60 | #ifdef __sh__ |
