02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

20 Apr, 2017

3 commits


27 Mar, 2017

1 commit

  • We got it from the git sources but never used it for anything, with the
    place where this would be somehow used remaining:

    static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
    {
    prefix = NULL;
    if (p->option & RUN_SETUP)
    prefix = NULL; /* setup_perf_directory(); */

    Ditch it.

    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-uw5swz05vol0qpr32c5lpvus@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

17 Mar, 2017

2 commits

  • All options need the -f/--force option, so move it to the array
    referenced via OPT_PARENT.

    Cc: Adrian Hunter
    Cc: Changbin Du
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-unbeionpi58rioh4e9w8kp4n@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • When I use -i option for report subcommand, it doesn't accept it. We
    need add common options using OPT_PARENT macro.

    perf lock report -i lock_perf.data
    Error: unknown switch `i'

    Usage: perf lock report []

    -f, --force don't complain, do it
    -k, --key key for sorting ...

    Signed-off-by: Changbin Du
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20170317055342.8284-1-changbin.du@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Changbin Du
     

14 Mar, 2017

1 commit

  • Introduce a new option to record PERF_RECORD_NAMESPACES events emitted
    by the kernel when fork, clone, setns or unshare are invoked. And update
    perf-record documentation with the new option to record namespace
    events.

    Committer notes:

    Combined it with a later patch to allow printing it via 'perf report -D'
    and be able to test the feature introduced in this patch. Had to move
    here also perf_ns__name(), that was introduced in another later patch.

    Also used PRIu64 and PRIx64 to fix the build in some enfironments wrt:

    util/event.c:1129:39: error: format '%lx' expects argument of type 'long unsigned int', but argument 6 has type 'long long unsigned int' [-Werror=format=]
    ret += fprintf(fp, "%u/%s: %lu/0x%lx%s", idx
    ^
    Testing it:

    # perf record --namespaces -a
    ^C[ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 1.083 MB perf.data (423 samples) ]
    #
    # perf report -D

    3 2028902078892 0x115140 [0xa0]: PERF_RECORD_NAMESPACES 14783/14783 - nr_namespaces: 7
    [0/net: 3/0xf0000081, 1/uts: 3/0xeffffffe, 2/ipc: 3/0xefffffff, 3/pid: 3/0xeffffffc,
    4/user: 3/0xeffffffd, 5/mnt: 3/0xf0000000, 6/cgroup: 3/0xeffffffb]

    0x1151e0 [0x30]: event: 9
    .
    . ... raw event: size 48 bytes
    . 0000: 09 00 00 00 02 00 30 00 c4 71 82 68 0c 7f 00 00 ......0..q.h....
    . 0010: a9 39 00 00 a9 39 00 00 94 28 fe 63 d8 01 00 00 .9...9...(.c....
    . 0020: 03 00 00 00 00 00 00 00 ce c4 02 00 00 00 00 00 ................

    NAMESPACES events: 1

    #

    Signed-off-by: Hari Bathini
    Acked-by: Jiri Olsa
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Alexander Shishkin
    Cc: Alexei Starovoitov
    Cc: Ananth N Mavinakayanahalli
    Cc: Aravinda Prasad
    Cc: Brendan Gregg
    Cc: Daniel Borkmann
    Cc: Eric Biederman
    Cc: Peter Zijlstra
    Cc: Sargun Dhillon
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/148891930386.25309.18412039920746995488.stgit@hbathini.in.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Hari Bathini
     

18 Dec, 2015

1 commit

  • Move the subcommand-related files from perf to a new library named
    libsubcmd.a.

    Since we're moving files anyway, go ahead and rename 'exec_cmd.*' to
    'exec-cmd.*' to be consistent with the naming of all the other files.

    Signed-off-by: Josh Poimboeuf
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/c0a838d4c878ab17fee50998811612b2281355c1.1450193761.git.jpoimboe@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Josh Poimboeuf
     

09 May, 2015

1 commit

  • In addition to using refcounts for the struct thread lifetime
    management, we need to protect access to machine->threads from
    concurrent access.

    That happens in 'perf top', where a thread processes events, inserting
    and deleting entries from that rb_tree while another thread decays
    hist_entries, that end up dropping references and ultimately deleting
    threads from the rb_tree and releasing its resources when no further
    hist_entry (or other data structures, like in 'perf sched') references
    it.

    So the rule is the same for refcounts + protected trees in the kernel,
    get the tree lock, find object, bump the refcount, drop the tree lock,
    return, use object, drop the refcount if no more use of it is needed,
    keep it if storing it in some other data structure, drop when releasing
    that data structure.

    I.e. pair "t = machine__find(new)_thread()" with a "thread__put(t)", and
    "perf_event__preprocess_sample(&al)" with "addr_location__put(&al)".

    The addr_location__put() one is because as we return references to
    several data structures, we may end up adding more reference counting
    for the other data structures and then we'll drop it at
    addr_location__put() time.

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

    Arnaldo Carvalho de Melo
     

03 Apr, 2015

1 commit

  • Enable perf lock to use perf.data when it is not owned by current user
    or root.

    Example:

    # perf lock record ls
    # chown Yunlong.Song:Yunlong.Song perf.data
    # ls -al perf.data
    -rw------- 1 Yunlong.Song Yunlong.Song 4880686 Apr 2 14:14 perf.data
    # id
    uid=0(root) gid=0(root) groups=0(root),64(pkcs11)

    Before this patch:

    # perf lock report
    File perf.data not owned by current user or root (use -f to override)
    Initializing perf session failed
    # perf lock report -f
    Error: unknown switch `f'

    usage: perf lock report []

    -k, --key key for sorting (acquired / contended /
    avg_wait / wait_total / wait_max / wait_min)

    As shown above, the -f option does not work at all.

    After this patch:

    # perf lock report
    File perf.data not owned by current user or root (use -f to override)
    Initializing perf session failed
    # perf lock report -f
    Name acquired contended avg wait (ns) total wait (ns) ...

    &ldata->output_l... 128 0 0 0 ...
    &ctx->lock 114 0 0 0 ...
    &p->pi_lock 112 0 0 0 ...
    &(&pool->lock)->... 112 0 0 0 ...
    &(&dentry->d_loc... 70 0 0 0 ...
    &(&newf->file_lo... 62 0 0 0 ...
    &(&fs->lock)->rl... 43 0 0 0 ...
    ...

    As shown above, the -f option really works now.

    Signed-off-by: Yunlong Song
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/1427982439-27388-6-git-send-email-yunlong.song@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Yunlong Song
     

11 Mar, 2015

1 commit

  • By keeping pointers to machines, evlist and tool in ordered_events.

    Cc: Adrian Hunter
    Cc: Borislav Petkov
    Cc: David Ahern
    Cc: Don Zickus
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-0c6huyaf59mqtm2ek9pmposl@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

26 Sep, 2014

1 commit

  • Because perf_session__new() can fail for more reasons than just ENOMEM,
    modify error code(ENOMEM or EINVAL) to -1.

    Signed-off-by: Taeung Song
    Acked-by: Jiri Olsa
    Acked-by: Namhyung Kim
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Link: http://lkml.kernel.org/r/1411522417-9917-1-git-send-email-treeze.taeung@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Taeung Song
     

14 Aug, 2014

2 commits

  • Currently vmlinux_path__init() only tries to find vmlinux file from
    current directory, /boot and some canonical directories with version
    number of the running kernel. This can be a problem when reporting old
    data recorded on a kernel version not running currently.

    We can use --symfs option for this but it's annoying for user to do it
    always. As we already have the info in the perf.data file, it can be
    changed to use it for the search automatically.

    Before:

    $ perf report
    ...
    # Samples: 4K of event 'cpu-clock'
    # Event count (approx.): 1067250000
    #
    # Overhead Command Shared Object Symbol
    # ........ .......... ................. ..............................
    71.87% swapper [kernel.kallsyms] [k] recover_probed_instruction

    After:

    # Overhead Command Shared Object Symbol
    # ........ .......... ................. ....................
    71.87% swapper [kernel.kallsyms] [k] native_safe_halt

    This requires to change signature of symbol__init() to receive struct
    perf_session_env *.

    Reported-by: Minchan Kim
    Signed-off-by: Namhyung Kim
    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Masami Hiramatsu
    Cc: Minchan Kim
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1407825645-24586-14-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • This is a preparation of fixing dso__load_kernel_sym(). It needs a
    session info before calling symbol__init().

    Signed-off-by: Namhyung Kim
    Acked-by: Jiri Olsa
    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Minchan Kim
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1407825645-24586-9-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

12 Aug, 2014

1 commit

  • The time ordering is generic for all kinds of events, so using generic
    name 'ordered_events' for ordered_samples bool in perf_tool struct.

    No functional change was intended.

    Signed-off-by: Jiri Olsa
    Acked-by: David Ahern
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jean Pihet
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/n/tip-07mrqzcuhsks9wfmxrzsvemz@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

16 Apr, 2014

1 commit


07 Nov, 2013

1 commit

  • Not needed since this cset:

    fcf65bf149af: perf evsel: Cache associated event_format

    So lets trim this struct a bit.

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

    Arnaldo Carvalho de Melo
     

04 Nov, 2013

1 commit

  • As the thread comm is going to be implemented by way of a more
    complicated data structure than just a pointer to a string from the
    thread struct, convert the readers of comm to use an accessor instead of
    accessing it directly.

    The accessor will be later overriden to support an enhanced comm
    implementation.

    Signed-off-by: Frederic Weisbecker
    Tested-by: Jiri Olsa
    Cc: Jiri Olsa
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-wr683zwy94hmj4ibogmnv9ce@git.kernel.org
    [ Rename thread__comm_curr() to thread__comm_str() ]
    Signed-off-by: Namhyung Kim
    [ Fixed up some minor const pointer issues ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Frederic Weisbecker
     

22 Oct, 2013

1 commit

  • This patch is adding 'struct perf_data_file' object as a placeholder for
    all attributes regarding perf.data file handling. Changing
    perf_session__new to take it as an argument.

    The rest of the functionality will be added later to keep this change
    simple enough, because all the places using perf_session are changed
    now.

    Signed-off-by: Jiri Olsa
    Acked-by: Namhyung Kim
    Cc: Adrian Hunter
    Cc: Andi Kleen
    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/1381847254-28809-2-git-send-email-jolsa@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

09 Oct, 2013

6 commits

  • While perf-lock currently reports both the total wait time and the
    number of contentions, it doesn't explicitly show the average wait time.
    Having this value immediately in the report can be quite useful when
    looking into performance issues.

    Furthermore, allowing report to sort by averages is another handy
    feature to have - and thus do not only print the value, but add it to
    the lock_stat structure.

    Signed-off-by: Davidlohr Bueso
    Cc: Aswin Chandramouleeswaran
    Cc: Frederic Weisbecker
    Cc: Hitoshi Mitake
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1378693159-8747-8-git-send-email-davidlohr@hp.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Davidlohr Bueso
     
  • Two decimal precision should be enough for this.

    Signed-off-by: Davidlohr Bueso
    Cc: Aswin Chandramouleeswaran
    Cc: Frederic Weisbecker
    Cc: Hitoshi Mitake
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1378693159-8747-7-git-send-email-davidlohr@hp.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Davidlohr Bueso
     
  • This function should be straightforward, and we can remove some trivial
    logic by moving the functionality of read_events() into __cmd_report() -
    thus allowing a new session to be properly deleted.

    Since the 'info' subcommand also needs to process the recorded events,
    add a 'display_info' flag to differentiate between report and info
    commands.

    Furthermore, this patch also calls perf_session__has_traces(), making
    sure that we don't compare apples and oranges, fixing a segfault when
    using an perf.data file generated by a different subcommand. ie:

    ./perf mem record sleep 1
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.017 MB perf.data (~724 samples) ]

    ./perf lock report
    Segmentation fault (core dumped)

    Signed-off-by: Davidlohr Bueso
    Cc: Aswin Chandramouleeswaran
    Cc: Frederic Weisbecker
    Cc: Hitoshi Mitake
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1378693159-8747-5-git-send-email-davidlohr@hp.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Davidlohr Bueso
     
  • Address some trivial leaks.

    Signed-off-by: Davidlohr Bueso
    Cc: Aswin Chandramouleeswaran
    Cc: Frederic Weisbecker
    Cc: Hitoshi Mitake
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1378693159-8747-4-git-send-email-davidlohr@hp.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Davidlohr Bueso
     
  • The report_lock_*_event() functions return -1 when lock_stat_findnew(),
    thread_stat_findnew() or get_seq() return NULL. These functions only
    return this value when failing to allocate memory, this return -ENOMEM
    instead.

    Signed-off-by: Davidlohr Bueso
    Cc: Aswin Chandramouleeswaran
    Cc: Frederic Weisbecker
    Cc: Hitoshi Mitake
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1378693159-8747-3-git-send-email-davidlohr@hp.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Davidlohr Bueso
     
  • No need for break statements after goto jumps.

    Signed-off-by: Davidlohr Bueso
    Cc: Aswin Chandramouleeswaran
    Cc: Frederic Weisbecker
    Cc: Hitoshi Mitake
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1378693159-8747-2-git-send-email-davidlohr@hp.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Davidlohr Bueso
     

29 Aug, 2013

1 commit

  • Add a new parameter for 'pid' to machine__findnew_thread().
    Change callers to pass 'pid' when it is known.

    Note that callers sometimes want to find the main thread
    which has the memory maps. The main thread has tid == pid
    so the usage in that case is:

    machine__findnew_thread(machine, pid, pid)

    whereas the usage to find the specific thread is:

    machine__findnew_thread(machine, pid, tid)

    Signed-off-by: Adrian Hunter
    Acked-by: David Ahern
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1377591794-30553-2-git-send-email-adrian.hunter@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Adrian Hunter
     

09 Jul, 2013

1 commit

  • It no longer have any affect on the processing and is marked as obsolete
    anyway.

    Signed-off-by: Jiri Olsa
    Cc: Andi Kleen
    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/n/tip-tvwyspiqr4getzfib2lw06ty@git.kernel.org
    Link: http://lkml.kernel.org/r/1372307120-737-1-git-send-email-namhyung@kernel.org
    [ combined patch removing the -f usage in various sub-commands, such as 'perf sched', etc, by Namhyung Kim ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

29 Oct, 2012

1 commit

  • Currently many perf commands annotate/evlist/report/script/lock etc all
    support "-i" option to chose a specific perf data, and all of them
    create a local "input_name" to save the file name for that perf data.

    Since most of these commands need it, we can add a global variable for
    it, also it can some other benefits:

    1. When calling script browser inside hists/annotation browser, it needs
    to know the perf data file name to run that script.

    2. For further feature like runtime switching to another perf data file,
    this variable can also help.

    Signed-off-by: Feng Tang
    Cc: Andi Kleen
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1351569369-26732-2-git-send-email-feng.tang@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Feng Tang
     

03 Oct, 2012

1 commit

  • Some variables were global but used in just one function, so move it to
    where it belongs.

    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-fx8sqc6r9u0i1u97ruy5ytjv@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

24 Sep, 2012

1 commit

  • Following the model of 'perf sched':

    . raw_field_value searches first on the common fields, that are unused
    in this tool

    . Leave using perf_evsel__intval to the actual handlers, some may not
    need to incur some of the cost because they may not need all the
    fields values.

    . Using perf_session__set_tracepoints_handlers will save all those
    strcmp to find the right handler at sample processing time, do it just
    once and get the handler from evsel->handler.func.

    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-v9x3q9rv4caxtox7wtjpchq5@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

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
     

06 Sep, 2012

1 commit


10 Aug, 2012

1 commit

  • If CONFIG options required for perf-lock are not enabled then the
    corresponding tracepoints will not be enabled. Currently, the message to
    the user is:
    $ perf lock record -a -- sleep 1
    invalid or unsupported event: 'lock:lock_acquire'
    Run 'perf list' for a list of valid events

    Improve the message with a suggestion on which CONFIG options are needed:
    $ perf lock record -a -- sleep 1
    tracepoint lock:lock_acquire is not enabled. Are CONFIG_LOCKDEP and CONFIG_LOCK_STAT enabled?

    Suggested-by: Arnaldo Carvalho de Melo
    Signed-off-by: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1344530137-25521-1-git-send-email-dsahern@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     

08 Aug, 2012

2 commits

  • To reduce the number of parameters passed to the various event handling
    functions.

    Cc: Andrey Wagin
    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-bipk647rzq357yot9ao6ih73@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

1 commit

  • 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
     

31 Jan, 2012

1 commit

  • The commit 26242d859c9be ("perf lock: Add "info" subcommand for dumping
    misc information") added the subcommand but missed documentation. Add
    it. Also update stale 'trace' subcommand to 'script'.

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

    Namhyung Kim
     

24 Dec, 2011

1 commit

  • The default input file for perf report is not handled the same way as
    perf record does it for its output file. This leads to unexpected
    behavior of perf report, etc. E.g.:

    # perf record -a -e cpu-cycles sleep 2 | perf report | cat
    failed to open perf.data: No such file or directory (try 'perf record' first)

    While perf record writes to a fifo, perf report expects perf.data to be
    read. This patch changes this to accept fifos as input file.

    Applies to the following commands:

    perf annotate
    perf buildid-list
    perf evlist
    perf kmem
    perf lock
    perf report
    perf sched
    perf script
    perf timechart

    Also fixes char const* -> const char* type declaration for filename
    strings.

    v2:
    * Prevent potential null pointer access to input_name in
    builtin-report.c. Needed due to removal of patch "perf report: Setup
    browser if stdout is a pipe"

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1323248577-11268-5-git-send-email-robert.richter@amd.com
    Signed-off-by: Robert Richter
    Signed-off-by: Arnaldo Carvalho de Melo

    Robert Richter