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
     

12 Dec, 2015

1 commit


24 Jul, 2015

1 commit

  • As it is not used anymore, since 'perf script' switched to asking
    libtraceevent to use tools/perf's symbol resolution routines.

    Acked-by: David Ahern
    Cc: Adrian Hunter
    Cc: Borislav Petkov
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Stephane Eranian
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/n/tip-4ilhofz4b7o8yokvutjt9yzz@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

27 May, 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
     

18 Feb, 2014

1 commit

  • Properly destroying trace_seq object.

    Signed-off-by: Jiri Olsa
    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
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/1391377150-23920-2-git-send-email-jolsa@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

05 Dec, 2013

1 commit

  • 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
     

20 Sep, 2013

1 commit

  • Old GCC (4.1) does not see through the code flow of parse_proc_kallsyms()
    and gets confused about the status of 'fmt':

    util/trace-event-parse.c: In function ‘parse_proc_kallsyms’:
    util/trace-event-parse.c:189: warning: ‘fmt’ may be used uninitialized in this function
    make: *** [util/trace-event-parse.o] Error 1

    Help out GCC by initializing 'fmt' to NULL.

    Signed-off-by: Ingo Molnar
    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: H. Peter Anvin
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/20130912131649.GC23826@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Ingo Molnar
     

13 Jul, 2013

2 commits

  • 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
     

16 Mar, 2013

1 commit


24 Sep, 2012

1 commit

  • perf uses sscanf extension %as to read and allocate a string in the same
    step. This is a non-standard extension only present in new versions of
    glibc.

    Replacing the use of sscanf and %as with strtok_r calls in order to
    parse a given string into its components. This is needed in Android
    since bionic does not support
    %as extension for sscanf.

    Reviewed-by: Masami Hiramatsu
    Tested-by: Masami Hiramatsu
    Signed-off-by: Irina Tirdea
    Acked-by: Masami Hiramatsu
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Masami Hiramatsu
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/1348173470-4936-1-git-send-email-irina.tirdea@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Irina Tirdea
     

11 Sep, 2012

1 commit

  • 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: Irina Tirdea
    Acked-by: Pekka Enberg
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/1347315303-29906-7-git-send-email-irina.tirdea@intel.com
    [ committer note: fixed up conflict with a116e05 in builtin-sched.c ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Irina Tirdea
     

14 Aug, 2012

1 commit

  • If 'perf script --gen-script' was called with a perf.data which contains
    no tracepoint event, it'd segfault due to NULL pevent pointer. Fix it.

    Signed-off-by: Namhyung Kim
    Cc: Feng Tang
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1344909423-26384-1-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

08 Aug, 2012

2 commits

  • 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
     

18 Jul, 2012

1 commit


02 Jul, 2012

1 commit

  • Consider the commands:
    perf record -e sched:sched_switch -fo /tmp/perf.data -a -- sleep 1
    perf script -i /tmp/perf.data

    In v3.4 the output has the form (lines wrapped here)
    perf 29214 [005] 821043.582596: sched_switch:
    prev_comm=perf prev_pid=29214 prev_prio=120
    prev_state=S ==> next_comm=swapper/5 next_pid=0 next_prio=120

    In 3.5 that same line has become:
    perf 29214 [005] 821043.582596: sched_switch:
    -29214 [005] 0.000000000: sched_switch:
    prev_comm=perf prev_pid=29214 prev_prio=120
    prev_state=S ==> next_comm=swapper/5 next_pid=0 next_prio=120

    Note the duplicates in the output -- pid, cpu, event name. With
    this patch the v3.4 output is restored:
    perf 29214 [005] 821043.582596: sched_switch:
    prev_comm=perf prev_pid=29214 prev_prio=120
    prev_state=S ==> next_comm=swapper/5 next_pid=0 next_prio=120

    v3:
    Remove that pesky newline too. Output now matches v3.4 (pre-libtracevent).

    v2:
    Change print_trace_event function local to perf per Steve's comments.

    Signed-off-by: David Ahern
    Acked-by: Steven Rostedt
    Cc: Frederic Weisbecker
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/1339698977-68962-1-git-send-email-dsahern@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     

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

4 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
     
  • 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: 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
     

23 Mar, 2012

1 commit


18 Feb, 2012

1 commit

  • The __print_symbolic() function takes a sequence of key-value pairs for
    pretty-printing a constant. The new kvm:kvm_exit print fmt uses the
    expression:

    __print_symbolic(..., { 0x040 + 1, "DB excp" }, ...)

    Currently only atoms are supported and this print fmt fails to parse.
    This patch adds support for expressions instead of just atoms so that
    0x040 + 1 is parsed successfully. Also add arg_num_eval() support for
    the '+' operator.

    Acked-by: Steven Rostedt
    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/1315148939-14313-1-git-send-email-stefanha@linux.vnet.ibm.com
    Signed-off-by: Stefan Hajnoczi
    Signed-off-by: Arnaldo Carvalho de Melo

    Stefan Hajnoczi
     

31 Jan, 2012

1 commit

  • There are unnecessary #include out there, and they might cause
    a nasty build failure in some environment. As we already have most of
    ctype macros in util.h, just get rid of them.

    A few of exceptions are util/symbol.c which needs isupper() macro util.h
    doesn't provide and perl scripting support code which includes ctype.h
    internally.

    Suggested-by: Ingo Molnar
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1327827356-8786-4-git-send-email-namhyung@gmail.com
    Signed-off-by: Namhyung Kim
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

25 Jan, 2012

1 commit

  • When building on my Debian/mips system, util/util.c fails to build
    because commit 1aed2671738785e8f5aea663a6fda91aa7ef59b5 (perf kvm: Do
    guest-only counting by default) indirectly includes stdio.h before the
    feature selection in util.h is done. This prevents _GNU_SOURCE in
    util.h from enabling the declaration of getline(), from now second
    inclusion of stdio.h, and the build is broken.

    There is another breakage in util/evsel.c caused by include ordering,
    but I didn't fully track down the commit that caused it.

    The root cause of all this is an inconsistent definition of _GNU_SOURCE,
    so I move the definition into the Makefile so that it is passed to all
    invocations of the compiler and used uniformly for all system header
    files. All other #define and #undef of _GNU_SOURCE are removed as they
    cause conflicts with the definition passed to the compiler.

    All the features.h definitions (_LARGEFILE64_SOURCE _FILE_OFFSET_BITS=64
    and _GNU_SOURCE) are needed by the python glue code too, so they are
    moved to BASIC_CFLAGS, and the misleading comments about BASIC_CFLAGS
    are removed.

    This gives me a clean build on x86_64 (fc12) and mips (Debian).

    Cc: David Daney
    Cc: Ingo Molnar
    Cc: Joerg Roedel
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1326836461-11952-1-git-send-email-ddaney.cavm@gmail.com
    Signed-off-by: David Daney
    Signed-off-by: Arnaldo Carvalho de Melo

    David Daney
     

08 Nov, 2011

1 commit

  • A update is made to the sched:sched_switch event that adds some
    logic to the first parameter of the __print_flags() that shows the
    state of tasks. This change cause perf to fail parsing the flags.

    A simple fix is needed to have the parser be able to process ops
    within the argument.

    Cc: stable@vger.kernel.org
    Reported-by: Andrew Vagin
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     

15 Jun, 2011

1 commit

  • Commit a26ac2455ffcf3(rcu: move TREE_RCU from softirq to kthread)
    introduced performance regression. In an AIM7 test, this commit degraded
    performance by about 40%.

    The commit runs rcu callbacks in a kthread instead of softirq. We observed
    high rate of context switch which is caused by this. Out test system has
    64 CPUs and HZ is 1000, so we saw more than 64k context switch per second
    which is caused by RCU's per-CPU kthread. A trace showed that most of
    the time the RCU per-CPU kthread doesn't actually handle any callbacks,
    but instead just does a very small amount of work handling grace periods.
    This means that RCU's per-CPU kthreads are making the scheduler do quite
    a bit of work in order to allow a very small amount of RCU-related
    processing to be done.

    Alex Shi's analysis determined that this slowdown is due to lock
    contention within the scheduler. Unfortunately, as Peter Zijlstra points
    out, the scheduler's real-time semantics require global action, which
    means that this contention is inherent in real-time scheduling. (Yes,
    perhaps someone will come up with a workaround -- otherwise, -rt is not
    going to do well on large SMP systems -- but this patch will work around
    this issue in the meantime. And "the meantime" might well be forever.)

    This patch therefore re-introduces softirq processing to RCU, but only
    for core RCU work. RCU callbacks are still executed in kthread context,
    so that only a small amount of RCU work runs in softirq context in the
    common case. This should minimize ksoftirqd execution, allowing us to
    skip boosting of ksoftirqd for CONFIG_RCU_BOOST=y kernels.

    Signed-off-by: Shaohua Li
    Tested-by: "Alex,Shi"
    Signed-off-by: Paul E. McKenney

    Shaohua Li
     

06 May, 2011

1 commit

  • If RCU priority boosting is to be meaningful, callback invocation must
    be boosted in addition to preempted RCU readers. Otherwise, in presence
    of CPU real-time threads, the grace period ends, but the callbacks don't
    get invoked. If the callbacks don't get invoked, the associated memory
    doesn't get freed, so the system is still subject to OOM.

    But it is not reasonable to priority-boost RCU_SOFTIRQ, so this commit
    moves the callback invocations to a kthread, which can be boosted easily.

    Also add comments and properly synchronized all accesses to
    rcu_cpu_kthread_task, as suggested by Lai Jiangshan.

    Signed-off-by: Paul E. McKenney
    Signed-off-by: Paul E. McKenney
    Reviewed-by: Josh Triplett

    Paul E. McKenney
     

15 Mar, 2011

2 commits


07 Feb, 2011

1 commit

  • 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
    LKML-Reference:
    Signed-off-by: Kyle McMartin
    [ committer note: Fixed up the annotation fixes, as that code moved recently ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Kyle McMartin
     

18 May, 2010

1 commit

  • …git/tip/linux-2.6-tip

    * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (311 commits)
    perf tools: Add mode to build without newt support
    perf symbols: symbol inconsistency message should be done only at verbose=1
    perf tui: Add explicit -lslang option
    perf options: Type check all the remaining OPT_ variants
    perf options: Type check OPT_BOOLEAN and fix the offenders
    perf options: Check v type in OPT_U?INTEGER
    perf options: Introduce OPT_UINTEGER
    perf tui: Add workaround for slang < 2.1.4
    perf record: Fix bug mismatch with -c option definition
    perf options: Introduce OPT_U64
    perf tui: Add help window to show key associations
    perf tui: Make <- exit menus too
    perf newt: Add single key shortcuts for zoom into DSO and threads
    perf newt: Exit browser unconditionally when CTRL+C, q or Q is pressed
    perf newt: Fix the 'A'/'a' shortcut for annotate
    perf newt: Make <- exit the ui_browser
    x86, perf: P4 PMU - fix counters management logic
    perf newt: Make <- zoom out filters
    perf report: Report number of events, not samples
    perf hist: Clarify events_stats fields usage
    ...

    Fix up trivial conflicts in kernel/fork.c and tools/perf/builtin-record.c

    Linus Torvalds
     

11 May, 2010

1 commit

  • The raw_field_ptr() helper, used to retrieve the address of a field
    inside a trace event, treats every strings as if they were dynamic
    ie: having a secondary level of indirection to retrieve their
    contents.

    FIELD_IS_STRING doesn't mean FIELD_IS_DYNAMIC, we only need to
    compute the secondary dereference for the latter case.

    This fixes perf sched segfaults, bad cmdline report and may be
    some other bugs.

    Reported-by: Jason Baron
    Reported-by: Arnaldo Carvalho de Melo
    Signed-off-by: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Tom Zanussi

    Frederic Weisbecker
     

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
     

15 Apr, 2010

1 commit

  • Checking if a tracing field is an array with a dynamic length
    requires to check the field type and seek the "__data_loc"
    string that prepends the actual type, as can be found in a trace
    event format file:

    field:__data_loc char[] name; offset:16; size:4; signed:1;

    But we actually use strcmp() to check if the field type fully
    matches "__data_loc", which may fail as we trip over the rest of
    the type.

    To fix this, use strncmp to only check if it starts with
    "__data_loc".

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Frederic Weisbecker
    Cc: Arnaldo Carvalho de Melo
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Tom Zanussi
    Cc: Steven Rostedt
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     

14 Apr, 2010

1 commit

  • 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
     

08 Apr, 2010

1 commit

  • That is not used in perf where we have the LOST events.

    Without this patch we get:

    [root@doppio ~]# perf lock report | head -3
    Warning: Error: expected 'data' but read 'overwrite'

    So, to make the same perf command work with kernels with and without
    this field, introduce variants for the parsing routines to not warn the
    user in such case.

    Discussed-with: Steven Rostedt
    Cc: Frédéric Weisbecker
    Cc: Hitoshi Mitake
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo