16 Jan, 2012

1 commit

  • * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (39 commits)
    perf tools: Fix compile error on x86_64 Ubuntu
    perf report: Fix --stdio output alignment when --showcpuutilization used
    perf annotate: Get rid of field_sep check
    perf annotate: Fix usage string
    perf kmem: Fix a memory leak
    perf kmem: Add missing closedir() calls
    perf top: Add error message for EMFILE
    perf test: Change type of '-v' option to INCR
    perf script: Add missing closedir() calls
    tracing: Fix compile error when static ftrace is enabled
    recordmcount: Fix handling of elf64 big-endian objects.
    perf tools: Add const.h to MANIFEST to make perf-tar-src-pkg work again
    perf tools: Add support for guest/host-only profiling
    perf kvm: Do guest-only counting by default
    perf top: Don't update total_period on process_sample
    perf hists: Stop using 'self' for struct hist_entry
    perf hists: Rename total_session to total_period
    x86: Add counter when debug stack is used with interrupts enabled
    x86: Allow NMIs to hit breakpoints in i386
    x86: Keep current stack in NMI breakpoints
    ...

    Linus Torvalds
     

11 Jan, 2012

1 commit


08 Jan, 2012

9 commits

  • The ctype.h include is not needed here and it breaks build on some systems (at
    least 64bit Ubuntu 10.04) like below. Just get rid of it.

    CC util/trace-event-info.o
    cc1: warnings being treated as errors
    util/trace-event-info.c: In function ‘record_file’:
    util/trace-event-info.c:192: error: implicit declaration of function ‘pwrite’
    util/trace-event-info.c:192: error: nested extern declaration of ‘pwrite’
    make: *** [util/trace-event-info.o] Error 1

    Cc: Ingo Molnar
    Cc: Joerg Roedel
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1326035430-7621-1-git-send-email-namhyung@gmail.com
    Signed-off-by: Namhyung Kim
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Current perf report output is broken if --showcpuutilization is used.
    Combination with -n and/or --show-total-period make things worse.
    This patch fixes it as follows:

    before:
    48.25% 48.25% 0.00% sleep [kernel.kallsyms] [k] trace_hardirqs_off
    34.99% 34.99% 0.00% sleep [kernel.kallsyms] [k] __find_get_block_slow
    15.99% 15.99% 0.00% sleep [kernel.kallsyms] [k] lock_release_holdtime
    0.77% 0.77% 0.00% sleep [kernel.kallsyms] [k] native_write_msr_safe

    after:
    48.25% 48.25% 0.00% sleep [kernel.kallsyms] [k] trace_hardirqs_off
    34.99% 34.99% 0.00% sleep [kernel.kallsyms] [k] __find_get_block_slow
    15.99% 15.99% 0.00% sleep [kernel.kallsyms] [k] lock_release_holdtime
    0.77% 0.77% 0.00% sleep [kernel.kallsyms] [k] native_write_msr_safe

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

    Namhyung Kim
     
  • The 'field_sep' variable is not set anywhere. Just remove the
    conditional.

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

    Namhyung Kim
     
  • The annotate command doesn't take non-option arguments.

    In fact, it can take last argument as a symbol filter though, but that's
    a special case and, IMHO, it should be discouraged in favor of the -s
    option.

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

    Namhyung Kim
     
  • The 'str' should be freed when sort_dimension__add() failed too.

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

    Namhyung Kim
     
  • The setup_cpunode_map() calls opendir() but misses corresponding
    closedir(). Add them.

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

    Namhyung Kim
     
  • When a user tries to open so many events, perf_event_open syscall may
    fail with EMFILE. Provide advise for that case.

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

    Namhyung Kim
     
  • The '-v' option is usually defined via OPT_INCR not _INTEGER. Follow
    the trend :).

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

    Namhyung Kim
     
  • The get_script_path() calls opendir() but misses corresponding
    closedir()'s. Add them.

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

    Namhyung Kim
     

07 Jan, 2012

7 commits

  • * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (185 commits)
    powerpc: fix compile error with 85xx/p1010rdb.c
    powerpc: fix compile error with 85xx/p1023_rds.c
    powerpc/fsl: add MSI support for the Freescale hypervisor
    arch/powerpc/sysdev/fsl_rmu.c: introduce missing kfree
    powerpc/fsl: Add support for Integrated Flash Controller
    powerpc/fsl: update compatiable on fsl 16550 uart nodes
    powerpc/85xx: fix PCI and localbus properties in p1022ds.dts
    powerpc/85xx: re-enable ePAPR byte channel driver in corenet32_smp_defconfig
    powerpc/fsl: Update defconfigs to enable some standard FSL HW features
    powerpc: Add TBI PHY node to first MDIO bus
    sbc834x: put full compat string in board match check
    powerpc/fsl-pci: Allow 64-bit PCIe devices to DMA to any memory address
    powerpc: Fix unpaired probe_hcall_entry and probe_hcall_exit
    offb: Fix setting of the pseudo-palette for >8bpp
    offb: Add palette hack for qemu "standard vga" framebuffer
    offb: Fix bug in calculating requested vram size
    powerpc/boot: Change the WARN to INFO for boot wrapper overlap message
    powerpc/44x: Fix build error on currituck platform
    powerpc/boot: Change the load address for the wrapper to fit the kernel
    powerpc/44x: Enable CRASH_DUMP for 440x
    ...

    Fix up a trivial conflict in arch/powerpc/include/asm/cputime.h due to
    the additional sparse-checking code for cputime_t.

    Linus Torvalds
     
  • Fixes:
    |make: *** No rule to make target `../../include/linux/const.h', needed by `builtin-annotate.o'. Stop.

    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1324128938-17553-1-git-send-email-sebastian@breakpoint.cc
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Arnaldo Carvalho de Melo

    Sebastian Andrzej Siewior
     
  • To restrict a counter to either host or guest mode this patch introduces
    two new event modifiers: G and H.

    With G the counter is configured in guest-only mode and with H in
    host-only mode.

    Cc: Gleb Natapov
    Cc: Ingo Molnar
    Cc: Joerg Roedel
    Cc: Peter Zijlstra
    Signed-off-by: Gleb Natapov
    Signed-off-by: Joerg Roedel
    Link: http://lkml.kernel.org/n/tip-or5aj3rghy9ngyg882z6kln9@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Joerg Roedel
     
  • Make use of exclude_guest and exlude_host in perf-kvm to do only
    guest-only counting by default.

    Cc: Gleb Natapov
    Cc: Ingo Molnar
    Cc: Joerg Roedel
    Cc: Peter Zijlstra
    Signed-off-by: Gleb Natapov
    Signed-off-by: Joerg Roedel
    [ committer note: Moved perf_{guest,host} & event_attr_init to util.c ]
    [ so as not to drag more stuff to the python binding]
    Signed-off-by: Arnaldo Carvalho de Melo

    Joerg Roedel
     
  • It will be recalculated at __hists__output_resort, to take into account
    filters possibly applied by the TUI, etc.

    Since we do the percent math only for those entries that will appear on
    the TUI instead of for _all_ the entries at decay time, updating it for
    each sample makes the entries seem to decay faster when using the
    navigation keys (since the screen will be refreshed), as we're not
    coalescing the entries that are being batched to be merged at next
    resort/decay time, but considering their periods.

    Bug introduced in 743eb86.

    Reported-by: Ingo Molnar
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-k0d0rq9a8nqtkqohov8cir72@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Stop using this python/OOP convention, doesn't really helps. Will do
    more from time to time till we get it cleaned up in all of /perf.

    Suggested-by: Thomas Gleixner
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-me4dyj6s5snh7jr8wb9gzt82@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Nowadays we do it per evsel, not per session (that may have multiple
    evsels), so rename it to avoid confusion.

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

    Arnaldo Carvalho de Melo
     

04 Jan, 2012

5 commits

  • The --host option certainly enables host-data collection.

    Cc: Avi Kivity
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Joerg Roedel
    Cc: kvm@vger.kernel.org
    Link: http://lkml.kernel.org/r/1317816084-18026-5-git-send-email-gleb@redhat.com
    Signed-off-by: Gleb Natapov
    Signed-off-by: Joerg Roedel
    Signed-off-by: Arnaldo Carvalho de Melo

    Joerg Roedel
     
  • As script_spec__delete() frees given struct script_spec it should not be
    called if we failed to allocate the struct. Also it's the only caller of
    the function, we can get rid of the function itself.

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

    Namhyung Kim
     
  • The 'buf' should be freed when symbol wasn't found too.

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

    Namhyung Kim
     
  • The get_ratio_color() returns appropriate color string based on @ratio.
    It helps reducing code duplication.

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

    Namhyung Kim
     
  • The 'size' cannot be 0 because it was set to 8 on the above line in case
    it was 0 and never changed.

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

    Namhyung Kim
     

30 Dec, 2011

1 commit


24 Dec, 2011

14 commits

  • 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
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1323969824-9711-4-git-send-email-robert.richter@amd.com
    Signed-off-by: Robert Richter
    Signed-off-by: Arnaldo Carvalho de Melo

    Robert Richter
     
  • This patch introduces the for_each_set_bit() macro and modifies feature
    implementation to use it.

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

    Robert Richter
     
  • The features HEADER_TRACE_INFO and HEADER_BUILD_ID are handled
    different when writing the feature section. All other features are
    simply disabled on failure and writing the section goes on without
    returning an error. There is no reason for these special cases. This
    patch unifies handling of the features.

    This should be ok since all features can be parsed independently.
    Offset and size of a feature's block is stored in struct perf_file_
    section right after the data block of perf.data (see perf_session__
    write_header()). Thus, if a feature does not exist then other features
    can be processed anyway.

    Also moving special code for HEADER_BUILD_ID out to write_build_id().

    v2:
    * perf record throws an error now if buildids may not be generated,
    which can be disabled with the --no-buildid option.

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

    Robert Richter
     
  • 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
     
  • Needed for later changes. No modified functionality.

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

    Robert Richter
     
  • If filename is NULL there is an out-of-bound access to struct
    perf_session if it would be used with perf_session__open(). Shouldn't
    actually happen in current implementation as filename is always !NULL.
    Fixing this by always null-terminating filename.

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

    Robert Richter
     
  • A feature may be unknown if perf.data is created and parsed on different
    perf tool versions. This should not stop the header to be processed,
    instead continue processing it.

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

    Robert Richter
     
  • Reducing duplication and line size by extending function names for
    print and write from a single name.

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

    Robert Richter
     
  • Now that we automatically point users at it, let's provide them some
    guidance so that they hopefully don't just get mysterious EINVAL's
    from the kernel.

    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1324301972-22740-4-git-send-email-nelhage@nelhage.com
    Signed-off-by: Nelson Elhage
    [ committer note: Made it work after 50a682c ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Nelson Elhage
     
  • This failure is most likely due to running up against the
    kernel.perf_event_mlock_kb sysctl, so we can tell the user what to do to
    fix the issue.

    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1324301972-22740-3-git-send-email-nelhage@nelhage.com
    Signed-off-by: Nelson Elhage
    Signed-off-by: Arnaldo Carvalho de Melo

    Nelson Elhage
     
  • I get such truncated annotation results in 'perf top':

    : Disassembly of section .text: ▒
    : ▒
    : ffffffff810966a8 : ▒
    4.94 : ffffffff810966a8: movslq %edi,%rdi ▒
    3.70 : ffffffff810966ab: mov $0x13700,%rax ▒
    0.00 : ffffffff810966b2: add -0x7e32cb00(,%rdi,8),%rax ▒
    8.64 : ffffffff810966ba: mov 0x7e0(%rax),%eax ▒
    82.72 : ffffffff810966c0: cltq ▒

    Note the missing 'retq' which is there in the original function:

    ffffffff810966a8 :
    ffffffff810966a8: 48 63 ff movslq %edi,%rdi
    ffffffff810966ab: 48 c7 c0 00 37 01 00 mov $0x13700,%rax
    ffffffff810966b2: 48 03 04 fd 00 35 cd add -0x7e32cb00(,%rdi,8),%rax
    ffffffff810966b9: 81
    ffffffff810966ba: 8b 80 e0 07 00 00 mov 0x7e0(%rax),%eax
    ffffffff810966c0: 48 98 cltq
    ffffffff810966c2: c3 retq

    ffffffff810966c3 :

    I'm using a fairly recent binutils:

    GNU objdump version 2.21.51.0.6-2.fc16 20110118

    AFAICS the bug is simply that sym->end points to the last byte
    of the symbol in question - while objdump's --stop-address
    expects the last byte plus 1 to disassemble the full range.

    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20111223130804.GA24305@elte.hu
    Signed-off-by: Ingo Molnar
    Signed-off-by: Arnaldo Carvalho de Melo

    Ingo Molnar
     
  • This allows the thread name to be dispalyed when dumping
    events:
    myapp 25118 [000] 450385.538815: context-switches ...
    myapp:worker 25119 [000] 450385.538894: context-switches ...

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1324578603-12762-4-git-send-email-dsahern@gmail.com
    Signed-off-by: David Ahern
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • This handles multithreaded processes with named threads when doing
    system wide profiling: the comm for each thread is looked up allowing
    them to be different from the thread group leader.

    v2:
    - fixed sizeof arg to perf_event__get_comm_tgid

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1324578603-12762-3-git-send-email-dsahern@gmail.com
    Signed-off-by: David Ahern
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • perf does not properly handle monitoring of processes with named threads.
    For example:

    $ ps -C myapp -L
    PID LWP TTY TIME CMD
    25118 25118 ? 00:00:00 myapp
    25118 25119 ? 00:00:00 myapp:worker

    perf record -e cs -c 1 -fo /tmp/perf.data -p 25118 -- sleep 10
    perf report --stdio -i /tmp/perf.data
    100.00% myapp:worker [kernel.kallsyms] [k] perf_event_task_sched_out

    The process name is set to the name of the last thread it finds for the
    process.

    The Problem:
    perf-top and perf-record both create a thread_map of threads to be
    monitored. That map is used in perf_event__synthesize_thread_map which
    loops over the entries in thread_map and calls __event__synthesize_thread
    to generate COMM and MMAP events.

    __event__synthesize_thread calls perf_event__synthesize_comm which opens
    /proc/pid/status, reads the name of the task and its thread group id.
    That's all fine. The problem is that it then reads /proc/pid/task and
    generates COMM events for each task it finds - but using the name found
    in /proc/pid/status where pid is the thread of interest.

    The end result (looping over thread_map + synthesizing comm events for
    each thread each time) means the name of the last thread processed sets
    the name for all threads in the process - which is not good for
    multithreaded processes with named threads.

    The Fix:
    perf_event__synthesize_comm has an input argument (full) that decides
    whether to process task entries for each pid it is passed. It currently
    never set to 0 (perf_event__synthesize_comm has a single caller and it
    always passes the value 1). Let's fix that.

    Add the full input argument to __event__synthesize_thread which passes
    it to perf_event__synthesize_comm. For thread/process monitoring set full
    to 0 which means COMM and MMAP events are only generated for the pid
    passed to it. For system wide monitoring set full to 1 so that COMM events
    are generated for all threads in a process.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1324578603-12762-2-git-send-email-dsahern@gmail.com
    Signed-off-by: David Ahern
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     

22 Dec, 2011

1 commit

  • perf report does not take a command from command line.

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

    Namhyung Kim
     

21 Dec, 2011

1 commit