intel/perf: support new operators for upcoming metrics
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 31 Aug 2021 08:55:25 +0000 (11:55 +0300)
committerMarge Bot <emma+marge@anholt.net>
Thu, 17 Nov 2022 12:57:06 +0000 (12:57 +0000)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18893>

src/intel/perf/gen_perf.py
src/intel/perf/intel_perf.h

index 8ec3123..5fc5c0e 100644 (file)
@@ -186,9 +186,15 @@ def brkt(subexp):
 def splice_bitwise_and(args):
     return brkt(args[1]) + " & " + brkt(args[0])
 
+def splice_bitwise_or(args):
+    return brkt(args[1]) + " | " + brkt(args[0])
+
 def splice_logical_and(args):
     return brkt(args[1]) + " && " + brkt(args[0])
 
+def splice_umul(args):
+    return brkt(args[1]) + " * " + brkt(args[0])
+
 def splice_ult(args):
     return brkt(args[1]) + " < " + brkt(args[0])
 
@@ -201,12 +207,22 @@ def splice_ulte(args):
 def splice_ugt(args):
     return brkt(args[1]) + " > " + brkt(args[0])
 
+def splice_lshft(args):
+    return brkt(args[1]) + " << " + brkt(args[0])
+
+def splice_equal(args):
+    return brkt(args[1]) + " == " + brkt(args[0])
+
 exp_ops = {}
 #                 (n operands, splicer)
 exp_ops["AND"]  = (2, splice_bitwise_and)
+exp_ops["OR"]   = (2, splice_bitwise_or)
 exp_ops["UGTE"] = (2, splice_ugte)
 exp_ops["ULT"]  = (2, splice_ult)
 exp_ops["&&"]   = (2, splice_logical_and)
+exp_ops["UMUL"] = (2, splice_umul)
+exp_ops["<<"]   = (2, splice_lshft)
+exp_ops["=="]   = (2, splice_equal)
 
 
 hw_vars = {}
@@ -436,6 +452,7 @@ units_map = {
     "threads" : True,
     "us" : True,
     "utilization" : False,
+    "gbps" : True,
     }
 
 
index 4855344..207c237 100644 (file)
@@ -75,6 +75,7 @@ enum PACKED intel_perf_counter_data_type {
 enum PACKED intel_perf_counter_units {
    /* size */
    INTEL_PERF_COUNTER_UNITS_BYTES,
+   INTEL_PERF_COUNTER_UNITS_GBPS,
 
    /* frequency */
    INTEL_PERF_COUNTER_UNITS_HZ,