Merge tag 'mailbox-v4.21' of git://git.linaro.org/landing-teams/working/fujitsu/integ...
[linux-2.6-microblaze.git] / tools / perf / arch / common.c
index 82657c0..f3824ca 100644 (file)
@@ -5,6 +5,13 @@
 #include "../util/util.h"
 #include "../util/debug.h"
 
+const char *const arc_triplets[] = {
+       "arc-linux-",
+       "arc-snps-linux-uclibc-",
+       "arc-snps-linux-gnu-",
+       NULL
+};
+
 const char *const arm_triplets[] = {
        "arm-eabi-",
        "arm-linux-androideabi-",
@@ -147,7 +154,9 @@ static int perf_env__lookup_binutils_path(struct perf_env *env,
                zfree(&buf);
        }
 
-       if (!strcmp(arch, "arm"))
+       if (!strcmp(arch, "arc"))
+               path_list = arc_triplets;
+       else if (!strcmp(arch, "arm"))
                path_list = arm_triplets;
        else if (!strcmp(arch, "arm64"))
                path_list = arm64_triplets;
@@ -200,3 +209,13 @@ int perf_env__lookup_objdump(struct perf_env *env, const char **path)
 
        return perf_env__lookup_binutils_path(env, "objdump", path);
 }
+
+/*
+ * Some architectures have a single address space for kernel and user addresses,
+ * which makes it possible to determine if an address is in kernel space or user
+ * space.
+ */
+bool perf_env__single_address_space(struct perf_env *env)
+{
+       return strcmp(perf_env__arch(env), "sparc");
+}