freedreno/perfcntrs: add a2xx MH counters
authorJonathan Marek <jonathan@marek.ca>
Wed, 27 Nov 2019 15:40:59 +0000 (10:40 -0500)
committerJonathan Marek <jonathan@marek.ca>
Wed, 27 Nov 2019 17:11:57 +0000 (12:11 -0500)
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Rob Clark <robdclark@chromium.org>
src/freedreno/perfcntrs/fd2_perfcntr.c

index 17ffb5e2c85078be1059affdd92c7b58405d507e..eac2de0214bb036b24831289396fd52893a47942 100644 (file)
@@ -578,6 +578,191 @@ static const struct fd_perfcntr_countable sx_countables[] = {
        COUNTABLE(SX_RB_COLOR_STALL, UINT64, AVERAGE),
 };
 
+static const struct fd_perfcntr_countable mh_countables[] = {
+       COUNTABLE(CP_R0_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(CP_R1_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(CP_R2_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(CP_R3_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(CP_R4_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(CP_TOTAL_READ_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(CP_TOTAL_WRITE_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(CP_TOTAL_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(CP_DATA_BYTES_WRITTEN, UINT64, AVERAGE),
+       COUNTABLE(CP_WRITE_CLEAN_RESPONSES, UINT64, AVERAGE),
+       COUNTABLE(CP_R0_READ_BURSTS_RECEIVED, UINT64, AVERAGE),
+       COUNTABLE(CP_R1_READ_BURSTS_RECEIVED, UINT64, AVERAGE),
+       COUNTABLE(CP_R2_READ_BURSTS_RECEIVED, UINT64, AVERAGE),
+       COUNTABLE(CP_R3_READ_BURSTS_RECEIVED, UINT64, AVERAGE),
+       COUNTABLE(CP_R4_READ_BURSTS_RECEIVED, UINT64, AVERAGE),
+       COUNTABLE(CP_TOTAL_READ_BURSTS_RECEIVED, UINT64, AVERAGE),
+       COUNTABLE(CP_R0_DATA_BEATS_READ, UINT64, AVERAGE),
+       COUNTABLE(CP_R1_DATA_BEATS_READ, UINT64, AVERAGE),
+       COUNTABLE(CP_R2_DATA_BEATS_READ, UINT64, AVERAGE),
+       COUNTABLE(CP_R3_DATA_BEATS_READ, UINT64, AVERAGE),
+       COUNTABLE(CP_R4_DATA_BEATS_READ, UINT64, AVERAGE),
+       COUNTABLE(CP_TOTAL_DATA_BEATS_READ, UINT64, AVERAGE),
+       COUNTABLE(VGT_R0_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(VGT_R1_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(VGT_TOTAL_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(VGT_R0_READ_BURSTS_RECEIVED, UINT64, AVERAGE),
+       COUNTABLE(VGT_R1_READ_BURSTS_RECEIVED, UINT64, AVERAGE),
+       COUNTABLE(VGT_TOTAL_READ_BURSTS_RECEIVED, UINT64, AVERAGE),
+       COUNTABLE(VGT_R0_DATA_BEATS_READ, UINT64, AVERAGE),
+       COUNTABLE(VGT_R1_DATA_BEATS_READ, UINT64, AVERAGE),
+       COUNTABLE(VGT_TOTAL_DATA_BEATS_READ, UINT64, AVERAGE),
+       COUNTABLE(TC_TOTAL_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(TC_ROQ_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(TC_INFO_SENT, UINT64, AVERAGE),
+       COUNTABLE(TC_READ_BURSTS_RECEIVED, UINT64, AVERAGE),
+       COUNTABLE(TC_DATA_BEATS_READ, UINT64, AVERAGE),
+       COUNTABLE(TCD_BURSTS_READ, UINT64, AVERAGE),
+       COUNTABLE(RB_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(RB_DATA_BYTES_WRITTEN, UINT64, AVERAGE),
+       COUNTABLE(RB_WRITE_CLEAN_RESPONSES, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_REQUESTS_ID_0, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_REQUESTS_ID_1, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_REQUESTS_ID_2, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_REQUESTS_ID_3, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_REQUESTS_ID_4, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_REQUESTS_ID_5, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_REQUESTS_ID_6, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_REQUESTS_ID_7, UINT64, AVERAGE),
+       COUNTABLE(AXI_TOTAL_READ_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_REQUESTS_ID_0, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_REQUESTS_ID_1, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_REQUESTS_ID_2, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_REQUESTS_ID_3, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_REQUESTS_ID_4, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_REQUESTS_ID_5, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_REQUESTS_ID_6, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_REQUESTS_ID_7, UINT64, AVERAGE),
+       COUNTABLE(AXI_TOTAL_WRITE_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(AXI_TOTAL_REQUESTS_ID_0, UINT64, AVERAGE),
+       COUNTABLE(AXI_TOTAL_REQUESTS_ID_1, UINT64, AVERAGE),
+       COUNTABLE(AXI_TOTAL_REQUESTS_ID_2, UINT64, AVERAGE),
+       COUNTABLE(AXI_TOTAL_REQUESTS_ID_3, UINT64, AVERAGE),
+       COUNTABLE(AXI_TOTAL_REQUESTS_ID_4, UINT64, AVERAGE),
+       COUNTABLE(AXI_TOTAL_REQUESTS_ID_5, UINT64, AVERAGE),
+       COUNTABLE(AXI_TOTAL_REQUESTS_ID_6, UINT64, AVERAGE),
+       COUNTABLE(AXI_TOTAL_REQUESTS_ID_7, UINT64, AVERAGE),
+       COUNTABLE(AXI_TOTAL_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_CHANNEL_BURSTS_ID_0, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_CHANNEL_BURSTS_ID_1, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_CHANNEL_BURSTS_ID_2, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_CHANNEL_BURSTS_ID_3, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_CHANNEL_BURSTS_ID_4, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_CHANNEL_BURSTS_ID_5, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_CHANNEL_BURSTS_ID_6, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_CHANNEL_BURSTS_ID_7, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_CHANNEL_TOTAL_BURSTS, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_CHANNEL_DATA_BEATS_READ_ID_0, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_CHANNEL_DATA_BEATS_READ_ID_1, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_CHANNEL_DATA_BEATS_READ_ID_2, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_CHANNEL_DATA_BEATS_READ_ID_3, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_CHANNEL_DATA_BEATS_READ_ID_4, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_CHANNEL_DATA_BEATS_READ_ID_5, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_CHANNEL_DATA_BEATS_READ_ID_6, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_CHANNEL_DATA_BEATS_READ_ID_7, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_CHANNEL_TOTAL_DATA_BEATS_READ, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_CHANNEL_BURSTS_ID_0, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_CHANNEL_BURSTS_ID_1, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_CHANNEL_BURSTS_ID_2, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_CHANNEL_BURSTS_ID_3, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_CHANNEL_BURSTS_ID_4, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_CHANNEL_BURSTS_ID_5, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_CHANNEL_BURSTS_ID_6, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_CHANNEL_BURSTS_ID_7, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_CHANNEL_TOTAL_BURSTS, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_CHANNEL_DATA_BYTES_WRITTEN_ID_0, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_CHANNEL_DATA_BYTES_WRITTEN_ID_1, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_CHANNEL_DATA_BYTES_WRITTEN_ID_2, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_CHANNEL_DATA_BYTES_WRITTEN_ID_3, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_CHANNEL_DATA_BYTES_WRITTEN_ID_4, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_CHANNEL_DATA_BYTES_WRITTEN_ID_5, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_CHANNEL_DATA_BYTES_WRITTEN_ID_6, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_CHANNEL_DATA_BYTES_WRITTEN_ID_7, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_CHANNEL_TOTAL_DATA_BYTES_WRITTEN, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_RESPONSE_CHANNEL_RESPONSES_ID_0, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_RESPONSE_CHANNEL_RESPONSES_ID_1, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_RESPONSE_CHANNEL_RESPONSES_ID_2, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_RESPONSE_CHANNEL_RESPONSES_ID_3, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_RESPONSE_CHANNEL_RESPONSES_ID_4, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_RESPONSE_CHANNEL_RESPONSES_ID_5, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_RESPONSE_CHANNEL_RESPONSES_ID_6, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_RESPONSE_CHANNEL_RESPONSES_ID_7, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_RESPONSE_CHANNEL_TOTAL_RESPONSES, UINT64, AVERAGE),
+       COUNTABLE(TOTAL_MMU_MISSES, UINT64, AVERAGE),
+       COUNTABLE(MMU_READ_MISSES, UINT64, AVERAGE),
+       COUNTABLE(MMU_WRITE_MISSES, UINT64, AVERAGE),
+       COUNTABLE(TOTAL_MMU_HITS, UINT64, AVERAGE),
+       COUNTABLE(MMU_READ_HITS, UINT64, AVERAGE),
+       COUNTABLE(MMU_WRITE_HITS, UINT64, AVERAGE),
+       COUNTABLE(SPLIT_MODE_TC_HITS, UINT64, AVERAGE),
+       COUNTABLE(SPLIT_MODE_TC_MISSES, UINT64, AVERAGE),
+       COUNTABLE(SPLIT_MODE_NON_TC_HITS, UINT64, AVERAGE),
+       COUNTABLE(SPLIT_MODE_NON_TC_MISSES, UINT64, AVERAGE),
+       COUNTABLE(STALL_AWAITING_TLB_MISS_FETCH, UINT64, AVERAGE),
+       COUNTABLE(MMU_TLB_MISS_READ_BURSTS_RECEIVED, UINT64, AVERAGE),
+       COUNTABLE(MMU_TLB_MISS_DATA_BEATS_READ, UINT64, AVERAGE),
+       COUNTABLE(CP_CYCLES_HELD_OFF, UINT64, AVERAGE),
+       COUNTABLE(VGT_CYCLES_HELD_OFF, UINT64, AVERAGE),
+       COUNTABLE(TC_CYCLES_HELD_OFF, UINT64, AVERAGE),
+       COUNTABLE(TC_ROQ_CYCLES_HELD_OFF, UINT64, AVERAGE),
+       COUNTABLE(TC_CYCLES_HELD_OFF_TCD_FULL, UINT64, AVERAGE),
+       COUNTABLE(RB_CYCLES_HELD_OFF, UINT64, AVERAGE),
+       COUNTABLE(TOTAL_CYCLES_ANY_CLNT_HELD_OFF, UINT64, AVERAGE),
+       COUNTABLE(TLB_MISS_CYCLES_HELD_OFF, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_REQUEST_HELD_OFF, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_REQUEST_HELD_OFF, UINT64, AVERAGE),
+       COUNTABLE(AXI_REQUEST_HELD_OFF, UINT64, AVERAGE),
+       COUNTABLE(AXI_REQUEST_HELD_OFF_INFLIGHT_LIMIT, UINT64, AVERAGE),
+       COUNTABLE(AXI_WRITE_DATA_HELD_OFF, UINT64, AVERAGE),
+       COUNTABLE(CP_SAME_PAGE_BANK_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(VGT_SAME_PAGE_BANK_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(TC_SAME_PAGE_BANK_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(TC_ARB_HOLD_SAME_PAGE_BANK_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(RB_SAME_PAGE_BANK_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(TOTAL_SAME_PAGE_BANK_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(CP_SAME_PAGE_BANK_REQUESTS_KILLED_FAIRNESS_LIMIT, UINT64, AVERAGE),
+       COUNTABLE(VGT_SAME_PAGE_BANK_REQUESTS_KILLED_FAIRNESS_LIMIT, UINT64, AVERAGE),
+       COUNTABLE(TC_SAME_PAGE_BANK_REQUESTS_KILLED_FAIRNESS_LIMIT, UINT64, AVERAGE),
+       COUNTABLE(RB_SAME_PAGE_BANK_REQUESTS_KILLED_FAIRNESS_LIMIT, UINT64, AVERAGE),
+       COUNTABLE(TOTAL_SAME_PAGE_BANK_KILLED_FAIRNESS_LIMIT, UINT64, AVERAGE),
+       COUNTABLE(TOTAL_MH_READ_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(TOTAL_MH_WRITE_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(TOTAL_MH_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(MH_BUSY, UINT64, AVERAGE),
+       COUNTABLE(CP_NTH_ACCESS_SAME_PAGE_BANK_SEQUENCE, UINT64, AVERAGE),
+       COUNTABLE(VGT_NTH_ACCESS_SAME_PAGE_BANK_SEQUENCE, UINT64, AVERAGE),
+       COUNTABLE(TC_NTH_ACCESS_SAME_PAGE_BANK_SEQUENCE, UINT64, AVERAGE),
+       COUNTABLE(RB_NTH_ACCESS_SAME_PAGE_BANK_SEQUENCE, UINT64, AVERAGE),
+       COUNTABLE(TC_ROQ_N_VALID_ENTRIES, UINT64, AVERAGE),
+       COUNTABLE(ARQ_N_ENTRIES, UINT64, AVERAGE),
+       COUNTABLE(WDB_N_ENTRIES, UINT64, AVERAGE),
+       COUNTABLE(MH_READ_LATENCY_OUTST_REQ_SUM, UINT64, AVERAGE),
+       COUNTABLE(MC_READ_LATENCY_OUTST_REQ_SUM, UINT64, AVERAGE),
+       COUNTABLE(MC_TOTAL_READ_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(ELAPSED_CYCLES_MH_GATED_CLK, UINT64, AVERAGE),
+       COUNTABLE(ELAPSED_CLK_CYCLES, UINT64, AVERAGE),
+       COUNTABLE(CP_W_16B_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(CP_W_32B_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(TC_16B_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(TC_32B_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(PA_REQUESTS, UINT64, AVERAGE),
+       COUNTABLE(PA_DATA_BYTES_WRITTEN, UINT64, AVERAGE),
+       COUNTABLE(PA_WRITE_CLEAN_RESPONSES, UINT64, AVERAGE),
+       COUNTABLE(PA_CYCLES_HELD_OFF, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_REQUEST_DATA_BEATS_ID_0, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_REQUEST_DATA_BEATS_ID_1, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_REQUEST_DATA_BEATS_ID_2, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_REQUEST_DATA_BEATS_ID_3, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_REQUEST_DATA_BEATS_ID_4, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_REQUEST_DATA_BEATS_ID_5, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_REQUEST_DATA_BEATS_ID_6, UINT64, AVERAGE),
+       COUNTABLE(AXI_READ_REQUEST_DATA_BEATS_ID_7, UINT64, AVERAGE),
+       COUNTABLE(AXI_TOTAL_READ_REQUEST_DATA_BEATS, UINT64, AVERAGE),
+};
+
 static const struct fd_perfcntr_countable rb_countables[] = {
        COUNTABLE(RBPERF_CNTX_BUSY, UINT64, AVERAGE),
        COUNTABLE(RBPERF_CNTX_BUSY_MAX, UINT64, AVERAGE),
@@ -755,13 +940,10 @@ static const struct fd_perfcntr_counter sx_counters[] = {
        COUNTER(SX_PERFCOUNTER0_SELECT, SX_PERFCOUNTER0_LOW, SX_PERFCOUNTER0_HI),
 };
 
-// We don't have the enums for MH perfcntrs
-#if 0
 static const struct fd_perfcntr_counter mh_counters[] = {
        COUNTER(MH_PERFCOUNTER0_SELECT, MH_PERFCOUNTER0_LOW, MH_PERFCOUNTER0_HI),
        COUNTER(MH_PERFCOUNTER1_SELECT, MH_PERFCOUNTER1_LOW, MH_PERFCOUNTER1_HI),
 };
-#endif
 
 static const struct fd_perfcntr_counter rbbm_counters[] = {
        COUNTER(RBBM_PERFCOUNTER1_SELECT, RBBM_PERFCOUNTER1_LO, RBBM_PERFCOUNTER1_HI),
@@ -786,7 +968,7 @@ const struct fd_perfcntr_group a2xx_perfcntr_groups[] = {
        GROUP("TCF", tcf_counters, tcf_countables),
        GROUP("SQ", sq_counters, sq_countables),
        GROUP("SX", sx_counters, sx_countables),
-//     GROUP("MH", mh_counters, mh_countables),
+       GROUP("MH", mh_counters, mh_countables),
        GROUP("RBBM", rbbm_counters, rbbm_countables),
        GROUP("RB", rb_counters, rb_countables),
 };