1. 22 5月, 2012 2 次提交
    • F
      perf script: Rename struct event to struct event_format in perl engine · 8784eb74
      Frederic Weisbecker 提交于
      While migrating to the libtraceevent, the perl scripting engine
      missed this structure rename.
      
      This fixes:
      
           util/scripting-engines/trace-event-perl.c: In function "find_cache_event":
           util/scripting-engines/trace-event-perl.c:244: error: assignment from incompatible pointer type
           util/scripting-engines/trace-event-perl.c:248: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:248: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:250: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c: In function "perl_process_tracepoint":
           util/scripting-engines/trace-event-perl.c:286: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:286: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:307: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c: In function "perl_generate_script":
           util/scripting-engines/trace-event-perl.c:498: error: passing argument 1 of "trace_find_next_event" from incompatible pointer type
           util/scripting-engines/../trace-event.h:56: note: expected "struct event_format *" but argument is of type "struct event *"
           util/scripting-engines/trace-event-perl.c:498: error: assignment from incompatible pointer type
           util/scripting-engines/trace-event-perl.c:499: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:499: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:513: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:532: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:556: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:569: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:570: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:579: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:580: error: dereferencing pointer to incomplete type
      Reported-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@redhat.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Link: http://lkml.kernel.org/r/1337697049-30251-2-git-send-email-fweisbec@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8784eb74
    • F
      perf script: Explicitly handle known default print arg type · e326e752
      Frederic Weisbecker 提交于
      Handle the print argument types brought by the new libparsevent in perl
      scripting engine.
      
      PRINT_BSTRING and PRINT_DYNAMIC_ARRAY are treated just like strings
      and thus don't require specific processing.
      
      But PRINT_FUNC need specific plugins which are not yet handled, lets
      warn if we meet this case.
      
      This fixes:
      
           util/scripting-engines/trace-event-perl.c: In function define_event_symbol:
           util/scripting-engines/trace-event-perl.c:188: error: enumeration value PRINT_BSTRING not handled in switch
           util/scripting-engines/trace-event-perl.c:188: error: enumeration value PRINT_DYNAMIC_ARRAY not handled in switch
           util/scripting-engines/trace-event-perl.c:188: error: enumeration value PRINT_FUNC not handled in switch
      Reported-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@redhat.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Link: http://lkml.kernel.org/r/1337697049-30251-1-git-send-email-fweisbec@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e326e752
  2. 25 4月, 2012 1 次提交
    • S
      perf: Have perf use the new libtraceevent.a library · aaf045f7
      Steven Rostedt 提交于
      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: NSteven 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: NFrederic Weisbecker <fweisbec@gmail.com>
      aaf045f7
  3. 31 1月, 2012 1 次提交
  4. 24 12月, 2011 1 次提交
    • R
      perf script: Add generic perl handler to process events · 37a058ea
      Robert Richter 提交于
      The current perf scripting facility only supports tracepoints. This
      patch implements a generic perl handler to support other events than
      tracepoints too.
      
      This patch introduces a function process_event() that is called by perf
      for each sample. The function is called with byte streams as arguments
      containing information about the event, its attributes, the sample and
      raw data. Perl's unpack() function can easily be used for byte decoding.
      The following is the default implementation for process_event() that can
      also be generated with perf script:
      
       # Packed byte string args of process_event():
       #
       # $event:       union perf_event        util/event.h
       # $attr:        struct perf_event_attr  linux/perf_event.h
       # $sample:      struct perf_sample      util/event.h
       # $raw_data:    perf_sample->raw_data   util/event.h
      
       sub process_event
       {
               my ($event, $attr, $sample, $raw_data) = @_;
      
               my @event       = unpack("LSS", $event);
               my @attr        = unpack("LLQQQQQLLQQ", $attr);
               my @sample      = unpack("QLLQQQQQLL", $sample);
               my @raw_data    = unpack("C*", $raw_data);
      
               use Data::Dumper;
               print Dumper \@event, \@attr, \@sample, \@raw_data;
       }
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1323969824-9711-4-git-send-email-robert.richter@amd.comSigned-off-by: NRobert Richter <robert.richter@amd.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      37a058ea
  5. 28 11月, 2011 1 次提交
  6. 24 3月, 2011 1 次提交
    • A
      perf session: Pass evsel in event_ops->sample() · 9e69c210
      Arnaldo Carvalho de Melo 提交于
      Resolving the sample->id to an evsel since the most advanced tools,
      report and annotate, and the others will too when they evolve to
      properly support multi-event perf.data files.
      
      Good also because it does an extra validation, checking that the ID is
      valid when present. When that is not the case, the overhead is just a
      branch + function call (perf_evlist__id2evsel).
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      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: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9e69c210
  7. 15 3月, 2011 1 次提交
  8. 07 2月, 2011 1 次提交
    • K
      perf tool: Fix gcc 4.6.0 issues · fb7d0b3c
      Kyle McMartin 提交于
      GCC 4.6.0 in Fedora rawhide turned up some compile errors in tools/perf
      due to the -Werror=unused-but-set-variable flag.
      
      I've gone through and annotated some of the assignments that had side
      effects (ie: return value from a function) with the __used annotation,
      and in some cases, just removed unused code.
      
      In a few cases, we were assigning something useful, but not using it in
      later parts of the function.
      
      kyle@dreadnought:~/src% gcc --version
      gcc (GCC) 4.6.0 20110122 (Red Hat 4.6.0-0.3)
      
      Cc: Ingo Molnar <mingo@redhat.com>
      LKML-Reference: <20110124161304.GK27353@bombadil.infradead.org>
      Signed-off-by: NKyle McMartin <kyle@redhat.com>
      [ committer note: Fixed up the annotation fixes, as that code moved recently ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fb7d0b3c
  9. 17 11月, 2010 1 次提交
  10. 01 6月, 2010 1 次提交
  11. 11 5月, 2010 1 次提交
  12. 03 4月, 2010 1 次提交
    • T
      perf/scripts: Tuple was set from long in both branches in python_process_event() · b1dcc03c
      Tom Zanussi 提交于
      This is a fix to the signed/unsigned field handling in the
      Python scripting engine, based on a patch from Roel Kluin.
      
      Basically, Python wants to use a PyInt (which is internally a
      long) if it can i.e. if the value will fit into that type.  If
      not, it stores it into a PyLong, which isn't actually a long,
      but an arbitrary-precision integer variable.
      
      The code below is similar to to what Python does internally, and
      it seems to work as expected on the x86 and x86_64 sytems I
      tested it on.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Roel Kluin <roel.kluin@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: rostedt@goodmis.org
      LKML-Reference: <1270184305.6422.10.camel@tropicana>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b1dcc03c
  13. 25 2月, 2010 2 次提交
  14. 24 2月, 2010 1 次提交
    • T
      perf/scripts: Move Perl scripting files to scripting-engines dir · 82d156cd
      Tom Zanussi 提交于
      Create a scripting-engines directory to contain scripting engine
      implementation code, in anticipation of the addition of new scripting
      support.  Also removes trace-event-perl.h.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Keiichi KII <k-keiichi@bx.jp.nec.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <1264580883-15324-5-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      82d156cd