poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] pickles: Update btf.pk


From: David Faust
Subject: [PATCH] pickles: Update btf.pk
Date: Wed, 15 Dec 2021 12:36:49 -0800

Update BTF pickle with recent additions/changes to the format:
- BTF_KIND_DATASEC uses 'size' not 'type'
- Add BTF_KIND_FLOAT
- Add BTF_KIND_DECL_TAG and BTF_KIND_TYPE_TAG

2021-12-15  David Faust  <david.faust@oracle.com>

        * pickles/btf.pk (BTF_KIND_FLOAT): New kind.
        (BTF_KIND_DECL_TAG): Likewise.
        (BTF_KIND_TYPE_TAG): Likewise.
        (BTF_Decl_Tag): New type.
        (BTF_Type): Update `info` bits usage to accomodate new type kinds.
        BTF_KIND_DATASEC uses `size` variant of `attrs`.
        Add `decl_tag` variant to `data`.
---
 ChangeLog      | 10 ++++++++++
 pickles/btf.pk | 24 +++++++++++++++++++-----
 2 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/pickles/btf.pk b/pickles/btf.pk
index 4832ada6..a23944db 100644
--- a/pickles/btf.pk
+++ b/pickles/btf.pk
@@ -35,12 +35,15 @@ var BTF_KIND_UNKNOWN = 0,
     BTF_KIND_FUNC = 12,
     BTF_KIND_FUNC_PROTO = 13,
     BTF_KIND_VAR = 14,
-    BTF_KIND_DATASEC = 15;
+    BTF_KIND_DATASEC = 15,
+    BTF_KIND_FLOAT = 16,
+    BTF_KIND_DECL_TAG = 17,
+    BTF_KIND_TYPE_TAG = 18;
 
 var btf_kind_names =
   ["unkn", "int", "ptr", "array", "struct", "union", "enum",
    "fwd", "typedef", "volatile", "const", "restrict", "func",
-   "func_proto", "var", "datasec"];
+   "func_proto", "var", "datasec", "float", "decl_tag", "type_tag"];
 
 type BTF_Type_Id = uint<32>;
 
@@ -100,6 +103,14 @@ type BTF_Var_SecInfo =
     offset<uint<32>,B> size;
   };
 
+type BTF_Decl_Tag =
+  struct
+  {
+    /* -1 if the tag is applied to the type itself,
+       else the index of the tagged field/parameter/etc.  */
+    uint<32> component_idx;
+  };
+
 type BTF_Type =
   struct
   {
@@ -108,8 +119,8 @@ type BTF_Type =
     struct uint<32>
     {
       uint<1> kind_flag;
-      uint<3>;
-      uint<4> kind;
+      uint<2>;
+      uint<5> kind;
       uint<8>;
       uint<16> vlen;
 
@@ -123,9 +134,11 @@ type BTF_Type =
     union
     {
       offset<uint<32>,B> size : (info.kind in [BTF_KIND_INT,
+                                               BTF_KIND_FLOAT,
                                                BTF_KIND_ENUM,
                                                BTF_KIND_STRUCT,
-                                               BTF_KIND_UNION]);
+                                               BTF_KIND_UNION,
+                                               BTF_KIND_DATASEC]);
       BTF_Type_Id type_id;
     } attrs;
 
@@ -164,6 +177,7 @@ type BTF_Type =
       BTF_Member[info.vlen] members      : (info.kind == BTF_KIND_UNION
                                             || info.kind == BTF_KIND_STRUCT);
       BTF_Var_SecInfo[info.vlen] datasec : info.kind == BTF_KIND_DATASEC;
+      BTF_Decl_Tag decl_tag              : info.kind == BTF_KIND_DECL_TAG;
 
       struct {} nothing;
     } data;
-- 
2.33.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]