1. 25 Apr, 2012 16 commits
    • Steven Rostedt's avatar
      parse-events: Rename struct record to struct pevent_record · 1c698186
      Steven Rostedt authored
      As libtraceevent will be a library, having struct record is far
      too generic of a name to use. Renaming it to be consistent with the
      rest of the functions will be a better long term solution.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      1c698186
    • Steven Rostedt's avatar
      parse-event: Fix memset pointer size bug in handle · 42c80139
      Steven Rostedt authored
      Fix memset(ptr, 0, sizeof(ptr)) to memset(ptr, 0, sizeof(*ptr))
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      42c80139
    • Steven Rostedt's avatar
      parse-events: Allow '*' and '/' operations in TP_printk · 2e7a5fc8
      Steven Rostedt authored
      Add multiply and divide operations in the printk format.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      2e7a5fc8
    • Vaibhav Nagarnaik's avatar
      parse-events: Support '+' opcode in print format · b4828598
      Vaibhav Nagarnaik authored
      The '+' opcode is not supported in the arguments for the print format.
      This patch adds support for it.
      
      Cc: Michael Rubin <mrubin@google.com>
      Cc: David Sharp <dhsharp@google.com>
      Signed-off-by: default avatarVaibhav Nagarnaik <vnagarnaik@google.com>
      Link: http://lkml.kernel.org/r/1310785241-3799-4-git-send-email-vnagarnaik@google.comSigned-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      b4828598
    • Steven Rostedt's avatar
      parse-events: Let pevent_free() take a NULL pointer · a2525a08
      Steven Rostedt authored
      The pevent_free() should ack like other free()s and allow a
      NULL pointer to be passed to it which makes error handling a bit
      easier for the users of pevent_free().
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      a2525a08
    • Vaibhav Nagarnaik's avatar
      parse-events: Handle opcode parsing error · 14ffde0e
      Vaibhav Nagarnaik authored
      If an invalid opcode is encountered in parsing event print format, the
      trace-cmd calls exit() without parsing any other events.
      
      This patch adds handling for such an error where the get_op_prio() is
      called. If the return value is -1, then the event print format parsing
      is skipped and parsing continues.
      
      Cc: Michael Rubin <mrubin@google.com>
      Cc: David Sharp <dhsharp@google.com>
      Signed-off-by: default avatarVaibhav Nagarnaik <vnagarnaik@google.com>
      Link: http://lkml.kernel.org/r/1311619257-4970-1-git-send-email-vnagarnaik@google.comSigned-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      14ffde0e
    • Vaibhav Nagarnaik's avatar
      parse-events: Handle invalid opcode parsing gracefully · d69afed5
      Vaibhav Nagarnaik authored
      If an invalid opcode is encountered, trace-cmd exits with an error.
      Instead it can be treated as a soft error where the event's print format
      is not parsed and its binary data is dumped out.
      
      This patch adds a return value to arg_num_eval() function to indicate if
      the parsing was successful. If not, then the error is considered soft
      and the parsing of the offending event fails.
      
      Cc: Michael Rubin <mrubin@google.com>
      Cc: David Sharp <dhsharp@google.com>
      Signed-off-by: default avatarVaibhav Nagarnaik <vnagarnaik@google.com>
      Link: http://lkml.kernel.org/r/1310785241-3799-2-git-send-email-vnagarnaik@google.comSigned-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      d69afed5
    • Julia Lawall's avatar
      perf/events: Correct size given to memset · 54a36258
      Julia Lawall authored
      This is a forward port of commit 5660ce34
      perf tools: Correct size given to memset
      written by Julia Lawall and forward ported by Steven Rostedt.
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      54a36258
    • Tom Zanussi's avatar
      perf/events: Add flag/symbol format_flags · 5205aec9
      Tom Zanussi authored
      This is a port of commit eb9a42ca
       perf trace: Add flag/symbolic format_flags
      of the old trace-event-parse.c to the new event-parse.c that
      was written by Tom Zanussi and forward ported by Steven Rostedt.
      Signed-off-by: default avatarTom Zanussi <tzanussi@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      5205aec9
    • Steven Rostedt's avatar
      perf/events: Add flag to produce nsec output · 4dc1024a
      Steven Rostedt authored
      libtraceevent library prints out in usecs but perf wants to print out
      in nsecs. Add a flag that lets the user decide to print out in usec
      or nsec times.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      4dc1024a
    • Steven Rostedt's avatar
      perf: Have perf use the new libtraceevent.a library · aaf045f7
      Steven Rostedt authored
      The event parsing code in perf was originally copied from trace-cmd
      but never was kept up-to-date with the changes that was done there.
      The trace-cmd libtraceevent.a code is much more mature than what is
      currently in perf.
      
      This updates the code to use wrappers to handle the calls to the
      new event parsing code. The new code requires a handle to be pass
      around, which removes the global event variables and allows
      more than one event structure to be read from different files
      (and different machines).
      
      But perf still has the old global events and the code throughout
      perf does not yet have a nice way to pass around a handle.
      A global 'pevent' has been made for perf and the old calls have
      been created as wrappers to the new event parsing code that uses
      the global pevent.
      
      With this change, perf can later incorporate the pevent handle into
      the perf structures and allow more than one file to be read and
      compared, that contains different events.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      aaf045f7
    • Steven Rostedt's avatar
      events: Update tools/lib/traceevent to work with perf · 668fe01f
      Steven Rostedt authored
      Some of the util functions of libtraceevent.a conflict with perf,
      such as die(), warning() and others. Move them into event-util.h
      that is not included by the perf tools.
      
      Also, as perf compiles with 'bool' the filter_arg->bool needs to
      be renamed to filter_arg->boolean.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      668fe01f
    • Steven Rostedt's avatar
      perf: Build libtraceevent.a · d0e7b850
      Steven Rostedt authored
      Have building perf also build libtraceevent.a. Currently, perf does
      not use the code within libtraceevent.a, but it soon will.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      d0e7b850
    • Steven Rostedt's avatar
      tools/events: Add files to create libtraceevent.a · f7d82350
      Steven Rostedt authored
      Copy over the files from trace-cmd to the Linux tools directory
      such that applications like perf and latencytrace can use the
      more advanced parsing code.
      
      Because some of the file names of perf conflict with trace-cmd file
      names, the trace-cmd files have been renamed as follows:
      
       parse-events.c ==> event-parse.c
       parse-events.h ==> event-parse.h
       utils.h        ==> event-utils.h
      
      The files have been updated to handle the changes to the header files
      but other than that, they are identical to what was in the trace-cmd
      repository. The history of these files, including authorship is
      available at the git repo:
      
       git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
      
      The Makefile was also copied over, but most of it was removed to
      focus on the parse-events code first. The parts of the Makefile for
      the plugins have also been removed, but will be added back when the
      plugin code is copied over as well. But that may be in its own
      separate directory.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      f7d82350
    • Steven Rostedt's avatar
      perf: Separate out trace-cmd parse-events from perf files · 4ace73ee
      Steven Rostedt authored
      Move the trace-event-parse.c code that originally came from trace-cmd into
      their own files. The new file will be called trace-parse-events.c, as
      the name of trace-cmd's file was parse-events.c too, but it conflicted
      with the parse-events.c file in perf that parses the command line.
      
      This tries to update the code with mimimal changes.
      
      Perf specific code stays in the trace-event-parse.[ch] files and
      the common parsing code is now in trace-parse-events.c and
      trace-parse-events.h.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      4ace73ee
    • Ingo Molnar's avatar
      Merge tag 'v3.4-rc4' into perf/core · 3dbe927b
      Ingo Molnar authored
      Merge v3.4-rc4 - we were on -rc2 before.
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      3dbe927b
  2. 21 Apr, 2012 23 commits
  3. 20 Apr, 2012 1 commit