[4/4] panfrost: Add T860 counters

Submitted by Boris Brezillon on April 4, 2019, 3:37 p.m.

Details

Message ID 20190404153741.18750-5-boris.brezillon@collabora.com
State New
Headers show
Series "panfrost: Expose HW counters through the pipe_query iface" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Boris Brezillon April 4, 2019, 3:37 p.m.
Define the T860 counters table.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 src/gallium/drivers/panfrost/pan_perfcnt.c | 199 ++++++++++++++++++++-
 1 file changed, 198 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/panfrost/pan_perfcnt.c b/src/gallium/drivers/panfrost/pan_perfcnt.c
index 3bac92ad359d..9ae4a2818907 100644
--- a/src/gallium/drivers/panfrost/pan_perfcnt.c
+++ b/src/gallium/drivers/panfrost/pan_perfcnt.c
@@ -52,7 +52,204 @@  struct panfrost_gpu_counters {
 	const struct panfrost_counters *counters;
 };
 
-static const struct panfrost_gpu_counters gpus[0];
+static const struct panfrost_counters t86x_counters = {
+	PANFROST_BLK_COUNTERS(JM,
+			      PANFROST_COUNTER(4, "MESSAGES_SENT"),
+			      PANFROST_COUNTER(5, "MESSAGES_RECEIVED"),
+			      PANFROST_COUNTER(6, "GPU_ACTIVE"),
+			      PANFROST_COUNTER(7, "IRQ_ACTIVE"),
+			      PANFROST_COUNTER(8, "JS0_JOBS"),
+			      PANFROST_COUNTER(9, "JS0_TASKS"),
+			      PANFROST_COUNTER(10, "JS0_ACTIVE"),
+			      PANFROST_COUNTER(12, "JS0_WAIT_READ"),
+			      PANFROST_COUNTER(13, "JS0_WAIT_ISSUE"),
+			      PANFROST_COUNTER(14, "JS0_WAIT_DEPEND"),
+			      PANFROST_COUNTER(15, "JS0_WAIT_FINISH"),
+			      PANFROST_COUNTER(16, "JS1_JOBS"),
+			      PANFROST_COUNTER(17, "JS1_TASKS"),
+			      PANFROST_COUNTER(18, "JS1_ACTIVE"),
+			      PANFROST_COUNTER(20, "JS1_WAIT_READ"),
+			      PANFROST_COUNTER(21, "JS1_WAIT_ISSUE"),
+			      PANFROST_COUNTER(22, "JS1_WAIT_DEPEND"),
+			      PANFROST_COUNTER(23, "JS1_WAIT_FINISH"),
+			      PANFROST_COUNTER(24, "JS2_JOBS"),
+			      PANFROST_COUNTER(25, "JS2_TASKS"),
+			      PANFROST_COUNTER(26, "JS2_ACTIVE"),
+			      PANFROST_COUNTER(28, "JS2_WAIT_READ"),
+			      PANFROST_COUNTER(29, "JS2_WAIT_ISSUE"),
+			      PANFROST_COUNTER(30, "JS2_WAIT_DEPEND"),
+			      PANFROST_COUNTER(31, "JS2_WAIT_FINISH")),
+	PANFROST_BLK_COUNTERS(TILER,
+			      PANFROST_COUNTER(3, "TI_JOBS_PROCESSED"),
+			      PANFROST_COUNTER(4, "TI_TRIANGLES"),
+			      PANFROST_COUNTER(5, "TI_QUADS"),
+			      PANFROST_COUNTER(6, "TI_POLYGONS"),
+			      PANFROST_COUNTER(7, "TI_POINTS"),
+			      PANFROST_COUNTER(8, "TI_LINES"),
+			      PANFROST_COUNTER(9, "TI_VCACHE_HIT"),
+			      PANFROST_COUNTER(10, "TI_VCACHE_MISS"),
+			      PANFROST_COUNTER(11, "TI_FRONT_FACING"),
+			      PANFROST_COUNTER(12, "TI_BACK_FACING"),
+			      PANFROST_COUNTER(13, "TI_PRIM_VISIBLE"),
+			      PANFROST_COUNTER(14, "TI_PRIM_CULLED"),
+			      PANFROST_COUNTER(15, "TI_PRIM_CLIPPED"),
+			      PANFROST_COUNTER(16, "TI_LEVEL0"),
+			      PANFROST_COUNTER(17, "TI_LEVEL1"),
+			      PANFROST_COUNTER(18, "TI_LEVEL2"),
+			      PANFROST_COUNTER(19, "TI_LEVEL3"),
+			      PANFROST_COUNTER(20, "TI_LEVEL4"),
+			      PANFROST_COUNTER(21, "TI_LEVEL5"),
+			      PANFROST_COUNTER(22, "TI_LEVEL6"),
+			      PANFROST_COUNTER(23, "TI_LEVEL7"),
+			      PANFROST_COUNTER(24, "TI_COMMAND_1"),
+			      PANFROST_COUNTER(25, "TI_COMMAND_2"),
+			      PANFROST_COUNTER(26, "TI_COMMAND_3"),
+			      PANFROST_COUNTER(27, "TI_COMMAND_4"),
+			      PANFROST_COUNTER(28, "TI_COMMAND_5_7"),
+			      PANFROST_COUNTER(29, "TI_COMMAND_8_15"),
+			      PANFROST_COUNTER(30, "TI_COMMAND_16_63"),
+			      PANFROST_COUNTER(31, "TI_COMMAND_64"),
+			      PANFROST_COUNTER(32, "TI_COMPRESS_IN"),
+			      PANFROST_COUNTER(33, "TI_COMPRESS_OUT"),
+			      PANFROST_COUNTER(34, "TI_COMPRESS_FLUSH"),
+			      PANFROST_COUNTER(35, "TI_TIMESTAMPS"),
+			      PANFROST_COUNTER(36, "TI_PCACHE_HIT"),
+			      PANFROST_COUNTER(37, "TI_PCACHE_MISS"),
+			      PANFROST_COUNTER(38, "TI_PCACHE_LINE"),
+			      PANFROST_COUNTER(39, "TI_PCACHE_STALL"),
+			      PANFROST_COUNTER(40, "TI_WRBUF_HIT"),
+			      PANFROST_COUNTER(41, "TI_WRBUF_MISS"),
+			      PANFROST_COUNTER(42, "TI_WRBUF_LINE"),
+			      PANFROST_COUNTER(43, "TI_WRBUF_PARTIAL"),
+			      PANFROST_COUNTER(44, "TI_WRBUF_STALL"),
+			      PANFROST_COUNTER(45, "TI_ACTIVE"),
+			      PANFROST_COUNTER(46, "TI_LOADING_DESC"),
+			      PANFROST_COUNTER(47, "TI_INDEX_WAIT"),
+			      PANFROST_COUNTER(48, "TI_INDEX_RANGE_WAIT"),
+			      PANFROST_COUNTER(49, "TI_VERTEX_WAIT"),
+			      PANFROST_COUNTER(50, "TI_PCACHE_WAIT"),
+			      PANFROST_COUNTER(51, "TI_WRBUF_WAIT"),
+			      PANFROST_COUNTER(52, "TI_BUS_READ"),
+			      PANFROST_COUNTER(53, "TI_BUS_WRITE"),
+			      PANFROST_COUNTER(59, "TI_UTLB_HIT"),
+			      PANFROST_COUNTER(60, "TI_UTLB_NEW_MISS"),
+			      PANFROST_COUNTER(61, "TI_UTLB_REPLAY_FULL"),
+			      PANFROST_COUNTER(62, "TI_UTLB_REPLAY_MISS"),
+			      PANFROST_COUNTER(63, "TI_UTLB_STALL")),
+	PANFROST_BLK_COUNTERS(SHADER,
+			      PANFROST_COUNTER(4, "FRAG_ACTIVE"),
+			      PANFROST_COUNTER(5, "FRAG_PRIMITIVES"),
+			      PANFROST_COUNTER(6, "FRAG_PRIMITIVES_DROPPED"),
+			      PANFROST_COUNTER(7, "FRAG_CYCLES_DESC"),
+			      PANFROST_COUNTER(8, "FRAG_CYCLES_FPKQ_ACTIVE"),
+			      PANFROST_COUNTER(9, "FRAG_CYCLES_VERT"),
+			      PANFROST_COUNTER(10, "FRAG_CYCLES_TRISETUP"),
+			      PANFROST_COUNTER(11, "FRAG_CYCLES_EZS_ACTIVE"),
+			      PANFROST_COUNTER(12, "FRAG_THREADS"),
+			      PANFROST_COUNTER(13, "FRAG_DUMMY_THREADS"),
+			      PANFROST_COUNTER(14, "FRAG_QUADS_RAST"),
+			      PANFROST_COUNTER(15, "FRAG_QUADS_EZS_TEST"),
+			      PANFROST_COUNTER(16, "FRAG_QUADS_EZS_KILLED"),
+			      PANFROST_COUNTER(17, "FRAG_THREADS_LZS_TEST"),
+			      PANFROST_COUNTER(18, "FRAG_THREADS_LZS_KILLED"),
+			      PANFROST_COUNTER(19, "FRAG_CYCLES_NO_TILE"),
+			      PANFROST_COUNTER(20, "FRAG_NUM_TILES"),
+			      PANFROST_COUNTER(21, "FRAG_TRANS_ELIM"),
+			      PANFROST_COUNTER(22, "COMPUTE_ACTIVE"),
+			      PANFROST_COUNTER(23, "COMPUTE_TASKS"),
+			      PANFROST_COUNTER(24, "COMPUTE_THREADS"),
+			      PANFROST_COUNTER(25, "COMPUTE_CYCLES_DESC"),
+			      PANFROST_COUNTER(26, "TRIPIPE_ACTIVE"),
+			      PANFROST_COUNTER(27, "ARITH_WORDS"),
+			      PANFROST_COUNTER(28, "ARITH_CYCLES_REG"),
+			      PANFROST_COUNTER(29, "ARITH_CYCLES_L0"),
+			      PANFROST_COUNTER(30, "ARITH_FRAG_DEPEND"),
+			      PANFROST_COUNTER(31, "LS_WORDS"),
+			      PANFROST_COUNTER(32, "LS_ISSUES"),
+			      PANFROST_COUNTER(33, "LS_REISSUE_ATTR"),
+			      PANFROST_COUNTER(34, "LS_REISSUES_VARY"),
+			      PANFROST_COUNTER(35, "LS_VARY_RV_MISS"),
+			      PANFROST_COUNTER(36, "LS_VARY_RV_HIT"),
+			      PANFROST_COUNTER(37, "LS_NO_UNPARK"),
+			      PANFROST_COUNTER(38, "TEX_WORDS"),
+			      PANFROST_COUNTER(39, "TEX_BUBBLES"),
+			      PANFROST_COUNTER(40, "TEX_WORDS_L0"),
+			      PANFROST_COUNTER(41, "TEX_WORDS_DESC"),
+			      PANFROST_COUNTER(42, "TEX_ISSUES"),
+			      PANFROST_COUNTER(43, "TEX_RECIRC_FMISS"),
+			      PANFROST_COUNTER(44, "TEX_RECIRC_DESC"),
+			      PANFROST_COUNTER(45, "TEX_RECIRC_MULTI"),
+			      PANFROST_COUNTER(46, "TEX_RECIRC_PMISS"),
+			      PANFROST_COUNTER(47, "TEX_RECIRC_CONF"),
+			      PANFROST_COUNTER(48, "LSC_READ_HITS"),
+			      PANFROST_COUNTER(49, "LSC_READ_OP"),
+			      PANFROST_COUNTER(50, "LSC_WRITE_HITS"),
+			      PANFROST_COUNTER(51, "LSC_WRITE_OP"),
+			      PANFROST_COUNTER(52, "LSC_ATOMIC_HITS"),
+			      PANFROST_COUNTER(53, "LSC_ATOMIC_OP"),
+			      PANFROST_COUNTER(54, "LSC_LINE_FETCHES"),
+			      PANFROST_COUNTER(55, "LSC_DIRTY_LINE"),
+			      PANFROST_COUNTER(56, "LSC_SNOOPS"),
+			      PANFROST_COUNTER(57, "AXI_TLB_STALL"),
+			      PANFROST_COUNTER(58, "AXI_TLB_MISS"),
+			      PANFROST_COUNTER(59, "AXI_TLB_TRANSACTION"),
+			      PANFROST_COUNTER(60, "LS_TLB_MISS"),
+			      PANFROST_COUNTER(61, "LS_TLB_HIT"),
+			      PANFROST_COUNTER(62, "AXI_BEATS_READ"),
+			      PANFROST_COUNTER(63, "AXI_BEATS_WRITTEN")),
+	PANFROST_BLK_COUNTERS(MMU_L2,
+			      PANFROST_COUNTER(4, "MMU_HIT"),
+			      PANFROST_COUNTER(5, "MMU_NEW_MISS"),
+			      PANFROST_COUNTER(6, "MMU_REPLAY_FULL"),
+			      PANFROST_COUNTER(7, "MMU_REPLAY_MISS"),
+			      PANFROST_COUNTER(8, "MMU_TABLE_WALK"),
+			      PANFROST_COUNTER(9, "MMU_REQUESTS"),
+			      PANFROST_COUNTER(12, "UTLB_HIT"),
+			      PANFROST_COUNTER(13, "UTLB_NEW_MISS"),
+			      PANFROST_COUNTER(14, "UTLB_REPLAY_FULL"),
+			      PANFROST_COUNTER(15, "UTLB_REPLAY_MISS"),
+			      PANFROST_COUNTER(16, "UTLB_STALL"),
+			      PANFROST_COUNTER(30, "L2_EXT_WRITE_BEATS"),
+			      PANFROST_COUNTER(31, "L2_EXT_READ_BEATS"),
+			      PANFROST_COUNTER(32, "L2_ANY_LOOKUP"),
+			      PANFROST_COUNTER(33, "L2_READ_LOOKUP"),
+			      PANFROST_COUNTER(34, "L2_SREAD_LOOKUP"),
+			      PANFROST_COUNTER(35, "L2_READ_REPLAY"),
+			      PANFROST_COUNTER(36, "L2_READ_SNOOP"),
+			      PANFROST_COUNTER(37, "L2_READ_HIT"),
+			      PANFROST_COUNTER(38, "L2_CLEAN_MISS"),
+			      PANFROST_COUNTER(39, "L2_WRITE_LOOKUP"),
+			      PANFROST_COUNTER(40, "L2_SWRITE_LOOKUP"),
+			      PANFROST_COUNTER(41, "L2_WRITE_REPLAY"),
+			      PANFROST_COUNTER(42, "L2_WRITE_SNOOP"),
+			      PANFROST_COUNTER(43, "L2_WRITE_HIT"),
+			      PANFROST_COUNTER(44, "L2_EXT_READ_FULL"),
+			      PANFROST_COUNTER(46, "L2_EXT_WRITE_FULL"),
+			      PANFROST_COUNTER(47, "L2_EXT_R_W_HAZARD"),
+			      PANFROST_COUNTER(48, "L2_EXT_READ"),
+			      PANFROST_COUNTER(49, "L2_EXT_READ_LINE"),
+			      PANFROST_COUNTER(50, "L2_EXT_WRITE"),
+			      PANFROST_COUNTER(51, "L2_EXT_WRITE_LINE"),
+			      PANFROST_COUNTER(52, "L2_EXT_WRITE_SMALL"),
+			      PANFROST_COUNTER(53, "L2_EXT_BARRIER"),
+			      PANFROST_COUNTER(54, "L2_EXT_AR_STALL"),
+			      PANFROST_COUNTER(55, "L2_EXT_R_BUF_FULL"),
+			      PANFROST_COUNTER(56, "L2_EXT_RD_BUF_FULL"),
+			      PANFROST_COUNTER(57, "L2_EXT_R_RAW"),
+			      PANFROST_COUNTER(58, "L2_EXT_W_STALL"),
+			      PANFROST_COUNTER(59, "L2_EXT_W_BUF_FULL"),
+			      PANFROST_COUNTER(60, "L2_EXT_R_BUF_FULL"),
+			      PANFROST_COUNTER(61, "L2_TAG_HAZARD"),
+			      PANFROST_COUNTER(62, "L2_SNOOP_FULL"),
+			      PANFROST_COUNTER(63, "L2_REPLAY_FULL")),
+};
+
+static const struct panfrost_gpu_counters gpus[] = {
+	{
+		.gpu_id = 0x860,
+		.counters = &t86x_counters,
+	},
+};
 
 static const char *block_names[] = {
 	[PANFROST_SHADER_BLOCK] = "SHADER",

Comments

I sure hope you have a way of automatically generating these ^_^ 

One fleeting thought is that some of the counters have "scales"
attached, where the logical value we need to report back is some
specified integer multiple of what the hardware actually writes. I don't
know if we want to account for this, but it's in the XML
files in gator.

Also, in case it's not already in that header, this needs to be
Copyright (C) Arm Limited as well, see the file you got the definitions
from for the years.

It's probably best to isolate the counter definitions into their own
file, since there will be a -lot- of them and you don't want to clutter
up the general performance counter headers.

Aside from these thoughts, R-B :)
On Thu, 4 Apr 2019 08:55:24 -0700
Alyssa Rosenzweig <alyssa@rosenzweig.io> wrote:

> I sure hope you have a way of automatically generating these ^_^ 

Definitely. Didn't focus on that so far, but defining them in an XML
(or whatever) and generating .c/.h files out of it should be doable.

> 
> One fleeting thought is that some of the counters have "scales"
> attached, where the logical value we need to report back is some
> specified integer multiple of what the hardware actually writes. I don't
> know if we want to account for this, but it's in the XML
> files in gator.

Good question. I'd be in favor of keeping the driver as dump as
possible and letting counter users get something useful out of the
value, but it's not like applying a scale is super complicated. I'll
have a look at the XML files, thanks for the pointer.

> 
> Also, in case it's not already in that header, this needs to be
> Copyright (C) Arm Limited as well, see the file you got the definitions
> from for the years.

Will add ARM's copyright.

> 
> It's probably best to isolate the counter definitions into their own
> file, since there will be a -lot- of them and you don't want to clutter
> up the general performance counter headers.

I agree.

> 
> Aside from these thoughts, R-B :)