• Zhengjun Xing's avatar
    tracing: Fix "gfp_t" format for synthetic events · 9fa8c9c6
    Zhengjun Xing authored
    In the format of synthetic events, the "gfp_t" is shown as "signed:1",
    but in fact the "gfp_t" is "unsigned", should be shown as "signed:0".
    
    The issue can be reproduced by the following commands:
    
    echo 'memlatency u64 lat; unsigned int order; gfp_t gfp_flags; int migratetype' > /sys/kernel/debug/tracing/synthetic_events
    cat  /sys/kernel/debug/tracing/events/synthetic/memlatency/format
    
    name: memlatency
    ID: 2233
    format:
            field:unsigned short common_type;       offset:0;       size:2; signed:0;
            field:unsigned char common_flags;       offset:2;       size:1; signed:0;
            field:unsigned char common_preempt_count;       offset:3;       size:1; signed:0;
            field:int common_pid;   offset:4;       size:4; signed:1;
    
            field:u64 lat;  offset:8;       size:8; signed:0;
            field:unsigned int order;       offset:16;      size:4; signed:0;
            field:gfp_t gfp_flags;  offset:24;      size:4; signed:1;
            field:int migratetype;  offset:32;      size:4; signed:1;
    
    print fmt: "lat=%llu, order=%u, gfp_flags=%x, migratetype=%d", REC->lat, REC->order, REC->gfp_flags, REC->migratetype
    
    Link: http://lkml.kernel.org/r/20191018012034.6404-1-zhengjun.xing@linux.intel.comReviewed-by: default avatarTom Zanussi <tom.zanussi@linux.intel.com>
    Signed-off-by: default avatarZhengjun Xing <zhengjun.xing@linux.intel.com>
    Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
    9fa8c9c6
trace_events_hist.c 151 KB