]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sonoma: perf: add support for sonoma (s7) into perf
authorDave Aldridge <david.j.aldridge@oracle.com>
Wed, 14 Sep 2016 13:20:54 +0000 (06:20 -0700)
committerAllen Pais <allen.pais@oracle.com>
Sun, 22 Jan 2017 15:38:26 +0000 (21:08 +0530)
This commit ensures that perf will now recognise that
it is running on a sonoma device and will initialise
correctly.

Orabug: 24931042

Signed-off-by: Dave Aldridge <david.j.aldridge@oracle.com>
(cherry picked from commit f39f00c4536c8c6ca0585a200a56894c2c158743)
Signed-off-by: Allen Pais <allen.pais@oracle.com>
arch/sparc/kernel/pcr.c
arch/sparc/kernel/perf_event.c

index eb978c77c76a78d401e5dce22b4f5bafa8ef948d..1f69e8322fe6f4a8ac7d7312324dac1845376dfb 100644 (file)
@@ -274,6 +274,7 @@ static int __init register_perf_hsvc(void)
                        break;
 
                case SUN4V_CHIP_SPARC_M7:
+               case SUN4V_CHIP_SPARC_S7:
                        perf_hsvc_group = HV_GRP_M7_PERF;
                        break;
 
@@ -323,6 +324,7 @@ static int __init setup_sun4v_pcr_ops(void)
                break;
 
        case SUN4V_CHIP_SPARC_M7:
+       case SUN4V_CHIP_SPARC_S7:
                pcr_ops = &m7_pcr_ops;
                break;
 
index b5cdc95084bd480bbf648c9b666c20edec0fc439..f6ab01588d2efe3d9e9a7d448ed78b68c66fc7d3 100644 (file)
@@ -1189,7 +1189,8 @@ static bool is_stop_counting_cycles_requested(u64 val)
         */
        if (!strcmp(sparc_pmu_type, "niagara4") ||
            !strcmp(sparc_pmu_type, "niagara5") ||
-           !strcmp(sparc_pmu_type, "sparc-m7")) {
+           !strcmp(sparc_pmu_type, "sparc-m7") ||
+           !strcmp(sparc_pmu_type, "sparc-s7")) {
                if ((val & PCR_N4_SL) == PCR_N4_CYCLES_SELECTED)
                        ret = true;
        }
@@ -1203,7 +1204,8 @@ static void wait_for_counter_overflow(int pcr_index)
 
        if (!strcmp(sparc_pmu_type, "niagara4") ||
            !strcmp(sparc_pmu_type, "niagara5") ||
-           !strcmp(sparc_pmu_type, "sparc-m7")) {
+           !strcmp(sparc_pmu_type, "sparc-m7") ||
+           !strcmp(sparc_pmu_type, "sparc-s7")) {
                pcr = pcr_ops->read_pcr(pcr_index);
                if (((pcr & PCR_N4_SL) == PCR_N4_CYCLES_SELECTED) &&
                    ((pcr & PCR_N4_UTRACE) || (pcr & PCR_N4_STRACE))) {
@@ -1882,7 +1884,8 @@ static bool __init supported_pmu(void)
                sparc_pmu = &niagara4_pmu;
                return true;
        }
-       if (!strcmp(sparc_pmu_type, "sparc-m7")) {
+       if (!strcmp(sparc_pmu_type, "sparc-m7") ||
+           !strcmp(sparc_pmu_type, "sparc-s7")) {
                sparc_pmu = &sparc_m7_pmu;
                return true;
        }