02 Oct, 2012

6 commits

  • Pull USB changes from Greg Kroah-Hartman:
    "Here is the big USB pull request for 3.7-rc1

    There are lots of gadget driver changes (including copying a bunch of
    files into the drivers/staging/ccg/ directory so that the other gadget
    drivers can be fixed up properly without breaking that driver), and we
    remove the old obsolete ub.c driver from the tree.

    There are also the usual XHCI set of updates, and other various driver
    changes and updates. We also are trying hard to remove the old dbg()
    macro, but the final bits of that removal will be coming in through
    the networking tree before we can delete it for good.

    All of these patches have been in the linux-next tree.

    Signed-off-by: Greg Kroah-Hartman "

    Fix up several annoying - but fairly mindless - conflicts due to the
    termios structure having moved into the tty device, and often clashing
    with dbg -> dev_dbg conversion.

    * tag 'usb-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (339 commits)
    USB: ezusb: move ezusb.c from drivers/usb/serial to drivers/usb/misc
    USB: uas: fix gcc warning
    USB: uas: fix locking
    USB: Fix race condition when removing host controllers
    USB: uas: add locking
    USB: uas: fix abort
    USB: uas: remove aborted field, replace with status bit.
    USB: uas: fix task management
    USB: uas: keep track of command urbs
    xhci: Intel Panther Point BEI quirk.
    powerpc/usb: remove checking PHY_CLK_VALID for UTMI PHY
    USB: ftdi_sio: add TIAO USB Multi-Protocol Adapter (TUMPA) support
    Revert "usb : Add sysfs files to control port power."
    USB: serial: remove vizzini driver
    usb: host: xhci: Fix Null pointer dereferencing with 71c731a for non-x86 systems
    Increase XHCI suspend timeout to 16ms
    USB: ohci-at91: fix null pointer in ohci_hcd_at91_overcurrent_irq
    USB: sierra_ms: don't keep unused variable
    fsl/usb: Add support for USB controller version 2.4
    USB: qcaux: add Pantech vendor class match
    ...

    Linus Torvalds
     
  • Pull driver core merge from Greg Kroah-Hartman:
    "Here is the big driver core update for 3.7-rc1.

    A number of firmware_class.c updates (as you saw a month or so ago),
    and some hyper-v updates and some printk fixes as well. All patches
    that are outside of the drivers/base area have been acked by the
    respective maintainers, and have all been in the linux-next tree for a
    while.

    Signed-off-by: Greg Kroah-Hartman "

    * tag 'driver-core-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (95 commits)
    memory: tegra{20,30}-mc: Fix reading incorrect register in mc_readl()
    device.h: Add missing inline to #ifndef CONFIG_PRINTK dev_vprintk_emit
    memory: emif: Add ifdef CONFIG_DEBUG_FS guard for emif_debugfs_[init|exit]
    Documentation: Fixes some translation error in Documentation/zh_CN/gpio.txt
    Documentation: Remove 3 byte redundant code at the head of the Documentation/zh_CN/arm/booting
    Documentation: Chinese translation of Documentation/video4linux/omap3isp.txt
    device and dynamic_debug: Use dev_vprintk_emit and dev_printk_emit
    dev: Add dev_vprintk_emit and dev_printk_emit
    netdev_printk/netif_printk: Remove a superfluous logging colon
    netdev_printk/dynamic_netdev_dbg: Directly call printk_emit
    dev_dbg/dynamic_debug: Update to use printk_emit, optimize stack
    driver-core: Shut up dev_dbg_reatelimited() without DEBUG
    tools/hv: Parse /etc/os-release
    tools/hv: Check for read/write errors
    tools/hv: Fix exit() error code
    tools/hv: Fix file handle leak
    Tools: hv: Implement the KVP verb - KVP_OP_GET_IP_INFO
    Tools: hv: Rename the function kvp_get_ip_address()
    Tools: hv: Implement the KVP verb - KVP_OP_SET_IP_INFO
    Tools: hv: Add an example script to configure an interface
    ...

    Linus Torvalds
     
  • Pull arm64 support from Catalin Marinas:
    "Linux support for the 64-bit ARM architecture (AArch64)

    Features currently supported:
    - 39-bit address space for user and kernel (each)
    - 4KB and 64KB page configurations
    - Compat (32-bit) user applications (ARMv7, EABI only)
    - Flattened Device Tree (mandated for all AArch64 platforms)
    - ARM generic timers"

    * tag 'arm64-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64: (35 commits)
    arm64: ptrace: remove obsolete ptrace request numbers from user headers
    arm64: Do not set the SMP/nAMP processor bit
    arm64: MAINTAINERS update
    arm64: Build infrastructure
    arm64: Miscellaneous header files
    arm64: Generic timers support
    arm64: Loadable modules
    arm64: Miscellaneous library functions
    arm64: Performance counters support
    arm64: Add support for /proc/sys/debug/exception-trace
    arm64: Debugging support
    arm64: Floating point and SIMD
    arm64: 32-bit (compat) applications support
    arm64: User access library functions
    arm64: Signal handling support
    arm64: VDSO support
    arm64: System calls handling
    arm64: ELF definitions
    arm64: SMP support
    arm64: DMA mapping API
    ...

    Linus Torvalds
     
  • Pull perf update from Ingo Molnar:
    "Lots of changes in this cycle as well, with hundreds of commits from
    over 30 contributors. Most of the activity was on the tooling side.

    Higher level changes:

    - New 'perf kvm' analysis tool, from Xiao Guangrong.

    - New 'perf trace' system-wide tracing tool

    - uprobes fixes + cleanups from Oleg Nesterov.

    - Lots of patches to make perf build on Android out of box, from
    Irina Tirdea

    - Extend ftrace function tracing utility to be more dynamic for its
    users. It allows for data passing to the callback functions, as
    well as reading regs as if a breakpoint were to trigger at function
    entry.

    The main goal of this patch series was to allow kprobes to use
    ftrace as an optimized probe point when a probe is placed on an
    ftrace nop. With lots of help from Masami Hiramatsu, and going
    through lots of iterations, we finally came up with a good
    solution.

    - Add cpumask for uncore pmu, use it in 'stat', from Yan, Zheng.

    - Various tracing updates from Steve Rostedt

    - Clean up and improve 'perf sched' performance by elliminating lots
    of needless calls to libtraceevent.

    - Event group parsing support, from Jiri Olsa

    - UI/gtk refactorings and improvements from Namhyung Kim

    - Add support for non-tracepoint events in perf script python, from
    Feng Tang

    - Add --symbols to 'script', similar to the one in 'report', from
    Feng Tang.

    Infrastructure enhancements and fixes:

    - Convert the trace builtins to use the growing evsel/evlist
    tracepoint infrastructure, removing several open coded constructs
    like switch like series of strcmp to dispatch events, etc.
    Basically what had already been showcased in 'perf sched'.

    - Add evsel constructor for tracepoints, that uses libtraceevent just
    to parse the /format events file, use it in a new 'perf test' to
    make sure the libtraceevent format parsing regressions can be more
    readily caught.

    - Some strange errors were happening in some builds, but not on the
    next, reported by several people, problem was some parser related
    files, generated during the build, didn't had proper make deps, fix
    from Eric Sandeen.

    - Introduce struct and cache information about the environment where
    a perf.data file was captured, from Namhyung Kim.

    - Fix handling of unresolved samples when --symbols is used in
    'report', from Feng Tang.

    - Add union member access support to 'probe', from Hyeoncheol Lee.

    - Fixups to die() removal, from Namhyung Kim.

    - Render fixes for the TUI, from Namhyung Kim.

    - Don't enable annotation in non symbolic view, from Namhyung Kim.

    - Fix pipe mode in 'report', from Namhyung Kim.

    - Move related stats code from stat to util/, will be used by the
    'stat' kvm tool, from Xiao Guangrong.

    - Remove die()/exit() calls from several tools.

    - Resolve vdso callchains, from Jiri Olsa

    - Don't pass const char pointers to basename, so that we can
    unconditionally use libgen.h and thus avoid ifdef BIONIC lines,
    from David Ahern

    - Refactor hist formatting so that it can be reused with the GTK
    browser, From Namhyung Kim

    - Fix build for another rbtree.c change, from Adrian Hunter.

    - Make 'perf diff' command work with evsel hists, from Jiri Olsa.

    - Use the only field_sep var that is set up: symbol_conf.field_sep,
    fix from Jiri Olsa.

    - .gitignore compiled python binaries, from Namhyung Kim.

    - Get rid of die() in more libtraceevent places, from Namhyung Kim.

    - Rename libtraceevent 'private' struct member to 'priv' so that it
    works in C++, from Steven Rostedt

    - Remove lots of exit()/die() calls from tools so that the main perf
    exit routine can take place, from David Ahern

    - Fix x86 build on x86-64, from David Ahern.

    - {int,str,rb}list fixes from Suzuki K Poulose

    - perf.data header fixes from Namhyung Kim

    - Allow user to indicate objdump path, needed in cross environments,
    from Maciek Borzecki

    - Fix hardware cache event name generation, fix from Jiri Olsa

    - Add round trip test for sw, hw and cache event names, catching the
    problem Jiri fixed, after Jiri's patch, the test passes
    successfully.

    - Clean target should do clean for lib/traceevent too, fix from David
    Ahern

    - Check the right variable for allocation failure, fix from Namhyung
    Kim

    - Set up evsel->tp_format regardless of evsel->name being set
    already, fix from Namhyung Kim

    - Oprofile fixes from Robert Richter.

    - Remove perf_event_attr needless version inflation, from Jiri Olsa

    - Introduce libtraceevent strerror like error reporting facility,
    from Namhyung Kim

    - Add pmu mappings to perf.data header and use event names from cmd
    line, from Robert Richter

    - Fix include order for bison/flex-generated C files, from Ben
    Hutchings

    - Build fixes and documentation corrections from David Ahern

    - Assorted cleanups from Robert Richter

    - Let O= makes handle relative paths, from Steven Rostedt

    - perf script python fixes, from Feng Tang.

    - Initial bash completion support, from Frederic Weisbecker

    - Allow building without libelf, from Namhyung Kim.

    - Support DWARF CFI based unwind to have callchains when %bp based
    unwinding is not possible, from Jiri Olsa.

    - Symbol resolution fixes, while fixing support PPC64 files with an
    .opt ELF section was the end goal, several fixes for code that
    handles all architectures and cleanups are included, from Cody
    Schafer.

    - Assorted fixes for Documentation and build in 32 bit, from Robert
    Richter

    - Cache the libtraceevent event_format associated to each evsel
    early, so that we avoid relookups, i.e. calling pevent_find_event
    repeatedly when processing tracepoint events.

    [ This is to reduce the surface contact with libtraceevents and
    make clear what is that the perf tools needs from that lib: so
    far parsing the common and per event fields. ]

    - Don't stop the build if the audit libraries are not installed, fix
    from Namhyung Kim.

    - Fix bfd.h/libbfd detection with recent binutils, from Markus
    Trippelsdorf.

    - Improve warning message when libunwind devel packages not present,
    from Jiri Olsa"

    * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (282 commits)
    perf trace: Add aliases for some syscalls
    perf probe: Print an enum type variable in "enum variable-name" format when showing accessible variables
    perf tools: Check libaudit availability for perf-trace builtin
    perf hists: Add missing period_* fields when collapsing a hist entry
    perf trace: New tool
    perf evsel: Export the event_format constructor
    perf evsel: Introduce rawptr() method
    perf tools: Use perf_evsel__newtp in the event parser
    perf evsel: The tracepoint constructor should store sys:name
    perf evlist: Introduce set_filter() method
    perf evlist: Renane set_filters method to apply_filters
    perf test: Add test to check we correctly parse and match syscall open parms
    perf evsel: Handle endianity in intval method
    perf evsel: Know if byte swap is needed
    perf tools: Allow handling a NULL cpu_map as meaning "all cpus"
    perf evsel: Improve tracepoint constructor setup
    tools lib traceevent: Fix error path on pevent_parse_event
    perf test: Fix build failure
    trace: Move trace event enable from fs_initcall to core_initcall
    tracing: Add an option for disabling markers
    ...

    Linus Torvalds
     
  • Pull ktest fix from Steven Rostedt:
    "ktest has one fix needed for this merge window - fix parsing of ELSE
    IF in reading config file"

    * tag 'ktest-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest:
    ktest: Fix ELSE IF statements

    Linus Torvalds
     
  • Pull the trivial tree from Jiri Kosina:
    "Tiny usual fixes all over the place"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (34 commits)
    doc: fix old config name of kprobetrace
    fs/fs-writeback.c: cleanup riteback_sb_inodes kerneldoc
    btrfs: fix the commment for the action flags in delayed-ref.h
    btrfs: fix trivial typo for the comment of BTRFS_FREE_INO_OBJECTID
    vfs: fix kerneldoc for generic_fh_to_parent()
    treewide: fix comment/printk/variable typos
    ipr: fix small coding style issues
    doc: fix broken utf8 encoding
    nfs: comment fix
    platform/x86: fix asus_laptop.wled_type module parameter
    mfd: printk/comment fixes
    doc: getdelays.c: remember to close() socket on error in create_nl_socket()
    doc: aliasing-test: close fd on write error
    mmc: fix comment typos
    dma: fix comments
    spi: fix comment/printk typos in spi
    Coccinelle: fix typo in memdup_user.cocci
    tmiofb: missing NULL pointer checks
    tools: perf: Fix typo in tools/perf
    tools/testing: fix comment / output typos
    ...

    Linus Torvalds
     

28 Sep, 2012

1 commit

  • What we get from audit_syscall_to_name isn't what we find in the
    syscalls: tracepoint events, so add the alias that allows the tool to
    find prctl, fstat, fstatat and stat.

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

    Arnaldo Carvalho de Melo
     

27 Sep, 2012

13 commits

  • …ing accessible variables

    When showing accessible variables, an enum type variable was printed in
    "variable-name" format. Change this format into "enum variable-name".

    Signed-off-by: Hyeoncheol Lee <hyc.lee@gmail.com>
    Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
    Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
    Link: http://lkml.kernel.org/r/1348713399-4541-1-git-send-email-hyc.lee@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

    Hyeoncheol Lee
     
  • The newly added trace command requires an external audit library.

    However it can cause a build error because it's not checked whether the
    libaudit is installed on system:

    CC builtin-trace.o
    builtin-trace.c:7:22: fatal error: libaudit.h: No such file or directory
    compilation terminated.
    make: *** [builtin-trace.o] Error 1

    Signed-off-by: Namhyung Kim
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1348745018-21744-1-git-send-email-namhyung@kernel.org
    [ committer note: Added ", disables 'trace tool' to the feature warning msg ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • So that the perf report won't lost the cpu utilization information.

    For example, if there're two process that have same name.

    $ perf report --stdio --showcpuutilization -s pid
    [SNIP]
    # Overhead sys us Command: Pid
    # ........ ........ ........ .............
    #
    55.12% 0.01% 55.10% noploop:28781
    44.88% 0.06% 44.83% noploop:28782

    Before:
    $ perf report --stdio --showcpuutilization -s comm
    [SNIP]
    # Overhead sys us
    # ........ ........ ........
    #
    100.00% 0.06% 44.83%

    After:
    $ perf report --stdio --showcpuutilization -s comm
    [SNIP]
    # Overhead sys us
    # ........ ........ ........
    #
    100.00% 0.07% 99.93%

    Signed-off-by: Namhyung Kim
    Cc: Arun Sharma
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1348645663-25303-2-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Initially should look loosely like the venerable 'strace' tool, but
    using the infrastructure in the perf tools to allow tracing extra
    targets:

    [acme@sandy linux]$ perf trace --hell
    Error: unknown option `hell'

    usage: perf trace

    -p, --pid trace events on existing process id
    --tid trace events on existing thread id
    --all-cpus system-wide collection from all CPUs
    --cpu list of cpus to monitor
    --no-inherit child tasks do not inherit counters
    --mmap-pages number of mmap data pages
    --uid user to profile

    [acme@sandy linux]$

    Those should have the same semantics as when using with 'perf record'.

    It gets stuck sometimes, but hey, it works sometimes too!

    In time it should support perf.data based workloads, i.e. it should have
    a:
    -o filename

    Command line option that will produce a perf.data file that can then be
    used with 'perf trace' or any of the other perf tools (script, report,
    etc).

    It will also eventually have the set of functionalities described in the
    previous 'trace' prototype by Thomas Gleixner:

    "Announcing a new utility: 'trace'"
    http://lwn.net/Articles/415728/

    Also planned is to have some of the features suggested in the comments
    of that LWN article.

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

    Arnaldo Carvalho de Melo
     
  • It'll be needed in the next patches, where it'll be not associated
    directly to an evsel.

    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
     
  • Will be used for things like the args field in the raw_syscalls:sys_enter
    tracepoint.

    Implement strval with it, its basicaly strval returning void *.

    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
     
  • Elliminating code duplication.

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

    Arnaldo Carvalho de Melo
     
  • Not event_format->name, that doesn't contains the sys: part.

    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
     
  • The ELSE IF statements do not work as expected if another ELSE statement
    follows. This is because the $if_set is not set. If the ELSE IF
    condition is true, the following ELSE should be ignored. But because the
    $if_set is not set, the following ELSE will also be executed.

    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • To apply a filter to all the evsels in an evlist.

    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
     
  • Because that is what it really does, i.e. it applies the filters that
    were parsed from the command line and stashed into the evsels they refer
    to.

    We'll need the set_filter method name to actually apply a filter to all
    the evsels in an evlist, for instance, to ask that a syswide tracer
    doesn't trace itself.

    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
     
  • It will set up a syscall open tracepoint event, generate an open with
    invalid flags, then check those flags were the ones reported in the
    tracepoint fired.

    For the filename we need vfs:getname, but that will go thru some more
    iterations as the vfs getname codebase is going thru changes lately.

    When that is in I'll just check that the perf_evsel__newtp constructor
    is not bailing out and then add it to the evlist, catch the event and
    check the filename against the one used in the 'open' call used to
    trigger the event.

    Cc: David Ahern
    Cc: Eric Paris
    Cc: Frederic Weisbecker
    Cc: Jeff Layton
    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-p5w9aq0jcbb91ghzqomowm16@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • We were relying on the info in pevent, but since we have it in
    perf_evsel, set up by the perf_session routine if read from a perf.data
    file or by whoever creates the evsels, use it.

    New 'perf test' entries will use it to parse locally generated events,
    in a non perf.data centered workflow.

    As well as use byteswap.h to get per arch optimized swap routines, like
    other parts of perf (header, perf_evsel__parse_sample, symbol, etc)
    already do.

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

    Arnaldo Carvalho de Melo
     

26 Sep, 2012

3 commits

  • Instead of passing it around for parsing as an explicit parameter, will
    help with reading tracepoint fields when not using a perf session or
    pevent structure, i.e. for non perf.data centered workflows.

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

    Arnaldo Carvalho de Melo
     
  • Or one with cpu_map->map[0] == -1.

    Reducing the boilerplate in setting up an evlist by nor requiring a
    cpu_map to be created at all.

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

    Arnaldo Carvalho de Melo
     
  • It needs to properly set the sample_type, sample_period and the KVM
    related perf_event_attr fields.

    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
     

25 Sep, 2012

2 commits

  • If __pevent_parse_format() succeeded but add_event() failed, 'ret' didn't
    have a proper error code. Set it to PEVENT_ERRNO__MEM_ALLOC_FAILED.

    In addition, at that point 'event' also has fields and format
    information and they all need to be freed. Call pevent_free_format() to
    handle it.

    Signed-off-by: Namhyung Kim
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1348575919-4954-1-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • The commit 6a6cd11d4e57 ("perf test: Add test for the sched tracepoint
    format fields") added following build error:

    CC builtin-test.o
    builtin-test.c: In function ‘perf_evsel__test_field’:
    builtin-test.c:1216:6: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable]
    builtin-test.c: In function ‘perf_evsel__tp_sched_test’:
    builtin-test.c:1242:6: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable]
    cc1: all warnings being treated as errors
    make: *** [builtin-test.o] Error 1

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

    Namhyung Kim
     

24 Sep, 2012

15 commits

  • Now alloc_arg returns NULL if memory allocation failed, it should be
    handled on callsites properly.

    Signed-off-by: Namhyung Kim
    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
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/87k3vpzbqo.fsf_-_@sejong.aot.lge.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • So that we make sure the routines that do event format parsing are
    working on at least two well know scheduler tracepoints.

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

    Arnaldo Carvalho de Melo
     
  • The existing constructor receives a perf_event_attr filled with the
    event type and the config.

    To reduce the boilerplate for tracepoints, provide a new constructor,
    perf_evsel__newtp() that receives the tracepoint name and will open
    the debugfs file, call into libtraceevent new pevent_parse_format file
    to fill its ->tp_format member, so that users can then just call
    perf_evsel__field() to access its fields.

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

    Arnaldo Carvalho de Melo
     
  • The pevent_parse_event() routine will parse a events/sys/tp/format file
    and add an event_format instance to the pevent struct.

    This patch introduces a pevent_parse_format() routine with just the bits
    needed to parse the event/sys/tp/format file and just return the
    event_format instance, useful for when all we want is to parse the
    format file, without requiring the pevent struct.

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

    Arnaldo Carvalho de Melo
     
  • Cleaned event-parse.c this time, just propagate the errors and in handle
    them the call sites.

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

    Arnaldo Carvalho de Melo
     
  • Instead of dying, just use do_warning and let the goto that is there to
    take place.

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

    Arnaldo Carvalho de Melo
     
  • Replacing the equivalent open coded malloc + memset bits.

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

    Arnaldo Carvalho de Melo
     
  • Replacing the equivalent open coded malloc + sprintf bits.

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

    Arnaldo Carvalho de Melo
     
  • With recent binutils I get:

    perf % make
    Makefile:668: No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demanglin

    That happens because bfd.h now contains:

    I've reopened a bug in the hope that this check will be deleted:
    http://sourceware.org/bugzilla/show_bug.cgi?id=14243

    But in the meantime, the following patch fixes the problem

    Signed-off-by: Markus Trippelsdorf
    Cc: Ingo Molnar
    Cc: Mike Frysinger
    Cc: Paul Mackerras
    Link: http://lkml.kernel.org/r/20120919072902.GA262@x4
    Signed-off-by: Arnaldo Carvalho de Melo

    Markus Trippelsdorf
     
  • The field should be freed on error paths.

    Signed-off-by: Namhyung Kim
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/1348037924-17568-5-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • The field should be freed on error paths.

    Signed-off-by: Namhyung Kim
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/1348037924-17568-4-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • When process_op failed, @arg will be freed on a caller with type of
    PRINT_OP. Thus free_arg() will try to free ->op.right field which can
    have stale value if something bad happens in the middle.

    Signed-off-by: Namhyung Kim
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/1348037924-17568-3-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • free_token() under out_free should be called with 'token' and no need
    to set *tok to NULL since it's set already.

    Signed-off-by: Namhyung Kim
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/1348037924-17568-2-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • 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
     
  • Because its only user builtin-kvm::get_cpu_isa() has gone, It can be
    removed safely. In general, we have the feature information in
    perf_session_env already, no need to read it again.

    Signed-off-by: Namhyung Kim
    Cc: David Ahern
    Cc: Dong Hao
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Xiao Guangrong
    Link: http://lkml.kernel.org/r/1348474503-15070-7-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim