26 Jan, 2017

1 commit

  • Current trace info data lacks the saved cmdline mapping which is needed
    for pevent to find out the comm of a task. Add this and bump up the
    version number so that perf can determine its presence when reading.

    This is mostly corresponding to trace.dat file version 6, but still
    lacks 4 byte of number of cpus, and 10 bytes of type string - and I
    think we don't need those anyway.

    Signed-off-by: Namhyung Kim
    Tested-by: Masami Hiramatsu
    Cc: Frederic Weisbecker
    Cc: Jeremy Eder
    Cc: Jiri Olsa ,
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Steven Rostedt
    [ Change version test from == to >= ]
    Link: http://lkml.kernel.org/n/tip-vaooqpxsikxbb3359p0corcb@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

13 Jul, 2016

1 commit

  • To get struct event_format object from tracepoint ID. It will be used
    in following patches.

    Signed-off-by: Jiri Olsa
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1468148882-10362-3-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

07 Jan, 2016

1 commit

  • Python and perl scripting code will define those callbacks and get stat
    data.

    Signed-off-by: Jiri Olsa
    Tested-by: Kan Liang
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1452028152-26762-5-git-send-email-jolsa@kernel.org
    [ Rename 'time' parameters to 'tstamp', to fix the build in older distros ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

29 Sep, 2015

1 commit


29 Jul, 2015

1 commit

  • The python binding still doesn't provide symbol resolving facilities,
    but the recent addition of the trace_event__register_resolver() function
    made it add as a dependency the machine__resolve_kernel_addr() method,
    that in turn drags all the symbol resolving code.

    The problem:

    [root@zoo ~]# perf test -v python
    17: Try 'import perf' in python, checking link problems :
    --- start ---
    test child forked, pid 6853
    Traceback (most recent call last):
    File "", line 1, in
    ImportError: /tmp/build/perf/python/perf.so: undefined symbol: machine__resolve_kernel_addr
    test child finished with -1
    ---- end ----
    Try 'import perf' in python, checking link problems: FAILED!
    [root@zoo ~]#

    Fix it by requiring this function to receive the resolver as a
    parameter, just like pevent_register_function_resolver(), i.e. do
    not explicitely refer to an object file not included in
    tools/perf/util/python-ext-sources.

    [root@zoo ~]# perf test python
    17: Try 'import perf' in python, checking link problems : Ok
    [root@zoo ~]#

    Cc: Adrian Hunter
    Cc: Borislav Petkov
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Stephane Eranian
    Fixes: c3168b0db93a ("perf symbols: Provide libtraceevent callback to resolve kernel symbols")
    Link: http://lkml.kernel.org/n/tip-vxlhh95v2em9zdbgj3jm7xi5@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

24 Jul, 2015

1 commit


03 Apr, 2015

1 commit


06 Feb, 2015

1 commit

  • The existing one, event_format__print() uses stdout unconditionally,
    and 'perf trace' needs to use it to format into a file that may have
    been set by the user, i.e. 'trace -o file.output'.

    Cc: Adrian Hunter
    Cc: Borislav Petkov
    Cc: David Ahern
    Cc: Don Zickus
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/n/tip-7l0mgm91hwg0bby00s5pse8r@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

23 Aug, 2014

1 commit

  • In order to defer some output via the scripting API, there needs to be a
    callback after session processing but before the session is deleted.

    Signed-off-by: Adrian Hunter
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1408129739-17368-3-git-send-email-adrian.hunter@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Adrian Hunter
     

20 Dec, 2013

1 commit

  • The addr_location struct should fully qualify an address, and to do that
    it should have in it the machine where the thread was found.

    Thus all functions that receive an addr_location now don't need to also
    receive a 'machine', those functions just need to access al->machine
    instead, just like it does with the other parts of an address location:
    al->thread, al->map, etc.

    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-o51iiee7vyq4r3k362uvuylg@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

05 Dec, 2013

2 commits

  • In order to get the proper plugins processing we need to use full
    trace-event interface when creating tracepoint events. So far we were
    using shortcut to get the parsed format.

    Moving current 'event_format__new' function into trace-event object as
    'trace_event__tp_format'.

    This function uses properly initialized global trace-event object,
    ensuring proper plugins processing.

    Signed-off-by: Jiri Olsa
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/1386076182-14484-11-git-send-email-jolsa@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • Add trace-event object to keep together 'struct pevent' object with its
    loaded plugins with following interface:

    int trace_event__init(struct trace_event *t);

    - Initalizes 'struct pevent' object and loads plugins for it

    void trace_event__cleanup(struct trace_event *t);

    - Cleanups both 'struct pevent' and plugins

    Signed-off-by: Jiri Olsa
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/1386076182-14484-10-git-send-email-jolsa@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

09 Oct, 2013

1 commit

  • Removing unused trace-event-* code.

    Acked-by: Namhyung Kim
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1379003976-5839-3-git-send-email-jolsa@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

22 Jul, 2013

1 commit

  • Commit 73994dc broke named thread support in perf-script. The thread
    struct in al is the main thread for a multithreaded process. The thread
    struct used for analysis (e.g., dumping events) should be the specific
    thread for the sample.

    Signed-off-by: David Ahern
    Cc: Feng Tang
    Link: http://lkml.kernel.org/r/1374185175-28272-1-git-send-email-dsahern@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     

13 Jul, 2013

4 commits

  • They're internals of ftrace ring-buffer and not used in perf code
    directly. As it now resides on libtraceevent/kbuffer.h, just get rid of
    them.

    Signed-off-by: Namhyung Kim
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/1370323231-14022-17-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • It's the only user of the variable, so move it.

    Signed-off-by: Namhyung Kim
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/1370323231-14022-14-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • They're not used anywhere and same information is kept in a pevent
    already. So let's get rid of them.

    Signed-off-by: Namhyung Kim
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/1370323231-14022-13-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Header files of libtraceevent or no longer local headers. Thus, use
    default path notation for them. Also removing extra traceevent include
    path and instead handle this similar to liblk.

    Signed-off-by: Robert Richter
    Signed-off-by: Robert Richter
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Robert Richter
    Link: http://lkml.kernel.org/r/1370964558-8599-1-git-send-email-rric@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Robert Richter
     

22 Mar, 2013

1 commit


16 Mar, 2013

1 commit


12 Aug, 2012

1 commit

  • This brings the support for DWARF cfi unwinding on perf post
    processing. Call frame informations are retrieved and then passed
    to libunwind that requests memory and register content from the
    applications.

    Adding unwind object to handle the user stack backtrace based
    on the user register values and user stack dump.

    The unwind object access the libunwind via remote interface
    and provides to it all the necessary data to unwind the stack.

    The unwind interface provides following function:
    unwind__get_entries

    And callback (specified in above function) to retrieve
    the backtrace entries:
    typedef int (*unwind_entry_cb_t)(struct unwind_entry *entry,
    void *arg);

    Signed-off-by: Jiri Olsa
    Original-patch-by: Frederic Weisbecker
    Cc: "Frank Ch. Eigler"
    Cc: Arun Sharma
    Cc: Benjamin Redelings
    Cc: Corey Ashford
    Cc: Cyrill Gorcunov
    Cc: Frank Ch. Eigler
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Robert Richter
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    Cc: Ulrich Drepper
    Link: http://lkml.kernel.org/r/1344345647-11536-12-git-send-email-jolsa@redhat.com
    [ Replaced use of perf_session by usage of perf_evsel ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

08 Aug, 2012

3 commits

  • …for "process_event()"

    Both perl and python script start processing events other than trace
    points, and it's useful to pass the resolved symbol and the dso info to
    the event handler in script for better analysis and statistics.

    Struct thread is already a member of struct addr_location, using
    addr_location will keep the thread info, while providing additional
    symbol and dso info if exist, so that the script itself doesn't need to
    bother to do the symbol resolving and dso searching work.

    Tested-by: David Ahern <dsahern@gmail.com>
    Signed-off-by: Feng Tang <feng.tang@intel.com>
    Acked-by: David Ahern <dsahern@gmail.com>
    Cc: Andi Kleen <andi@firstfloor.org>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Ingo Molnar <mingo@elte.hu>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Robert Richter <robert.richter@amd.com>
    Cc: Stephane Eranian <eranian@google.com>
    Link: http://lkml.kernel.org/r/1344419875-21665-3-git-send-email-feng.tang@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

    Feng Tang
     
  • We can get all that is needed using just event_format, that is available
    via evsel->tp_format now.

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-2hsr1686epa9f0vx4yg7z2zj@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • We already lookup the associated event_format when reading the perf.data
    header, so that we can cache the tracepoint name in evsel->name, so do
    it a little further and save the event_format itself, so that we can
    avoid relookups in tools that need to access it.

    Change the tools to take the most obvious advantage, when they were
    using pevent_find_event directly. More work is needed for further
    removing the need of a pointer to pevent, such as when asking for event
    field values ("common_pid" and the other common fields and per
    event_format fields).

    This is something that was planned but only got actually done when
    Andrey Wagin needed to do this lookup at perf_tool->sample() time, when
    we don't have access to pevent (session->pevent) to use with
    pevent_find_event().

    Cc: Andrey Wagin
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Signed-off-by: Arnaldo Carvalho de Melo
    Link: http://lkml.kernel.org/n/tip-txkvew2ckko0b594ae8fbnyk@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

28 Jun, 2012

1 commit

  • The pevent thing is per perf.data file, so I made it stop being static
    and become a perf_session member, so tools processing perf.data files
    use perf_session and _there_ we read the trace events description into
    session->pevent and then change everywhere to stop using that single
    global pevent variable and use the per session one.

    Note that it _doesn't_ fall backs to trace__event_id, as we're not
    interested at all in what is present in the
    /sys/kernel/debug/tracing/events in the workstation doing the analysis,
    just in what is in the perf.data file.

    This patch also introduces perf_session__set_tracepoints_handlers that
    is the perf perf.data/session way to associate handlers to tracepoint
    events by resolving their IDs using the events descriptions stored in a
    perf.data file. Make 'perf sched' use it.

    Reported-by: Dmitry Antipov
    Tested-by: Dmitry Antipov
    Cc: Frederic Weisbecker
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: linaro-dev@lists.linaro.org
    Cc: patches@linaro.org
    Link: http://lkml.kernel.org/r/20120625232016.GA28525@infradead.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

25 Apr, 2012

3 commits

  • 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: Steven Rostedt
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Borislav Petkov
    Cc: Jiri Olsa
    Cc: Arun Sharma
    Cc: Namhyung Kim
    Signed-off-by: Frederic Weisbecker

    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: Steven Rostedt
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Borislav Petkov
    Cc: Jiri Olsa
    Cc: Arun Sharma
    Cc: Namhyung Kim
    Signed-off-by: Frederic Weisbecker

    Steven Rostedt
     
  • 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: Steven Rostedt
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Borislav Petkov
    Cc: Jiri Olsa
    Cc: Arun Sharma
    Cc: Namhyung Kim
    Signed-off-by: Frederic Weisbecker

    Steven Rostedt
     

28 Nov, 2011

1 commit


20 Oct, 2011

1 commit

  • Fixing the way the tracing information is stored within record command.
    The current implementation is causing issues for pipe output.

    Following commands fail currently:
    perf script syscall-counts ls
    perf record -e syscalls:sys_exit_read ls | ./perf report -i -

    The tracing information is part of the perf data file. It contains
    several files from within the tracing debugfs and procs directories.

    Beside some static header files, for each tracing event the format
    file is added. The /proc/kallsyms file is also added.

    The tracing data are stored with preceeding size. This is causing some
    dificulties for pipe output, since there's no way to tell debugfs/proc
    file size before reading it. So, for pipe output, all the debugfs files
    were read twice. Once to get the overall size and once to store the
    content itself. This can cause problem in case any of these file
    changed, within the storage time.

    To fix this behaviour and ensure the integrity of the tracing data, we:
    - read debugfs/proc file into the temp file
    - get temp file size and dump it to the pipe
    - dump the temp file contents to the pipe

    Cc: Eric Dumazet
    Cc: Ingo Molnar
    Cc: Neil Horman
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/20111020135943.GD2092@jolsa.brq.redhat.com
    Signed-off-by: Jiri Olsa
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

24 Mar, 2011

1 commit

  • 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
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

15 Mar, 2011

2 commits

  • This change does impact output: latency data is trace specific and is
    now printed after the common data - comm, tid, cpu, time and event name.

    Acked-by: Frederic Weisbecker
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    LKML-Reference:
    Signed-off-by: David Ahern
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • Prepare for handling of samples for any event type.

    Acked-by: Frederic Weisbecker
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    LKML-Reference:
    Signed-off-by: David Ahern
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     

04 Jan, 2011

1 commit

  • Out of ad-hoc code and global arrays with hard coded sizes.

    This is the first step on having a library that will be first
    used on regression tests in the 'perf test' tool.

    [acme@felicio linux]$ size /tmp/perf.before
    text data bss dec hex filename
    1273776 97384 5104416 6475576 62cf38 /tmp/perf.before
    [acme@felicio linux]$ size /tmp/perf.new
    text data bss dec hex filename
    1275422 97416 1392416 2765254 2a31c6 /tmp/perf.new

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

20 May, 2010

1 commit

  • Accessing trace values of an 8 size may end up in a segfault
    on archs that can't deal with misaligned access, which is the
    case for sparc 64. This is because PERF_SAMPLE_RAW are aligned
    to 4 and not to 8.

    Fix this on the macros that get the values of 8 size.

    This fixes segfaults on perf tools in sparc 64.

    Signed-off-by: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    Cc: Steven Rostedt
    Cc: Tom Zanussi
    Cc: Masami Hiramatsu
    Cc: David Miller

    Frederic Weisbecker
     

03 May, 2010

2 commits

  • …ic/random-tracing into perf/core

    Ingo Molnar
     
  • Currently, perf 'live mode' writes build-ids at the end of the
    session, which isn't actually useful for processing live mode events.

    What would be better would be to have the build-ids sent before any of
    the samples that reference them, which can be done by processing the
    event stream and retrieving the build-ids on the first hit. Doing
    that in perf-record itself, however, is off-limits.

    This patch introduces perf-inject, which does the same job while
    leaving perf-record untouched. Normal mode perf still records the
    build-ids at the end of the session as it should, but for live mode,
    perf-inject can be injected in between the record and report steps
    e.g.:

    perf record -o - ./hackbench 10 | perf inject -v -b | perf report -v -i -

    perf-inject reads a perf-record event stream and repipes it to stdout.
    At any point the processing code can inject other events into the
    event stream - in this case build-ids (-b option) are read and
    injected as needed into the event stream.

    Build-ids are just the first user of perf-inject - potentially
    anything that needs userspace processing to augment the trace stream
    with additional information could make use of this facility.

    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Cc: Frédéric Weisbecker
    LKML-Reference:
    Signed-off-by: Tom Zanussi
    Signed-off-by: Arnaldo Carvalho de Melo

    Tom Zanussi
     

01 May, 2010

1 commit

  • commit e9e94e3bd862d31777335722e747e97d9821bc1d
    "perf trace: Ignore "overwrite" field if present in
    /events/header_page" makes perf trace launching spurious warnings
    about unexpected tokens read:

    Warning: Error: expected type 6 but read 4

    This change tries to handle the overcommit field in the header_page
    file whenever this field is present or not.

    The problem is that if this field is not present, we try to find it
    and give up in the middle of the line when we realize we are actually
    dealing with another field, which is the "data" one. And this failure
    abandons the file pointer in the middle of the "data" description
    line:

    field: u64 timestamp; offset:0; size:8; signed:0;
    field: local_t commit; offset:8; size:8; signed:1;
    field: char data; offset:16; size:4080; signed:1;
    ^^^
    Here

    What happens next is that we want to read this line to parse the data
    field, but we fail because the pointer is not in the beginning of the
    line.

    We could probably fix that by rewinding the pointer. But in fact we
    don't care much about these headers that only concern the ftrace
    ring-buffer. We don't use them from perf.

    Just skip this part of perf.data, but don't remove it from recording
    to stay compatible with olders perf.data

    Signed-off-by: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    Cc: Stephane Eranian
    Cc: Steven Rostedt

    Frederic Weisbecker
     

14 Apr, 2010

2 commits

  • Bypasses the tracing_data perf header code and replaces it with
    a synthesized event and processing function that accomplishes
    the same thing, used when reading/writing perf data to/from a
    pipe.

    The tracing data is pretty large, and this patch doesn't attempt
    to break it down into component events. The tracing_data event
    itself doesn't actually contain the tracing data, rather it
    arranges for the event processing code to skip over it after
    it's read, using the skip return value added to the event
    processing loop in a previous patch.

    Signed-off-by: Tom Zanussi
    Acked-by: Thomas Gleixner
    Cc: fweisbec@gmail.com
    Cc: rostedt@goodmis.org
    Cc: k-keiichi@bx.jp.nec.com
    Cc: acme@ghostprotocols.net
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Tom Zanussi
     
  • Parsing an option from the command line with OPT_BOOLEAN on a
    bool data type would not work on a big-endian machine due to the
    manner in which the boolean was being cast into an int and
    incremented. For example, running 'perf probe --list' on a
    PowerPC machine would fail to properly set the list_events bool
    and would therefore print out the usage information and
    terminate.

    This patch makes OPT_BOOLEAN work as expected with a bool
    datatype. For cases where the original OPT_BOOLEAN was
    intentionally being used to increment an int each time it was
    passed in on the command line, this patch introduces OPT_INCR
    with the old behaviour of OPT_BOOLEAN (the verbose variable is
    currently the only such example of this).

    I have reviewed every use of OPT_BOOLEAN to verify that a true
    C99 bool was passed. Where integers were used, I verified that
    they were only being used for boolean logic and changed them to
    bools to ensure that they would not be mistakenly used as ints.
    The major exception was the verbose variable which now uses
    OPT_INCR instead of OPT_BOOLEAN.

    Signed-off-by: Ian Munsie
    Acked-by: David S. Miller
    Cc: # NOTE: wont apply to .3[34].x cleanly, please backport
    Cc: Git development list
    Cc: Ian Munsie
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: KOSAKI Motohiro
    Cc: Hitoshi Mitake
    Cc: Rusty Russell
    Cc: Frederic Weisbecker
    Cc: Eric B Munson
    Cc: Valdis.Kletnieks@vt.edu
    Cc: WANG Cong
    Cc: Thiago Farina
    Cc: Masami Hiramatsu
    Cc: Xiao Guangrong
    Cc: Jaswinder Singh Rajput
    Cc: Arjan van de Ven
    Cc: OGAWA Hirofumi
    Cc: Mike Galbraith
    Cc: Tom Zanussi
    Cc: Anton Blanchard
    Cc: John Kacur
    Cc: Li Zefan
    Cc: Steven Rostedt
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Ian Munsie