1. 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
  2. 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
  3. 19 11月, 2013 1 次提交
  4. 13 11月, 2013 1 次提交
  5. 05 11月, 2013 8 次提交
  6. 13 7月, 2013 1 次提交
  7. 25 1月, 2013 5 次提交
  8. 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
  9. 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
  10. 25 9月, 2012 1 次提交
  11. 24 9月, 2012 10 次提交
  12. 15 9月, 2012 1 次提交
  13. 11 9月, 2012 1 次提交
    • I
      perf tools: Use __maybe_used for unused variables · 1d037ca1
      Irina Tirdea 提交于
      perf defines both __used and __unused variables to use for marking
      unused variables. The variable __used is defined to
      __attribute__((__unused__)), which contradicts the kernel definition to
      __attribute__((__used__)) for new gcc versions. On Android, __used is
      also defined in system headers and this leads to warnings like: warning:
      '__used__' attribute ignored
      
      __unused is not defined in the kernel and is not a standard definition.
      If __unused is included everywhere instead of __used, this leads to
      conflicts with glibc headers, since glibc has a variables with this name
      in its headers.
      
      The best approach is to use __maybe_unused, the definition used in the
      kernel for __attribute__((unused)). In this way there is only one
      definition in perf sources (instead of 2 definitions that point to the
      same thing: __used and __unused) and it works on both Linux and Android.
      This patch simply replaces all instances of __used and __unused with
      __maybe_unused.
      Signed-off-by: NIrina Tirdea <irina.tirdea@intel.com>
      Acked-by: NPekka Enberg <penberg@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1347315303-29906-7-git-send-email-irina.tirdea@intel.com
      [ committer note: fixed up conflict with a116e05d in builtin-sched.c ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1d037ca1
  14. 08 9月, 2012 1 次提交
  15. 07 9月, 2012 2 次提交