• Yonghong Song's avatar
    bpf: log struct/union attribute for forward type · 76c43ae8
    Yonghong Song authored
    Current btf internal verbose logger logs fwd type as
      [2] FWD A type_id=0
    where A is the type name.
    
    Commit 9d5f9f70 ("bpf: btf: fix struct/union/fwd types
    with kind_flag") introduced kind_flag which can be used
    to distinguish whether a forward type is a struct or
    union.
    
    Also, "type_id=0" does not carry any meaningful
    information for fwd type as btf_type.type = 0 is simply
    enforced during btf verification and is not used
    anywhere else.
    
    This commit changed the log to
      [2] FWD A struct
    if kind_flag = 0, or
      [2] FWD A union
    if kind_flag = 1.
    Acked-by: default avatarMartin KaFai Lau <kafai@fb.com>
    Signed-off-by: default avatarYonghong Song <yhs@fb.com>
    Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    76c43ae8
btf.c 74.8 KB