• yonghong-song's avatar
    fix a bug in tracepoint struct rewriter (#1856) · c2e2a26b
    yonghong-song authored
    Fix issue #1853.
    
    Commit 7c489469 ("adjust tracepoint field type
    based on size") tried to fix the tracepoint format
    descrepancy between declared type and actual size is 8.
    The type has to be promoted to match the size.
    
    The commit introduced a bug if the field is an array.
    For exmaple, block:block_rq_complete tracepoint has
    field rwbs:
      field:char rwbs[8];	offset:32;	size:8;	signed:1;
    
    The current implementation will incorrectly translate it
    into
      s64 rwbs[8];
    since it considers the type is "char".
    
    This patch fixed this issue by checking the field name
    and if it is an array, rewriting will be skipped.
    Signed-off-by: default avatarYonghong Song <yhs@fb.com>
    c2e2a26b
tp_frontend_action.cc 8.44 KB