• T
    perf tools: Reinstate 'signed' field flag for tracepoints · 10ee9fa3
    Tom Zanussi 提交于
    For some reason the libtraceevent tracepoint-parsing code is missing
    the FIELD_IS_SIGNED flag-setting code, which causes problems for the
    Perl trace event binding at least, since it ends up unable to
    recognize negative numbers.
    
    Things like checking for negative return values therefore fail, causing
    scripts like rwtop to instead interpret the negative return value as a
    large positive value, which in turn get added to e.g. read totals with
    insanely invalid results.
    
    So set the FIELD_IS_SIGNED flag for tracepoint events that specify
    "signed:1".
    
    Before:
    
      # perf script record rw-by-pid
      # perf script report rw-by-pid
    
      read counts by pid:
    
         pid                  comm     # reads  bytes_requested  bytes_read
      ------  --------------------  -----------  ----------  ----------
         753  Xorg                          88      512000  7.74763251095801e+20
        1619  firefox                       42         462  2.58254417031934e+20
        1232  gnome-shell                   11         176  1.10680464442257e+20
        1471  gnome-terminal                 3       16366  18446744073709551615
        1408  libsocialweb-co                2          32  18446744073709551613
    
    After:
    
      # perf script report rw-by-pid
    
      read counts by pid:
    
         pid                  comm     # reads  bytes_requested  bytes_read
      ------  --------------------  -----------  ----------  ----------
         753  Xorg                          88      512000        2764
        1619  firefox                       42         462         126
        1232  gnome-shell                   11         176          40
        1471  gnome-terminal                 3       16366          10
        1408  libsocialweb-co                2          32           8
    Signed-off-by: NTom Zanussi <tom.zanussi@linux.intel.com>
    Link: http://lkml.kernel.org/r/1471b5968821a455cf5168bb4567964e74ecf530.1358527965.git.tom.zanussi@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
    10ee9fa3
event-parse.c 117.8 KB