1. 27 6月, 2014 1 次提交
  2. 08 6月, 2014 1 次提交
  3. 23 4月, 2014 1 次提交
  4. 14 4月, 2014 2 次提交
  5. 17 1月, 2014 2 次提交
  6. 19 12月, 2013 1 次提交
  7. 06 12月, 2013 1 次提交
    • S
      tools lib traceevent: Report better error message on bad function args · 3a3ffa2e
      Steven Rostedt 提交于
      When Jiri Olsa was writing a function callback for
      scsi_trace_parse_cdb(), he thought that the traceevent library had a
      bug in it because he was getting this error:
      
        Error: expected ')' but read ','
        Error: expected ')' but read ','
        Error: expected ')' but read ','
        Error: expected ')' but read ','
      
      But in truth, he didn't have the write number of arguments for the
      function callback, and the error was the library detecting the
      discrepancy. A better error message would have prevented the confusion:
      
        Error: function 'scsi_trace_parse_cdb()' only expects 2 arguments but event scsi_dispatch_cmd_timeout has more
        Error: function 'scsi_trace_parse_cdb()' only expects 2 arguments but event scsi_dispatch_cmd_start has more
        Error: function 'scsi_trace_parse_cdb()' only expects 2 arguments but event scsi_dispatch_cmd_error has more
        Error: function 'scsi_trace_parse_cdb()' only expects 2 arguments but event scsi_dispatch_cmd_done has more
      
      Or
      
        Error: function 'scsi_trace_parse_cdb()' expects 4 arguments but event scsi_dispatch_cmd_timeout only uses 3
        Error: function 'scsi_trace_parse_cdb()' expects 4 arguments but event scsi_dispatch_cmd_start only uses 3
        Error: function 'scsi_trace_parse_cdb()' expects 4 arguments but event scsi_dispatch_cmd_error only uses 3
        Error: function 'scsi_trace_parse_cdb()' expects 4 arguments but event scsi_dispatch_cmd_done only uses 3
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/n/tip-a4c34w62vl0diitvxb7bt3er@git.kernel.orgSigned-off-by: NJiri Olsa <jolsa@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3a3ffa2e
  8. 05 12月, 2013 1 次提交
  9. 28 11月, 2013 1 次提交
    • S
      tools lib traceevent: Use helper trace-seq in print functions like kernel does · 12e55569
      Steven Rostedt 提交于
      Jiri Olsa reported that his plugin for scsi was chopping off part of the
      output. Investigating this, I found that Jiri used the same functions as
      what is in the kernel, which adds the following:
      
      	trace_seq_putc(p, 0);
      
      This adds a '\0' to the output string. The reason this works in the
      kernel is that the "p" that is passed to the function helper is a
      temporary trace_seq. But in the libtraceevent library, it's the pointer
      to the trace_seq used to output. By adding the '\0', it truncates the
      line and nothing added after that will be printed.
      
      We can solve this in two ways. One is to have the helper functions for
      the library not add the unnecessary '\0'. The other is to change the
      library to also use a helper trace_seq structure that gets copied to the
      main trace_seq just like the kernel does.
      
      The latter allows the helper functions in the plugins to be the same as
      the kernel, which is the better solution.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      Reported-by: NJiri Olsa <jolsa@redhat.com>
      Tested-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/20131119182937.401668e3@gandalf.local.homeSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      12e55569
  10. 20 11月, 2013 1 次提交
    • A
      tools lib traceevent: Fix conversion of pointer to integer of different size · 6b5fa0ba
      Arnaldo Carvalho de Melo 提交于
      gcc complaint on 32-bit system:
      
        /home/acme/git/linux/tools/lib/traceevent/event-parse.c: In function ‘eval_num_arg’:
        /home/acme/git/linux/tools/lib/traceevent/event-parse.c:3468:9: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      
      This is because the eval_num_arg returns everything as an 'unsigned long long',
      so it converts a void pointer to a wider integer, fix it by converting the void
      pointer to an integer of the same size, 'unsigned long', before casting it to
      'unsigned long long'.
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-yllx4aqcg06v5n4vjpwiiuld@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6b5fa0ba
  11. 19 11月, 2013 1 次提交
  12. 13 11月, 2013 1 次提交
  13. 05 11月, 2013 8 次提交
  14. 13 7月, 2013 1 次提交
  15. 25 1月, 2013 5 次提交
  16. 10 11月, 2012 5 次提交
    • A
      tools lib traceevent: Use 'const' in variables pointing to const strings · 27f94d52
      Arnaldo Carvalho de Melo 提交于
      Fixing the build on fedora 14, 32-bit:
      
        tools/lib/traceevent/event-parse.c: In function ‘find_cmdline’:
        tools/lib/traceevent/event-parse.c:183:3: error: return discards qualifiers from pointer target type
        tools/lib/traceevent/event-parse.c:186:3: error: return discards qualifiers from pointer target type
        tools/lib/traceevent/event-parse.c:195:2: error: return discards qualifiers from pointer target type
        tools/lib/traceevent/event-parse.c: In function ‘process_func_handler’:
        tools/lib/traceevent/event-parse.c:2658:9: error: assignment discards qualifiers from pointer target type
        tools/lib/traceevent/event-parse.c:2660:9: error: assignment discards qualifiers from pointer target type
        tools/lib/traceevent/event-parse.c: In function ‘print_mac_arg’:
        tools/lib/traceevent/event-parse.c:3892:14: error: initialization discards qualifiers from pointer target type
        tools/lib/traceevent/event-parse.c:3906:7: error: assignment discards qualifiers from pointer target type
        tools/lib/traceevent/event-parse.c: In function ‘pevent_print_event’:
        tools/lib/traceevent/event-parse.c:4412:24: error: initialization discards qualifiers from pointer target type
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/n/tip-0k5g8urwu7vwkgbcbt2x05fe@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      27f94d52
    • A
      tools lib traceevent: Handle INVALID_ARG_TYPE errno in pevent_strerror · 7a905611
      Arnaldo Carvalho de Melo 提交于
      gcc on f14 32-bit rightly complains:
      
         tools/lib/traceevent/event-parse.c:5097:2: error: enumeration value ‘PEVENT_ERRNO__INVALID_ARG_TYPE’ not handled in switch
      
      The entry for it is in the error strings array pevent_error_str[]:
      
              _PE(INVALID_ARG_TYPE,   "invalid argument type")
      
      It was just not being handled on the pevent_strerror switch, fix it.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/n/tip-c68zkvxw4289uqbosfkz963g@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7a905611
    • A
      tools lib traceevent: No need to check for < 0 on an unsigned enum · e46466b8
      Arnaldo Carvalho de Melo 提交于
      gcc on f14 32-bit complains:
      
        tools/lib/traceevent/event-parse.c: In function ‘pevent_register_print_function’:
        tools/lib/traceevent/event-parse.c:5366:3: error: comparison of unsigned expression < 0 is always false
      
      This is because:
      
                enum pevent_func_arg_type type;
      
      this enum doesn't have any negative value, so gcc makes it an 'unsigned
      int'. Fix it by removing the < 0 test.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/n/tip-6vnd6ud6fbpn48zax4a5ru01@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e46466b8
    • A
      tools lib traceevent: Avoid comparisions between signed/unsigned · 8a38cce4
      Arnaldo Carvalho de Melo 提交于
      Fixing this warning-as-error on f14 32-bit:
      
        tools/lib/traceevent/event-parse.c:5564:17: error: comparison between signed and unsigned integer expressions
        tools/lib/traceevent/event-parse.c:5586:17: error: comparison between signed and unsigned integer expressions
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/n/tip-stmix8hy4nu5ervpynn8yj2z@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8a38cce4
    • A
      tools lib traceevent: Add __maybe_unused to unused parameters · ca383a4d
      Arnaldo Carvalho de Melo 提交于
      Fixing the build on 32-bit Fedora 14:
      
        tools/lib/traceevent/event-parse.c: In function ‘print_event_fields’:
        tools/lib/traceevent/event-parse.c:3934:69: error: unused parameter ‘size’
        tools/lib/traceevent/event-parse.c: In function ‘pevent_strerror’:
        tools/lib/traceevent/event-parse.c:5074:36: error: unused parameter ‘pevent’
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/n/tip-soe4gqcz8fd4ecik6exvyqox@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ca383a4d
  17. 17 10月, 2012 1 次提交
    • S
      lib tools traceevent: Add back pevent assignment in __pevent_parse_format() · 101782ea
      Steven Rostedt 提交于
      Even though with the change of commit commit 2b29175d "tools lib
      traceevent: Carve out events format parsing routine", allowed
      __pevent_parse_format() to parse an event without the need of a pevent
      handler, the event still needs to assign the pevent handed to it.
      
      There's no problem with assigning it if the pevent is NULL, as the
      event->pevent would be NULL without the assignment. But function parsing
      handlers may be assigned to the pevent handler to help in parsing the
      event. If there's no pevent then there would not be any function
      handlers, but if the pevent isn't assigned first before parsing the
      event, it wont honor the function handlers that were assigned.
      
      Worse yet, the current code crashes if an event has a function that it
      tries to parse. For example:
      
       # perf record -e scsi:scsi_dispatch_cmd_timeout
       Segmentation fault (core dumped)
      
      This happens because the scsi_dispatch_cmd_timeout event format has the following:
      
        scsi_trace_parse_cdb(p, __get_dynamic_array(cmnd), REC->cmd_len)
      
      which hasn't been defined by the pevent code.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      Reviewed-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/1349136831.22822.133.camel@gandalf.local.homeSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      101782ea
  18. 25 9月, 2012 1 次提交
  19. 24 9月, 2012 5 次提交