)]}'
{
  "commit": "a834290e454b917fd46bee6a80e31470d4ce1acc",
  "tree": "ec7ee9870c2efb8c8be4c02a9e3ef3b02694bff6",
  "parents": [
    "ec3f944102a7124196d510c2618ea3890064b7c4"
  ],
  "author": {
    "name": "Andrii Nakryiko",
    "email": "andrii@kernel.org",
    "time": "Thu Oct 22 12:51:48 2020 -0700"
  },
  "committer": {
    "name": "Arnaldo Carvalho de Melo",
    "email": "acme@redhat.com",
    "time": "Mon Oct 26 16:50:11 2020 -0300"
  },
  "message": "btf_loader: handle union forward declaration properly\n\nDifferentiate between struct and union forwards in BTF. BTF type\nrepresenting forward declaration (BTF_KIND_FWD) encodes whether the\nforward declaration is for struct or union type by using kflag. So use\nthat kflag to create a proper internal representation of forward\ndeclaration.\n\nTested with btfdiff on vmlinux:\n\n  $ PAHOLE\u003dbuild/pahole ./btfdiff ~/linux-build/default/vmlinux | wc -l\n  0\n  $\n\nAlso tested manually:\n\n  $ cat test.c\n  struct struct_fwd;\n\n  union union_fwd;\n\n  struct s {\n          struct struct_fwd *f1;\n          union union_fwd *f2;\n  };\n\n  int func(struct s *s) {\n          return !!s-\u003ef1 + !!s-\u003ef2;\n  }\n  $ clang -g -target bpf -c test.c -o test.o\n  $ bpftool btf dump file test.o | grep fwd_kind\n  [6] FWD \u0027struct_fwd\u0027 fwd_kind\u003dstruct\n  [8] FWD \u0027union_fwd\u0027 fwd_kind\u003dunion\n  $ build/pahole -F btf test.o\n  struct s {\n          struct struct_fwd *        f1;                   /*     0     8 */\n          union union_fwd *          f2;                   /*     8     8 */\n\n          /* size: 16, cachelines: 1, members: 2 */\n          /* last cacheline: 16 bytes */\n  };\n\nSigned-off-by: Andrii Nakryiko \u003candrii@kernel.org\u003e\nTested-by: Arnaldo Carvalho de Melo \u003cacme@redhat.com\u003e\nCc: bpf@vger.kernel.org\nCc: dwarves@vger.kernel.org\nSigned-off-by: Arnaldo Carvalho de Melo \u003cacme@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "9b5da3a4997aff8e207e46550437ab0e6282a7fa",
      "old_mode": 33188,
      "old_path": "btf_loader.c",
      "new_id": "6ea207ea65b4c892c547b2973b74b0588e73c694",
      "new_mode": 33188,
      "new_path": "btf_loader.c"
    }
  ]
}
