15 Jan, 2016

6 commits


30 Sep, 2015

1 commit

  • commit 051ac3848a94f21cfdec899cc9c65ce7f9f116fa upstream.

    `perf stat -e sunrpc:svc_xprt_do_enqueue true` results in

    Warning: unknown op '->'
    Warning: [sunrpc:svc_xprt_do_enqueue] unknown op '->'

    Similar warning for svc_handle_xprt as well.

    Actually TP_printk() should never dereference an address saved in the ring
    buffer that points somewhere in the kernel. There's no guarantee that that
    object still exists (with the exception of static strings).

    Therefore change all the arguments for TP_printk(), so that it references
    values existing in the ring buffer only.

    While doing that, also fix another possible bug when argument xprt could be
    NULL and TP_fast_assign() tries to access it's elements.

    Signed-off-by: Pratyush Anand
    Reviewed-by: Jeff Layton
    Acked-by: Steven Rostedt
    Fixes: 83a712e0afef "sunrpc: add some tracepoints around ..."
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Greg Kroah-Hartman

    Pratyush Anand
     

04 Jun, 2015

1 commit

  • Pull block layer fixes from Jens Axboe:
    "Sending this off now, as I'm not aware of other current bugs, nor do I
    expect further fixes before 4.1 final. This contains two fixes:

    - a fix for a bdi unregister warning that gets spewed on md, due to a
    regression introduced earlier in this cycle. From Neil Brown.

    - a fix for a compile warning for NVMe on 32-bit platforms, also a
    regression introduced in this cycle. From Arnd Bergmann"

    * 'for-linus' of git://git.kernel.dk/linux-block:
    NVMe: fix type warning on 32-bit
    block: discard bdi_unregister() in favour of bdi_destroy()

    Linus Torvalds
     

29 May, 2015

4 commits

  • Since tracepoints use RCU for protection, they must not be called on
    offline cpus. trace_mm_page_pcpu_drain can be called on an offline cpu
    in this scenario caught by LOCKDEP:

    ===============================
    [ INFO: suspicious RCU usage. ]
    4.1.0-rc1+ #9 Not tainted
    -------------------------------
    include/trace/events/kmem.h:265 suspicious rcu_dereference_check() usage!

    other info that might help us debug this:

    RCU used illegally from offline CPU!
    rcu_scheduler_active = 1, debug_locks = 1
    1 lock held by swapper/5/0:
    #0: (&(&zone->lock)->rlock){..-...}, at: [] .free_pcppages_bulk+0x70/0x920

    stack backtrace:
    CPU: 5 PID: 0 Comm: swapper/5 Not tainted 4.1.0-rc1+ #9
    Call Trace:
    .dump_stack+0x98/0xd4 (unreliable)
    .lockdep_rcu_suspicious+0x108/0x170
    .free_pcppages_bulk+0x60c/0x920
    .free_hot_cold_page+0x208/0x280
    .destroy_context+0x90/0xd0
    .__mmdrop+0x58/0x160
    .idle_task_exit+0xf0/0x100
    .pnv_smp_cpu_kill_self+0x58/0x2c0
    .cpu_die+0x34/0x50
    .arch_cpu_idle_dead+0x20/0x40
    .cpu_startup_entry+0x708/0x7a0
    .start_secondary+0x36c/0x3a0
    start_secondary_prolog+0x10/0x14

    Fix this by converting mm_page_pcpu_drain trace point into
    TRACE_EVENT_CONDITION where condition is cpu_online(smp_processor_id())

    Signed-off-by: Shreyas B. Prabhu
    Reviewed-by: Preeti U Murthy
    Acked-by: Steven Rostedt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Shreyas B. Prabhu
     
  • Since tracepoints use RCU for protection, they must not be called on
    offline cpus. trace_mm_page_free can be called on an offline cpu in this
    scenario caught by LOCKDEP:

    ===============================
    [ INFO: suspicious RCU usage. ]
    4.1.0-rc1+ #9 Not tainted
    -------------------------------
    include/trace/events/kmem.h:170 suspicious rcu_dereference_check() usage!

    other info that might help us debug this:

    RCU used illegally from offline CPU!
    rcu_scheduler_active = 1, debug_locks = 1
    no locks held by swapper/1/0.

    stack backtrace:
    CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.1.0-rc1+ #9
    Call Trace:
    .dump_stack+0x98/0xd4 (unreliable)
    .lockdep_rcu_suspicious+0x108/0x170
    .free_pages_prepare+0x494/0x680
    .free_hot_cold_page+0x50/0x280
    .destroy_context+0x90/0xd0
    .__mmdrop+0x58/0x160
    .idle_task_exit+0xf0/0x100
    .pnv_smp_cpu_kill_self+0x58/0x2c0
    .cpu_die+0x34/0x50
    .arch_cpu_idle_dead+0x20/0x40
    .cpu_startup_entry+0x708/0x7a0
    .start_secondary+0x36c/0x3a0
    start_secondary_prolog+0x10/0x14

    Fix this by converting mm_page_free trace point into TRACE_EVENT_CONDITION
    where condition is cpu_online(smp_processor_id())

    Signed-off-by: Shreyas B. Prabhu
    Reviewed-by: Preeti U Murthy
    Acked-by: Steven Rostedt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Shreyas B. Prabhu
     
  • Since tracepoints use RCU for protection, they must not be called on
    offline cpus. trace_kmem_cache_free can be called on an offline cpu in
    this scenario caught by LOCKDEP:

    ===============================
    [ INFO: suspicious RCU usage. ]
    4.1.0-rc1+ #9 Not tainted
    -------------------------------
    include/trace/events/kmem.h:148 suspicious rcu_dereference_check() usage!

    other info that might help us debug this:

    RCU used illegally from offline CPU!
    rcu_scheduler_active = 1, debug_locks = 1
    no locks held by swapper/1/0.

    stack backtrace:
    CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.1.0-rc1+ #9
    Call Trace:
    .dump_stack+0x98/0xd4 (unreliable)
    .lockdep_rcu_suspicious+0x108/0x170
    .kmem_cache_free+0x344/0x4b0
    .__mmdrop+0x4c/0x160
    .idle_task_exit+0xf0/0x100
    .pnv_smp_cpu_kill_self+0x58/0x2c0
    .cpu_die+0x34/0x50
    .arch_cpu_idle_dead+0x20/0x40
    .cpu_startup_entry+0x708/0x7a0
    .start_secondary+0x36c/0x3a0
    start_secondary_prolog+0x10/0x14

    Fix this by converting kmem_cache_free trace point into
    TRACE_EVENT_CONDITION where condition is cpu_online(smp_processor_id())

    Signed-off-by: Shreyas B. Prabhu
    Reported-by: Aneesh Kumar K.V
    Reviewed-by: Preeti U Murthy
    Acked-by: Steven Rostedt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Shreyas B. Prabhu
     
  • bdi_unregister() now contains very little functionality.

    It contains a "WARN_ON" if bdi->dev is NULL. This warning is of no
    real consequence as bdi->dev isn't needed by anything else in the function,
    and it triggers if
    blk_cleanup_queue() -> bdi_destroy()
    is called before bdi_unregister, which happens since
    Commit: 6cd18e711dd8 ("block: destroy bdi before blockdev is unregistered.")

    So this isn't wanted.

    It also calls bdi_set_min_ratio(). This needs to be called after
    writes through the bdi have all been flushed, and before the bdi is destroyed.
    Calling it early is better than calling it late as it frees up a global
    resource.

    Calling it immediately after bdi_wb_shutdown() in bdi_destroy()
    perfectly fits these requirements.

    So bdi_unregister() can be discarded with the important content moved to
    bdi_destroy(), as can the
    writeback_bdi_unregister
    event which is already not used.

    Reported-by: Mike Snitzer
    Cc: stable@vger.kernel.org (v4.0)
    Fixes: c4db59d31e39 ("fs: don't reassign dirty inodes to default_backing_dev_info")
    Fixes: 6cd18e711dd8 ("block: destroy bdi before blockdev is unregistered.")
    Acked-by: Peter Zijlstra (Intel)
    Acked-by: Dan Williams
    Tested-by: Nicholas Moulin
    Signed-off-by: NeilBrown
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    NeilBrown
     

27 Apr, 2015

1 commit

  • Pull fourth vfs update from Al Viro:
    "d_inode() annotations from David Howells (sat in for-next since before
    the beginning of merge window) + four assorted fixes"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    RCU pathwalk breakage when running into a symlink overmounting something
    fix I_DIO_WAKEUP definition
    direct-io: only inc/dec inode->i_dio_count for file systems
    fs/9p: fix readdir()
    VFS: assorted d_backing_inode() annotations
    VFS: fs/inode.c helpers: d_inode() annotations
    VFS: fs/cachefiles: d_backing_inode() annotations
    VFS: fs library helpers: d_inode() annotations
    VFS: assorted weird filesystems: d_inode() annotations
    VFS: normal filesystems (and lustre): d_inode() annotations
    VFS: security/: d_inode() annotations
    VFS: security/: d_backing_inode() annotations
    VFS: net/: d_inode() annotations
    VFS: net/unix: d_backing_inode() annotations
    VFS: kernel/: d_inode() annotations
    VFS: audit: d_backing_inode() annotations
    VFS: Fix up some ->d_inode accesses in the chelsio driver
    VFS: Cachefiles should perform fs modifications on the top layer only
    VFS: AF_UNIX sockets should call mknod on the top layer only

    Linus Torvalds
     

22 Apr, 2015

1 commit

  • Pull clock framework updates from Michael Turquette:
    "The changes to the common clock framework for 4.0 are mostly new clock
    drivers and updates to existing ones for feature enhancements and bug
    fixes.

    There is more churn than usual in the framework core due to the change
    to introduce per-user unique struct clk pointers in 4.0. This caused
    several regressions to surface, some of which were sent as fixes to
    4.0. New generic clock drivers were added for GPIO- and PWM-based
    clock controllers.

    Additionally the common clk-divider code recieved several fixes to the
    way it rounds rates"

    * tag 'clk-for-linus-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (91 commits)
    clk: check ->determine/round_rate() return value in clk_calc_new_rates
    clk: at91: usb: propagate rate modification to the parent clk
    clk: samsung: exynos4: Disable ARMCLK down feature on Exynos4210 SoC
    clk: don't use __initconst for non-const arrays
    clk: at91: change to using endian agnositc IO
    clk: clk-gpio-gate: Fix active low
    clk: Add PWM clock driver
    clk: Add clock driver for mb86s7x
    clk: pxa: pxa3xx: add missing os timer clock
    clk: tegra: Use the proper parent for plld_dsi
    clk: tegra: Use generic tegra_osc_clk_init() on Tegra114
    clk: tegra: Model oscillator as clock
    clk: tegra: Add peripheral registers for bank Y
    clk: tegra: Register the proper number of resets
    clk: tegra: Remove needless initializations
    clk: tegra: Use consistent indentation
    clk: tegra: Various whitespace cleanups
    clk: tegra: Enable HDA to HDMI clocks on Tegra124
    clk: tegra: Fix a bunch of sparse warnings
    clk: tegra: Fix typo tabel -> table
    ...

    Linus Torvalds
     

18 Apr, 2015

2 commits

  • Pull perf updates from Ingo Molnar:
    "This update has mostly fixes, but also other bits:

    - perf tooling fixes

    - PMU driver fixes

    - Intel Broadwell PMU driver HW-enablement for LBR callstacks

    - a late coming 'perf kmem' tool update that enables it to also
    analyze page allocation data. Note, this comes with MM tracepoint
    changes that we believe to not break anything: because it changes
    the formerly opaque 'struct page *' field that uniquely identifies
    pages to 'pfn' which identifies pages uniquely too, but isn't as
    opaque and can be used for other purposes as well"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf/x86/intel/pt: Fix and clean up error handling in pt_event_add()
    perf/x86/intel: Add Broadwell support for the LBR callstack
    perf/x86/intel/rapl: Fix energy counter measurements but supporing per domain energy units
    perf/x86/intel: Fix Core2,Atom,NHM,WSM cycles:pp events
    perf/x86: Fix hw_perf_event::flags collision
    perf probe: Fix segfault when probe with lazy_line to file
    perf probe: Find compilation directory path for lazy matching
    perf probe: Set retprobe flag when probe in address-based alternative mode
    perf kmem: Analyze page allocator events also
    tracing, mm: Record pfn instead of pointer to struct page

    Linus Torvalds
     
  • Pull f2fs updates from Jaegeuk Kim:
    "New features:
    - in-memory extent_cache
    - fs_shutdown to test power-off-recovery
    - use inline_data to store symlink path
    - show f2fs as a non-misc filesystem

    Major fixes:
    - avoid CPU stalls on sync_dirty_dir_inodes
    - fix some power-off-recovery procedure
    - fix handling of broken symlink correctly
    - fix missing dot and dotdot made by sudden power cuts
    - handle wrong data index during roll-forward recovery
    - preallocate data blocks for direct_io

    ... and a bunch of minor bug fixes and cleanups"

    * tag 'for-f2fs-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (71 commits)
    f2fs: pass checkpoint reason on roll-forward recovery
    f2fs: avoid abnormal behavior on broken symlink
    f2fs: flush symlink path to avoid broken symlink after POR
    f2fs: change 0 to false for bool type
    f2fs: do not recover wrong data index
    f2fs: do not increase link count during recovery
    f2fs: assign parent's i_mode for empty dir
    f2fs: add F2FS_INLINE_DOTS to recover missing dot dentries
    f2fs: fix mismatching lock and unlock pages for roll-forward recovery
    f2fs: fix sparse warnings
    f2fs: limit b_size of mapped bh in f2fs_map_bh
    f2fs: persist system.advise into on-disk inode
    f2fs: avoid NULL pointer dereference in f2fs_xattr_advise_get
    f2fs: preallocate fallocated blocks for direct IO
    f2fs: enable inline data by default
    f2fs: preserve extent info for extent cache
    f2fs: initialize extent tree with on-disk extent info of inode
    f2fs: introduce __{find,grab}_extent_tree
    f2fs: split set_data_blkaddr from f2fs_update_extent_cache
    f2fs: enable fast symlink by utilizing inline data
    ...

    Linus Torvalds
     

17 Apr, 2015

1 commit


16 Apr, 2015

2 commits


15 Apr, 2015

3 commits

  • Merge first patchbomb from Andrew Morton:

    - arch/sh updates

    - ocfs2 updates

    - kernel/watchdog feature

    - about half of mm/

    * emailed patches from Andrew Morton : (122 commits)
    Documentation: update arch list in the 'memtest' entry
    Kconfig: memtest: update number of test patterns up to 17
    arm: add support for memtest
    arm64: add support for memtest
    memtest: use phys_addr_t for physical addresses
    mm: move memtest under mm
    mm, hugetlb: abort __get_user_pages if current has been oom killed
    mm, mempool: do not allow atomic resizing
    memcg: print cgroup information when system panics due to panic_on_oom
    mm: numa: remove migrate_ratelimited
    mm: fold arch_randomize_brk into ARCH_HAS_ELF_RANDOMIZE
    mm: split ET_DYN ASLR from mmap ASLR
    s390: redefine randomize_et_dyn for ELF_ET_DYN_BASE
    mm: expose arch_mmap_rnd when available
    s390: standardize mmap_rnd() usage
    powerpc: standardize mmap_rnd() usage
    mips: extract logic for mmap_rnd()
    arm64: standardize mmap_rnd() usage
    x86: standardize mmap_rnd() usage
    arm: factor out mmap ASLR into mmap_rnd
    ...

    Linus Torvalds
     
  • We would want to use number of page table level to define mm_struct.
    Let's expose it as CONFIG_PGTABLE_LEVELS.

    Signed-off-by: Kirill A. Shutemov
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Tested-by: Guenter Roeck
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • Pull tracing updates from Steven Rostedt:
    "Some clean ups and small fixes, but the biggest change is the addition
    of the TRACE_DEFINE_ENUM() macro that can be used by tracepoints.

    Tracepoints have helper functions for the TP_printk() called
    __print_symbolic() and __print_flags() that lets a numeric number be
    displayed as a a human comprehensible text. What is placed in the
    TP_printk() is also shown in the tracepoint format file such that user
    space tools like perf and trace-cmd can parse the binary data and
    express the values too. Unfortunately, the way the TRACE_EVENT()
    macro works, anything placed in the TP_printk() will be shown pretty
    much exactly as is. The problem arises when enums are used. That's
    because unlike macros, enums will not be changed into their values by
    the C pre-processor. Thus, the enum string is exported to the format
    file, and this makes it useless for user space tools.

    The TRACE_DEFINE_ENUM() solves this by converting the enum strings in
    the TP_printk() format into their number, and that is what is shown to
    user space. For example, the tracepoint tlb_flush currently has this
    in its format file:

    __print_symbolic(REC->reason,
    { TLB_FLUSH_ON_TASK_SWITCH, "flush on task switch" },
    { TLB_REMOTE_SHOOTDOWN, "remote shootdown" },
    { TLB_LOCAL_SHOOTDOWN, "local shootdown" },
    { TLB_LOCAL_MM_SHOOTDOWN, "local mm shootdown" })

    After adding:

    TRACE_DEFINE_ENUM(TLB_FLUSH_ON_TASK_SWITCH);
    TRACE_DEFINE_ENUM(TLB_REMOTE_SHOOTDOWN);
    TRACE_DEFINE_ENUM(TLB_LOCAL_SHOOTDOWN);
    TRACE_DEFINE_ENUM(TLB_LOCAL_MM_SHOOTDOWN);

    Its format file will contain this:

    __print_symbolic(REC->reason,
    { 0, "flush on task switch" },
    { 1, "remote shootdown" },
    { 2, "local shootdown" },
    { 3, "local mm shootdown" })"

    * tag 'trace-v4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (27 commits)
    tracing: Add enum_map file to show enums that have been mapped
    writeback: Export enums used by tracepoint to user space
    v4l: Export enums used by tracepoints to user space
    SUNRPC: Export enums in tracepoints to user space
    mm: tracing: Export enums in tracepoints to user space
    irq/tracing: Export enums in tracepoints to user space
    f2fs: Export the enums in the tracepoints to userspace
    net/9p/tracing: Export enums in tracepoints to userspace
    x86/tlb/trace: Export enums in used by tlb_flush tracepoint
    tracing/samples: Update the trace-event-sample.h with TRACE_DEFINE_ENUM()
    tracing: Allow for modules to convert their enums to values
    tracing: Add TRACE_DEFINE_ENUM() macro to map enums to their values
    tracing: Update trace-event-sample with TRACE_SYSTEM_VAR documentation
    tracing: Give system name a pointer
    brcmsmac: Move each system tracepoints to their own header
    iwlwifi: Move each system tracepoints to their own header
    mac80211: Move message tracepoints to their own header
    tracing: Add TRACE_SYSTEM_VAR to xhci-hcd
    tracing: Add TRACE_SYSTEM_VAR to kvm-s390
    tracing: Add TRACE_SYSTEM_VAR to intel-sst
    ...

    Linus Torvalds
     

14 Apr, 2015

1 commit

  • Pull libata updates from Tejun Heo:

    - Hannes's patchset implements support for better error reporting
    introduced by the new ATA command spec.

    - the deperecated pci_ dma API usages have been replaced by dma_ ones.

    - a bunch of hardware specific updates and some cleanups.

    * 'for-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
    ata: remove deprecated use of pci api
    ahci: st: st_configure_oob must be called after IP is clocked.
    ahci: st: Update the ahci_st DT documentation
    ahci: st: Update the DT example for how to obtain the PHY.
    sata_dwc_460ex: indent an if statement
    libata: Add tracepoints
    libata-eh: Set 'information' field for autosense
    libata: Implement support for sense data reporting
    libata: Implement NCQ autosense
    libata: use status bit definitions in ata_dump_status()
    ide,ata: Rename ATA_IDX to ATA_SENSE
    libata: whitespace fixes in ata_to_sense_error()
    libata: whitespace cleanup in ata_get_cmd_descript()
    libata: use READ_LOG_DMA_EXT
    libata: remove ATA_FLAG_LOWTAG
    sata_dwc_460ex: re-use hsdev->dev instead of dwc_dev
    sata_dwc_460ex: move to generic DMA driver
    sata_dwc_460ex: join messages back
    sata: xgene: add ACPI support for APM X-Gene SATA ports
    ata: sata_mv: add proper definitions for LP_PHY_CTL register values

    Linus Torvalds
     

13 Apr, 2015

1 commit

  • The struct page is opaque for userspace tools, so it'd be better to save
    pfn in order to identify page frames.

    The textual output of $debugfs/tracing/trace file remains unchanged and
    only raw (binary) data format is changed - but thanks to libtraceevent,
    userspace tools which deal with the raw data (like perf and trace-cmd)
    can parse the format easily. So impact on the userspace will also be
    minimal.

    Signed-off-by: Namhyung Kim
    Based-on-patch-by: Joonsoo Kim
    Acked-by: Ingo Molnar
    Acked-by: Steven Rostedt
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Minchan Kim
    Cc: Peter Zijlstra
    Cc: linux-mm@kvack.org
    Link: http://lkml.kernel.org/r/1428298576-9785-3-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

11 Apr, 2015

1 commit


08 Apr, 2015

11 commits

  • The enums used in tracepoints for __print_symbolic() do not have their
    values shown in the tracepoint format files and this makes it difficult
    for user space tools to convert the binary values to the strings they
    are to represent.

    Add TRACE_DEFINE_ENUM(x) macros to export the enum names to their values
    to make the tracing output from user space tools more robust.

    Link: http://lkml.kernel.org/r/20150403013802.220157513@goodmis.org

    Cc: Dave Chinner
    Cc: Jens Axboe
    Reviewed-by: Masami Hiramatsu
    Tested-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     
  • Enums used by tracepoints for __print_symbolic() are shown in the
    tracepoint format files with just their names and not their values.
    This makes it difficult for user space tools to know how to convert the
    binary data into their string representations.

    By adding the use of TRACE_DEFINE_ENUM(), the enum names will be mapped
    to their values and shown in the tracing file system to let tools
    convert the data as necessary.

    Link: http://lkml.kernel.org/r/20150403013802.220157513@goodmis.org

    Acked-by: Mauro Carvalho Chehab
    Reviewed-by: Masami Hiramatsu
    Tested-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     
  • The enums used in the tracepoints for __print_symbolic() have their
    names shown in the tracepoint format files. User space tools do not know
    how to convert those names into their values to be able to convert the
    binary data.

    Use TRACE_DEFINE_ENUM() to export the enum names to their values for
    userspace to do the parsing correctly.

    Link: http://lkml.kernel.org/r/20150403013802.220157513@goodmis.org

    Acked-by: Trond Myklebust
    Reviewed-by: Masami Hiramatsu
    Tested-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     
  • The enums used in tracepoints with __print_symbolic() have their
    names shown in the tracepoint format files and not their values.
    This makes it difficult for user space tools to convert the binary
    data to the strings as user space does not know what those enums
    are about.

    By having them use TRACE_DEFINE_ENUM(), the names of the enums will
    be mapped to the values and shown to user space.

    Link: http://lkml.kernel.org/r/20150403013802.220157513@goodmis.org

    Reviewed-by: Masami Hiramatsu
    Tested-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     
  • The enums used by the softirq mapping is what is shown in the output
    of the __print_symbolic() and not their values, that are needed
    to map them to their strings. Export them to userspace with the
    TRACE_DEFINE_ENUM() macro so that user space tools can map the enums
    with their values.

    Link: http://lkml.kernel.org/r/20150403013802.220157513@goodmis.org

    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Reviewed-by: Masami Hiramatsu
    Tested-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     
  • The tracepoints that use __print_symbolic() use enums as the value
    to convert to strings. Unfortunately, the format files for these
    tracepoints show the enum name and not their value. This causes some
    userspace tools not to know how to convert __print_symbolic() to
    their strings.

    Add TRACE_DEFINE_ENUM() macros to export the enums used to userspace
    to let those tools know what those enum values are.

    Link: http://lkml.kernel.org/r/20150403013802.220157513@goodmis.org

    Cc: Namjae Jeon
    Cc: Pankaj Kumar
    Cc: Jaegeuk Kim
    Reviewed-by: Masami Hiramatsu
    Tested-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     
  • The tracepoints in the 9p code use a lot of enums for the __print_symbolic()
    function. These enums are shown in the tracepoint format files, and user
    space tools such as trace-cmd does not have the information to parse it.
    Add helper macros to export the enums with TRACE_DEFINE_ENUM().

    Link: http://lkml.kernel.org/r/20150403013802.220157513@goodmis.org

    Cc: Aneesh Kumar K.V
    Cc: Eric Van Hensbergen
    Reviewed-by: Masami Hiramatsu
    Tested-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     
  • Have the enums used in __print_symbolic() by the trace_tlb_flush()
    tracepoint exported to userpace such that they can be parsed by
    userspace tools.

    Link: http://lkml.kernel.org/r/20150403013802.220157513@goodmis.org

    Cc: Dave Hansen
    Reviewed-by: Masami Hiramatsu
    Tested-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     
  • Several tracepoints use the helper functions __print_symbolic() or
    __print_flags() and pass in enums that do the mapping between the
    binary data stored and the value to print. This works well for reading
    the ASCII trace files, but when the data is read via userspace tools
    such as perf and trace-cmd, the conversion of the binary value to a
    human string format is lost if an enum is used, as userspace does not
    have access to what the ENUM is.

    For example, the tracepoint trace_tlb_flush() has:

    __print_symbolic(REC->reason,
    { TLB_FLUSH_ON_TASK_SWITCH, "flush on task switch" },
    { TLB_REMOTE_SHOOTDOWN, "remote shootdown" },
    { TLB_LOCAL_SHOOTDOWN, "local shootdown" },
    { TLB_LOCAL_MM_SHOOTDOWN, "local mm shootdown" })

    Which maps the enum values to the strings they represent. But perf and
    trace-cmd do no know what value TLB_LOCAL_MM_SHOOTDOWN is, and would
    not be able to map it.

    With TRACE_DEFINE_ENUM(), developers can place these in the event header
    files and ftrace will convert the enums to their values:

    By adding:

    TRACE_DEFINE_ENUM(TLB_FLUSH_ON_TASK_SWITCH);
    TRACE_DEFINE_ENUM(TLB_REMOTE_SHOOTDOWN);
    TRACE_DEFINE_ENUM(TLB_LOCAL_SHOOTDOWN);
    TRACE_DEFINE_ENUM(TLB_LOCAL_MM_SHOOTDOWN);

    $ cat /sys/kernel/debug/tracing/events/tlb/tlb_flush/format
    [...]
    __print_symbolic(REC->reason,
    { 0, "flush on task switch" },
    { 1, "remote shootdown" },
    { 2, "local shootdown" },
    { 3, "local mm shootdown" })

    The above is what userspace expects to see, and tools do not need to
    be modified to parse them.

    Link: http://lkml.kernel.org/r/20150403013802.220157513@goodmis.org

    Cc: Guilherme Cox
    Cc: Tony Luck
    Cc: Xie XiuQi
    Acked-by: Namhyung Kim
    Reviewed-by: Masami Hiramatsu
    Tested-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     
  • Normally the compiler will use the same pointer for a string throughout
    the file. But there's no guarantee of that happening. Later changes will
    require that all events have the same pointer to the system string.

    Name the system string and have all events point to it.

    Testing this, it did not increases the size of the text, except for the
    notes section, which should not harm the real size any.

    Link: http://lkml.kernel.org/r/20150403013802.220157513@goodmis.org

    Reviewed-by: Masami Hiramatsu
    Tested-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     
  • New code will require TRACE_SYSTEM to be a valid C variable name,
    but some tracepoints have TRACE_SYSTEM with '-' and not '_', so
    it can not be used. Instead, add a TRACE_SYSTEM_VAR that can
    give the tracing infrastructure a unique name for the trace system.

    Link: http://lkml.kernel.org/r/20150402142831.GT6023@sirena.org.uk

    Acked-by: Mark Brown
    Reviewed-by: Masami Hiramatsu
    Tested-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     

27 Mar, 2015

1 commit


25 Mar, 2015

1 commit

  • Use %pS for actual addresses, otherwise you'll get bad output
    on arches like ppc64 where %pF expects a function descriptor.

    Link: http://lkml.kernel.org/r/1426130037-17956-22-git-send-email-scottwood@freescale.com

    Signed-off-by: Scott Wood
    Signed-off-by: Steven Rostedt

    Scott Wood
     

20 Mar, 2015

2 commits

  • The tracing events for regmap are confined to the regmap subsystem. It
    also requires accessing an internal header. Instead of including the
    internal header from a generic file location, move the tracing file
    into the regmap directory.

    Also rename the regmap tracing header to trace.h, as it is redundant to
    keep the regmap.h name when it is in the regmap directory.

    Signed-off-by: Steven Rostedt
    Signed-off-by: Mark Brown

    Steven Rostedt
     
  • This patch fixes a NULL pointer dereference when enabling regmap event
    tracing in the presence of a syscon regmap, introduced by commit bdb0066df96e
    ("mfd: syscon: Decouple syscon interface from platform devices").
    That patch introduced syscon regmaps that have their dev field set to NULL.
    The regmap trace events expect it to point to a valid struct device and feed
    it to dev_name():

    $ echo 1 > /sys/kernel/debug/tracing/events/regmap/enable

    Unable to handle kernel NULL pointer dereference at virtual address 0000002c
    pgd = 80004000
    [0000002c] *pgd=00000000
    Internal error: Oops: 17 [#1] SMP ARM
    Modules linked in: coda videobuf2_vmalloc
    CPU: 0 PID: 304 Comm: kworker/0:2 Not tainted 4.0.0-rc2+ #9197
    Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
    Workqueue: events_freezable thermal_zone_device_check
    task: 9f25a200 ti: 9f1ee000 task.ti: 9f1ee000
    PC is at ftrace_raw_event_regmap_block+0x3c/0xe4
    LR is at _regmap_raw_read+0x1bc/0x1cc
    pc : [] lr : [] psr: 600f0093
    sp : 9f1efd78 ip : 9f1efdb8 fp : 9f1efdb4
    r10: 00000004 r9 : 00000001 r8 : 00000001
    r7 : 00000180 r6 : 00000000 r5 : 9f00e3c0 r4 : 00000003
    r3 : 00000001 r2 : 00000180 r1 : 00000000 r0 : 9f00e3c0
    Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel
    Control: 10c5387d Table: 2d91004a DAC: 00000015
    Process kworker/0:2 (pid: 304, stack limit = 0x9f1ee210)
    Stack: (0x9f1efd78 to 0x9f1f0000)
    fd60: 9f1efda4 9f1efd88
    fd80: 800708c0 805f9510 80927140 800f0013 9f1fc800 9eb2f490 00000000 00000180
    fda0: 808e3840 00000001 9f1efdfc 9f1efdb8 80365f2c 803636b8 805f8958 800708e0
    fdc0: a00f0013 803636ac 9f16de00 00000180 80927140 9f1fc800 9f1fc800 9f1efe6c
    fde0: 9f1efe6c 9f732400 00000000 00000000 9f1efe1c 9f1efe00 80365f70 80365d7c
    fe00: 80365f3c 9f1fc800 9f1fc800 00000180 9f1efe44 9f1efe20 803656a4 80365f48
    fe20: 9f1fc800 00000180 9f1efe6c 9f1efe6c 9f732400 00000000 9f1efe64 9f1efe48
    fe40: 803657bc 80365634 00000001 9e95f910 9f1fc800 9f1efeb4 9f1efe8c 9f1efe68
    fe60: 80452ac0 80365778 9f1efe8c 9f1efe78 9e93d400 9e93d5e8 9f1efeb4 9f72ef40
    fe80: 9f1efeac 9f1efe90 8044e11c 80452998 8045298c 9e93d608 9e93d400 808e1978
    fea0: 9f1efecc 9f1efeb0 8044fd14 8044e0d0 ffffffff 9f25a200 9e93d608 9e481380
    fec0: 9f1efedc 9f1efed0 8044fde8 8044fcec 9f1eff1c 9f1efee0 80038d50 8044fdd8
    fee0: 9f1ee020 9f72ef40 9e481398 00000000 00000008 9f72ef54 9f1ee020 9f72ef40
    ff00: 9e481398 9e481380 00000008 9f72ef40 9f1eff5c 9f1eff20 80039754 80038bfc
    ff20: 00000000 9e481380 80894100 808e1662 00000000 9e4f2ec0 00000000 9e481380
    ff40: 800396f8 00000000 00000000 00000000 9f1effac 9f1eff60 8003e020 80039704
    ff60: ffffffff 00000000 ffffffff 9e481380 00000000 00000000 9f1eff78 9f1eff78
    ff80: 00000000 00000000 9f1eff88 9f1eff88 9e4f2ec0 8003df30 00000000 00000000
    ffa0: 00000000 9f1effb0 8000eb60 8003df3c 00000000 00000000 00000000 00000000
    ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 ffffffff ffffffff
    Backtrace:
    [] (ftrace_raw_event_regmap_block) from [] (_regmap_raw_read+0x1bc/0x1cc)
    r9:00000001 r8:808e3840 r7:00000180 r6:00000000 r5:9eb2f490 r4:9f1fc800
    [] (_regmap_raw_read) from [] (_regmap_bus_read+0x34/0x6c)
    r10:00000000 r9:00000000 r8:9f732400 r7:9f1efe6c r6:9f1efe6c r5:9f1fc800
    r4:9f1fc800
    [] (_regmap_bus_read) from [] (_regmap_read+0x7c/0x144)
    r6:00000180 r5:9f1fc800 r4:9f1fc800 r3:80365f3c
    [] (_regmap_read) from [] (regmap_read+0x50/0x70)
    r9:00000000 r8:9f732400 r7:9f1efe6c r6:9f1efe6c r5:00000180 r4:9f1fc800
    [] (regmap_read) from [] (imx_get_temp+0x134/0x1a4)
    r6:9f1efeb4 r5:9f1fc800 r4:9e95f910 r3:00000001
    [] (imx_get_temp) from [] (thermal_zone_get_temp+0x58/0x74)
    r7:9f72ef40 r6:9f1efeb4 r5:9e93d5e8 r4:9e93d400
    [] (thermal_zone_get_temp) from [] (thermal_zone_device_update+0x34/0xec)
    r6:808e1978 r5:9e93d400 r4:9e93d608 r3:8045298c
    [] (thermal_zone_device_update) from [] (thermal_zone_device_check+0x1c/0x20)
    r5:9e481380 r4:9e93d608
    [] (thermal_zone_device_check) from [] (process_one_work+0x160/0x3d4)
    [] (process_one_work) from [] (worker_thread+0x5c/0x4f4)
    r10:9f72ef40 r9:00000008 r8:9e481380 r7:9e481398 r6:9f72ef40 r5:9f1ee020
    r4:9f72ef54
    [] (worker_thread) from [] (kthread+0xf0/0x108)
    r10:00000000 r9:00000000 r8:00000000 r7:800396f8 r6:9e481380 r5:00000000
    r4:9e4f2ec0
    [] (kthread) from [] (ret_from_fork+0x14/0x34)
    r7:00000000 r6:00000000 r5:8003df30 r4:9e4f2ec0
    Code: e3140040 1a00001a e3140020 1a000016 (e596002c)
    ---[ end trace 193c15c2494ec960 ]---

    Fixes: bdb0066df96e (mfd: syscon: Decouple syscon interface from platform devices)
    Signed-off-by: Philipp Zabel
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Philipp Zabel