10 Mar, 2017

1 commit

  • Fix typos and add the following to the scripts/spelling.txt:

    overide||override

    While we are here, fix the doubled "address" in the touched line
    Documentation/devicetree/bindings/regulator/ti-abb-regulator.txt.

    Also, fix the comment block style in the touched hunks in
    drivers/media/dvb-frontends/drx39xyj/drx_driver.h.

    Link: http://lkml.kernel.org/r/1481573103-11329-21-git-send-email-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     

08 Mar, 2017

2 commits

  • Pull perf fixes from Ingo Molnar:
    "This includes a fix for a crash if certain special addresses are
    kprobed, plus does a rename of two Kconfig variables that were a minor
    misnomer"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf/core: Rename CONFIG_[UK]PROBE_EVENT to CONFIG_[UK]PROBE_EVENTS
    kprobes/x86: Fix kernel panic when certain exception-handling addresses are probed

    Linus Torvalds
     
  • Pull tracing fixes from Steven Rostedt:
    "There was some breakage with the changes for jump labels in the 4.11
    merge window:

    - powerpc broke as jump labels uses the two LSB bits as flags in
    initialization.

    A check was added to make sure that all jump label entries were 4
    bytes aligned, but powerpc didn't work that way for modules. Adding
    an alignment in the module linker script appeared to be the best
    solution.

    - Jump labels also added an anonymous union to access those LSB bits
    as a normal long. But because this structure had static
    initialization, it broke older compilers that could not statically
    initialize anonymous unions without brackets.

    - The command line parameter for setting function graph filter broke
    the "EMPTY_HASH" descriptor by modifying it instead of creating a
    new hash to hold the entries.

    - The command line parameter ftrace_graph_max_depth was added to
    allow its setting at boot time. It uses existing code and only the
    command line hook was added.

    This is not really a fix, but as it uses existing code without
    affecting anything else, I added it to this release. It was ready
    before the merge window closed, but I wanted to let it sit in
    linux-next for a couple of days first"

    * tag 'trace-v4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
    ftrace/graph: Add ftrace_graph_max_depth kernel parameter
    tracing: Add #undef to fix compile error
    jump_label: Add comment about initialization order for anonymous unions
    jump_label: Fix anonymous union initialization
    module: set __jump_table alignment to 8
    ftrace/graph: Do not modify the EMPTY_HASH for the function_graph filter
    tracing: Fix code comment for ftrace_ops_get_func()

    Linus Torvalds
     

03 Mar, 2017

2 commits

  • Early trace callgraphs can be extremely large on systems with
    several seconds of boot time. The max_depth parameter limits how
    deep the graph trace goes and reduces the output size. This
    parameter is the same as the max_graph_depth file in tracefs.

    Link: http://lkml.kernel.org/r/1488499935-23216-1-git-send-email-todd.e.brandt@linux.intel.com

    Signed-off-by: Todd Brandt
    [ changed comments about debugfs to tracefs ]
    Signed-off-by: Steven Rostedt (VMware)

    Todd Brandt
     
  • On boot up, if the kernel command line sets a graph funtion with the kernel
    command line options "ftrace_graph_filter" or "ftrace_graph_notrace" then it
    updates the corresponding function graph hash, ftrace_graph_hash or
    ftrace_graph_notrace_hash respectively. Unfortunately, at boot up, these
    variables are pointers to the "EMPTY_HASH" which is a constant used as a
    placeholder when a hash has no entities. The problem was that the comand
    line version to set the hashes updated the actual EMPTY_HASH instead of
    creating a new hash for the function graph. This broke the EMPTY_HASH
    because not only did it modify a constant (not sure how that was allowed to
    happen, except maybe because it was done at early boot, const variables were
    still mutable), but it made the filters have functions listed in them when
    they were actually empty.

    The kernel command line function needs to allocate a new hash for the
    function graph filters and assign the necessary variables to that new hash
    instead.

    Link: http://lkml.kernel.org/r/1488420091.7212.17.camel@linux.intel.com

    Cc: Namhyung Kim
    Fixes: b9b0c831bed2 ("ftrace: Convert graph filter to use hash tables")
    Reported-by: Todd Brandt
    Tested-by: Todd Brandt
    Signed-off-by: Steven Rostedt (VMware)

    Steven Rostedt (VMware)
     

02 Mar, 2017

6 commits


01 Mar, 2017

1 commit

  • We have uses of CONFIG_UPROBE_EVENT and CONFIG_KPROBE_EVENT as
    well as CONFIG_UPROBE_EVENTS and CONFIG_KPROBE_EVENTS.

    Consistently use the plurals.

    Signed-off-by: Anton Blanchard
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Josh Poimboeuf
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: acme@kernel.org
    Cc: alexander.shishkin@linux.intel.com
    Cc: davem@davemloft.net
    Cc: sparclinux@vger.kernel.org
    Link: http://lkml.kernel.org/r/20170216060050.20866-1-anton@ozlabs.org
    Signed-off-by: Ingo Molnar

    Anton Blanchard
     

28 Feb, 2017

3 commits

  • Pull another tracing update from Steven Rostedt:
    "Commit 79c6f448c8b79c ("tracing: Fix hwlat kthread migration") fixed a
    bug that was caused by a race condition in initializing the hwlat
    thread. When fixing this code, I realized that it should have been
    done differently. Instead of doing the rewrite and sending that to
    stable, I just sent the above commit to fix the bug that should be
    back ported.

    This commit is on top of the quick fix commit to rewrite the code the
    way it should have been written in the first place"

    * tag 'trace-v4.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
    tracing: Clean up the hwlat binding code

    Linus Torvalds
     
  • Pull tracing updates from Steven Rostedt:
    "This release has no new tracing features, just clean ups, minor fixes
    and small optimizations"

    * tag 'trace-v4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (25 commits)
    tracing: Remove outdated ring buffer comment
    tracing/probes: Fix a warning message to show correct maximum length
    tracing: Fix return value check in trace_benchmark_reg()
    tracing: Use modern function declaration
    jump_label: Reduce the size of struct static_key
    tracing/probe: Show subsystem name in messages
    tracing/hwlat: Update old comment about migration
    timers: Make flags output in the timer_start tracepoint useful
    tracing: Have traceprobe_probes_write() not access userspace unnecessarily
    tracing: Have COMM event filter key be treated as a string
    ftrace: Have set_graph_function handle multiple functions in one write
    ftrace: Do not hold references of ftrace_graph_{notrace_}hash out of graph_lock
    tracing: Reset parser->buffer to allow multiple "puts"
    ftrace: Have set_graph_functions handle write with RDWR
    ftrace: Reset fgd->hash in ftrace_graph_write()
    ftrace: Replace (void *)1 with a meaningful macro name FTRACE_GRAPH_EMPTY
    ftrace: Create a slight optimization on searching the ftrace_hash
    tracing: Add ftrace_hash_key() helper function
    ftrace: Convert graph filter to use hash tables
    ftrace: Expose ftrace_hash_empty and ftrace_lookup_ip
    ...

    Linus Torvalds
     
  • There is no function 'ftrace_ops_recurs_func' existing in the current code,
    it was renamed to ftrace_ops_assist_func() in commit c68c0fa29341
    ("ftrace: Have ftrace_ops_get_func() handle RCU and PER_CPU flags too").
    Update the comment to the correct function name.

    Link: http://lkml.kernel.org/r/1487723366-14463-1-git-send-email-chuhu@redhat.com

    Signed-off-by: Chunyu Hu
    Signed-off-by: Steven Rostedt (VMware)

    Chunyu Hu
     

24 Feb, 2017

1 commit

  • Pull namespace updates from Eric Biederman:
    "There is a lot here. A lot of these changes result in subtle user
    visible differences in kernel behavior. I don't expect anything will
    care but I will revert/fix things immediately if any regressions show
    up.

    From Seth Forshee there is a continuation of the work to make the vfs
    ready for unpriviled mounts. We had thought the previous changes
    prevented the creation of files outside of s_user_ns of a filesystem,
    but it turns we missed the O_CREAT path. Ooops.

    Pavel Tikhomirov and Oleg Nesterov worked together to fix a long
    standing bug in the implemenation of PR_SET_CHILD_SUBREAPER where only
    children that are forked after the prctl are considered and not
    children forked before the prctl. The only known user of this prctl
    systemd forks all children after the prctl. So no userspace
    regressions will occur. Holding earlier forked children to the same
    rules as later forked children creates a semantic that is sane enough
    to allow checkpoing of processes that use this feature.

    There is a long delayed change by Nikolay Borisov to limit inotify
    instances inside a user namespace.

    Michael Kerrisk extends the API for files used to maniuplate
    namespaces with two new trivial ioctls to allow discovery of the
    hierachy and properties of namespaces.

    Konstantin Khlebnikov with the help of Al Viro adds code that when a
    network namespace exits purges it's sysctl entries from the dcache. As
    in some circumstances this could use a lot of memory.

    Vivek Goyal fixed a bug with stacked filesystems where the permissions
    on the wrong inode were being checked.

    I continue previous work on ptracing across exec. Allowing a file to
    be setuid across exec while being ptraced if the tracer has enough
    credentials in the user namespace, and if the process has CAP_SETUID
    in it's own namespace. Proc files for setuid or otherwise undumpable
    executables are now owned by the root in the user namespace of their
    mm. Allowing debugging of setuid applications in containers to work
    better.

    A bug I introduced with permission checking and automount is now
    fixed. The big change is to mark the mounts that the kernel initiates
    as a result of an automount. This allows the permission checks in sget
    to be safely suppressed for this kind of mount. As the permission
    check happened when the original filesystem was mounted.

    Finally a special case in the mount namespace is removed preventing
    unbounded chains in the mount hash table, and making the semantics
    simpler which benefits CRIU.

    The vfs fix along with related work in ima and evm I believe makes us
    ready to finish developing and merge fully unprivileged mounts of the
    fuse filesystem. The cleanups of the mount namespace makes discussing
    how to fix the worst case complexity of umount. The stacked filesystem
    fixes pave the way for adding multiple mappings for the filesystem
    uids so that efficient and safer containers can be implemented"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
    proc/sysctl: Don't grab i_lock under sysctl_lock.
    vfs: Use upper filesystem inode in bprm_fill_uid()
    proc/sysctl: prune stale dentries during unregistering
    mnt: Tuck mounts under others instead of creating shadow/side mounts.
    prctl: propagate has_child_subreaper flag to every descendant
    introduce the walk_process_tree() helper
    nsfs: Add an ioctl() to return owner UID of a userns
    fs: Better permission checking for submounts
    exit: fix the setns() && PR_SET_CHILD_SUBREAPER interaction
    vfs: open() with O_CREAT should not create inodes with unknown ids
    nsfs: Add an ioctl() to return the namespace type
    proc: Better ownership of files for non-dumpable tasks in user namespaces
    exec: Remove LSM_UNSAFE_PTRACE_CAP
    exec: Test the ptracer's saved cred to see if the tracee can gain caps
    exec: Don't reset euid and egid when the tracee has CAP_SETUID
    inotify: Convert to using per-namespace limits

    Linus Torvalds
     

23 Feb, 2017

2 commits

  • Patch series "DAX tracepoints, mm argument simplification", v4.

    This contains both my DAX tracepoint code and Dave Jiang's MM argument
    simplifications. Dave's code was written with my tracepoint code as a
    baseline, so it seemed simplest to keep them together in a single series.

    This patch (of 7):

    Add __print_flags_u64() and the helper trace_print_flags_seq_u64() in the
    same spirit as __print_symbolic_u64() and trace_print_symbols_seq_u64().
    These functions allow us to print symbols associated with flags that are
    64 bits wide even on 32 bit machines.

    These will be used by the DAX code so that we can print the flags set in a
    pfn_t such as PFN_SG_CHAIN, PFN_SG_LAST, PFN_DEV and PFN_MAP.

    Without this new function I was getting errors like the following when
    compiling for i386:

    include/linux/pfn_t.h:13:22: warning: large integer implicitly truncated to unsigned type [-Woverflow]
    #define PFN_SG_CHAIN (1ULL << (BITS_PER_LONG_LONG - 1))
    ^

    Link: http://lkml.kernel.org/r/1484085142-2297-2-git-send-email-ross.zwisler@linux.intel.com
    Signed-off-by: Ross Zwisler
    Reviewed-by: Steven Rostedt
    Cc: Dave Chinner
    Cc: Dave Jiang
    Cc: Jan Kara
    Cc: Matthew Wilcox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ross Zwisler
     
  • Pull networking updates from David Miller:
    "Highlights:

    1) Support TX_RING in AF_PACKET TPACKET_V3 mode, from Sowmini
    Varadhan.

    2) Simplify classifier state on sk_buff in order to shrink it a bit.
    From Willem de Bruijn.

    3) Introduce SIPHASH and it's usage for secure sequence numbers and
    syncookies. From Jason A. Donenfeld.

    4) Reduce CPU usage for ICMP replies we are going to limit or
    suppress, from Jesper Dangaard Brouer.

    5) Introduce Shared Memory Communications socket layer, from Ursula
    Braun.

    6) Add RACK loss detection and allow it to actually trigger fast
    recovery instead of just assisting after other algorithms have
    triggered it. From Yuchung Cheng.

    7) Add xmit_more and BQL support to mvneta driver, from Simon Guinot.

    8) skb_cow_data avoidance in esp4 and esp6, from Steffen Klassert.

    9) Export MPLS packet stats via netlink, from Robert Shearman.

    10) Significantly improve inet port bind conflict handling, especially
    when an application is restarted and changes it's setting of
    reuseport. From Josef Bacik.

    11) Implement TX batching in vhost_net, from Jason Wang.

    12) Extend the dummy device so that VF (virtual function) features,
    such as configuration, can be more easily tested. From Phil
    Sutter.

    13) Avoid two atomic ops per page on x86 in bnx2x driver, from Eric
    Dumazet.

    14) Add new bpf MAP, implementing a longest prefix match trie. From
    Daniel Mack.

    15) Packet sample offloading support in mlxsw driver, from Yotam Gigi.

    16) Add new aquantia driver, from David VomLehn.

    17) Add bpf tracepoints, from Daniel Borkmann.

    18) Add support for port mirroring to b53 and bcm_sf2 drivers, from
    Florian Fainelli.

    19) Remove custom busy polling in many drivers, it is done in the core
    networking since 4.5 times. From Eric Dumazet.

    20) Support XDP adjust_head in virtio_net, from John Fastabend.

    21) Fix several major holes in neighbour entry confirmation, from
    Julian Anastasov.

    22) Add XDP support to bnxt_en driver, from Michael Chan.

    23) VXLAN offloads for enic driver, from Govindarajulu Varadarajan.

    24) Add IPVTAP driver (IP-VLAN based tap driver) from Sainath Grandhi.

    25) Support GRO in IPSEC protocols, from Steffen Klassert"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1764 commits)
    Revert "ath10k: Search SMBIOS for OEM board file extension"
    net: socket: fix recvmmsg not returning error from sock_error
    bnxt_en: use eth_hw_addr_random()
    bpf: fix unlocking of jited image when module ronx not set
    arch: add ARCH_HAS_SET_MEMORY config
    net: napi_watchdog() can use napi_schedule_irqoff()
    tcp: Revert "tcp: tcp_probe: use spin_lock_bh()"
    net/hsr: use eth_hw_addr_random()
    net: mvpp2: enable building on 64-bit platforms
    net: mvpp2: switch to build_skb() in the RX path
    net: mvpp2: simplify MVPP2_PRS_RI_* definitions
    net: mvpp2: fix indentation of MVPP2_EXT_GLOBAL_CTRL_DEFAULT
    net: mvpp2: remove unused register definitions
    net: mvpp2: simplify mvpp2_bm_bufs_add()
    net: mvpp2: drop useless fields in mvpp2_bm_pool and related code
    net: mvpp2: remove unused 'tx_skb' field of 'struct mvpp2_tx_queue'
    net: mvpp2: release reference to txq_cpu[] entry after unmapping
    net: mvpp2: handle too large value in mvpp2_rx_time_coal_set()
    net: mvpp2: handle too large value handling in mvpp2_rx_pkts_coal_set()
    net: mvpp2: remove useless arguments in mvpp2_rx_{pkts, time}_coal_set
    ...

    Linus Torvalds
     

18 Feb, 2017

2 commits


17 Feb, 2017

1 commit


15 Feb, 2017

6 commits

  • Since tracing/*probe_events will accept a probe definition
    up to 4096 - 2 ('\n' and '\0') bytes, it must show 4094 instead
    of 4096 in warning message.

    Note that there is one possible case of exceed 4094. If user
    prepare 4096 bytes null-terminated string and syscall write
    it with the count == 4095, then it can be accepted. However,
    if user puts a '\n' after that, it must rejected.
    So IMHO, the warning message should indicate shorter one,
    since it is safer.

    Link: http://lkml.kernel.org/r/148673290462.2579.7966778294009665632.stgit@devbox

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     
  • In case of error, the function kthread_run() returns ERR_PTR() and never
    returns NULL. The NULL test in the return value check should be replaced
    with IS_ERR().

    Link: http://lkml.kernel.org/r/20170112135502.28556-1-weiyj.lk@gmail.com

    Cc: stable@vger.kernel.org
    Fixes: 81dc9f0e ("tracing: Add tracepoint benchmark tracepoint")
    Signed-off-by: Wei Yongjun
    Signed-off-by: Steven Rostedt (VMware)

    Wei Yongjun
     
  • We get a lot of harmless warnings about this header file at W=1 level
    because of an unusual function declaration:

    kernel/trace/trace.h:766:1: error: 'inline' is not at beginning of declaration [-Werror=old-style-declaration]

    This moves the inline statement where it normally belongs, avoiding the
    warning.

    Link: http://lkml.kernel.org/r/20170123122521.3389010-1-arnd@arndb.de

    Fixes: 4046bf023b06 ("ftrace: Expose ftrace_hash_empty and ftrace_lookup_ip")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Steven Rostedt (VMware)

    Arnd Bergmann
     
  • Show "trace_probe:", "trace_kprobe:" and "trace_uprobe:"
    headers for each warning/error/info message. This will
    help people to notice that kprobe/uprobe events caused
    those messages.

    Link: http://lkml.kernel.org/r/148646647813.24658.16705315294927615333.stgit@devbox

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     
  • The ftrace hwlat does support a cpumask.

    Link: http://lkml.kernel.org/r/20170213122517.6e211955@redhat.com

    Signed-off-by: Luiz Capitulino
    Signed-off-by: Steven Rostedt (VMware)

    Luiz Capitulino
     
  • The code in traceprobe_probes_write() reads up to 4096 bytes from userpace
    for each line. If userspace passes in several lines to execute, the code
    will do a large read for each line, even though, it is highly likely that
    the first read from userspace received all of the lines at once.

    I changed the logic to do a single read from userspace, and to only read
    from userspace again if not all of the read from userspace made it in.

    I tested this by adding printk()s and writing files that would test -1, ==,
    and +1 the buffer size, to make sure that there's no overflows and that if a
    single line is written with +1 the buffer size, that it fails properly.

    Link: http://lkml.kernel.org/r/20170209180458.5c829ab2@gandalf.local.home

    Acked-by: Masami Hiramatsu
    Acked-by: Namhyung Kim
    Signed-off-by: Steven Rostedt (VMware)

    Steven Rostedt (VMware)
     

11 Feb, 2017

1 commit


08 Feb, 2017

1 commit


04 Feb, 2017

1 commit

  • Steven suggested to improve trace_print_hex_seq() a bit after commit
    2acae0d5b0f7 ("trace: add variant without spacing in trace_print_hex_seq")
    in two ways: i) by adding a kdoc comment for the helper function
    itself and ii) by renaming 'spacing' argument into 'concatenate'
    to better denote that we don't add spaces between each hex bytes.

    Suggested-by: Steven Rostedt
    Signed-off-by: Daniel Borkmann
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

03 Feb, 2017

10 commits

  • Currently, only one function can be written to set_graph_function and
    set_graph_notrace. The last function in the list will have saved, even
    though other functions will be added then removed.

    Change the behavior to be the same as set_ftrace_function as to allow
    multiple functions to be written. If any one fails, none of them will be
    added. The addition of the functions are done at the end when the file is
    closed.

    Acked-by: Namhyung Kim
    Signed-off-by: Steven Rostedt (VMware)

    Steven Rostedt (VMware)
     
  • The hashs ftrace_graph_hash and ftrace_graph_notrace_hash are modified
    within the graph_lock being held. Holding a pointer to them and passing them
    along can lead to a use of a stale pointer (fgd->hash). Move assigning the
    pointer and its use to within the holding of the lock. Note, it's an
    rcu_sched protected data, and other instances of referencing them are done
    with preemption disabled. But the file manipuation code must be protected by
    the lock.

    The fgd->hash pointer is set to NULL when the lock is being released.

    Acked-by: Namhyung Kim
    Signed-off-by: Steven Rostedt (VMware)

    Steven Rostedt (VMware)
     
  • trace_parser_put() simply frees the allocated parser buffer. But it does not
    reset the pointer that was freed. This means that if trace_parser_put() is
    called on the same parser more than once, it will corrupt the allocation
    system. Setting parser->buffer to NULL after free allows it to be called
    more than once without any ill effect.

    Acked-by: Namhyung Kim
    Signed-off-by: Steven Rostedt (VMware)

    Steven Rostedt (VMware)
     
  • Since reading the set_graph_functions uses seq functions, which sets the
    file->private_data pointer to a seq_file descriptor. On writes the
    ftrace_graph_data descriptor is set to file->private_data. But if the file
    is opened for RDWR, the ftrace_graph_write() will incorrectly use the
    file->private_data descriptor instead of
    ((struct seq_file *)file->private_data)->private pointer, and this can crash
    the kernel.

    Acked-by: Namhyung Kim
    Signed-off-by: Steven Rostedt (VMware)

    Steven Rostedt (VMware)
     
  • fgd->hash is saved and then freed, but is never reset to either
    ftrace_graph_hash nor ftrace_graph_notrace_hash. But if multiple writes are
    performed, then the freed hash could be accessed again.

    # cd /sys/kernel/debug/tracing
    # head -1000 available_filter_functions > /tmp/funcs
    # cat /tmp/funcs > set_graph_function

    Causes:

    general protection fault: 0000 [#1] SMP DEBUG_PAGEALLOC
    Modules linked in: [...]
    CPU: 2 PID: 1337 Comm: cat Not tainted 4.10.0-rc2-test-00010-g6b052e9 #32
    Hardware name: Hewlett-Packard HP Compaq Pro 6300 SFF/339A, BIOS K01 v02.05 05/07/2012
    task: ffff880113a12200 task.stack: ffffc90001940000
    RIP: 0010:free_ftrace_hash+0x7c/0x160
    RSP: 0018:ffffc90001943db0 EFLAGS: 00010246
    RAX: 6b6b6b6b6b6b6b6b RBX: 6b6b6b6b6b6b6b6b RCX: 6b6b6b6b6b6b6b6b
    RDX: 0000000000000002 RSI: 0000000000000001 RDI: ffff8800ce1e1d40
    RBP: ffff8800ce1e1d50 R08: 0000000000000000 R09: 0000000000006400
    R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
    R13: ffff8800ce1e1d40 R14: 0000000000004000 R15: 0000000000000001
    FS: 00007f9408a07740(0000) GS:ffff88011e500000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000000000aee1f0 CR3: 0000000116bb4000 CR4: 00000000001406e0
    Call Trace:
    ? ftrace_graph_write+0x150/0x190
    ? __vfs_write+0x1f6/0x210
    ? __audit_syscall_entry+0x17f/0x200
    ? rw_verify_area+0xdb/0x210
    ? _cond_resched+0x2b/0x50
    ? __sb_start_write+0xb4/0x130
    ? vfs_write+0x1c8/0x330
    ? SyS_write+0x62/0xf0
    ? do_syscall_64+0xa3/0x1b0
    ? entry_SYSCALL64_slow_path+0x25/0x25
    Code: 01 48 85 db 0f 84 92 00 00 00 b8 01 00 00 00 d3 e0 85 c0 7e 3f 83 e8 01 48 8d 6f 10 45 31 e4 4c 8d 34 c5 08 00 00 00 49 8b 45 08 8b 34 20 48 85 f6 74 13 48 8b 1e 48 89 ef e8 20 fa ff ff 48
    RIP: free_ftrace_hash+0x7c/0x160 RSP: ffffc90001943db0
    ---[ end trace 999b48216bf4b393 ]---

    Acked-by: Namhyung Kim
    Signed-off-by: Steven Rostedt (VMware)

    Steven Rostedt (VMware)
     
  • When the set_graph_function or set_graph_notrace contains no records, a
    banner is displayed of either "#### all functions enabled ####" or
    "#### all functions disabled ####" respectively. To tell the seq operations
    to do this, (void *)1 is passed as a return value. Instead of using a
    hardcoded meaningless variable, define it as a macro.

    Acked-by: Namhyung Kim
    Signed-off-by: Steven Rostedt (VMware)

    Steven Rostedt (VMware)
     
  • This is a micro-optimization, but as it has to deal with a fast path of the
    function tracer, these optimizations can be noticed.

    The ftrace_lookup_ip() returns true if the given ip is found in the hash. If
    it's not found or the hash is NULL, it returns false. But there's some cases
    that a NULL hash is a true, and the ftrace_hash_empty() is tested before
    calling ftrace_lookup_ip() in those cases. But as ftrace_lookup_ip() tests
    that first, that adds a few extra unneeded instructions in those cases.

    A new static "always_inlined" function is created that does not perform the
    hash empty test. This most only be used by callers that do the check first
    anyway, as an empty or NULL hash could cause a crash if a lookup is
    performed on it.

    Also add kernel doc for the ftrace_lookup_ip() main function.

    Acked-by: Namhyung Kim
    Signed-off-by: Steven Rostedt (VMware)

    Steven Rostedt (VMware)
     
  • Replace the couple of use cases that has small logic to produce the ftrace
    function key id with a helper function. No need for duplicate code.

    Acked-by: Namhyung Kim
    Signed-off-by: Steven Rostedt (VMware)

    Steven Rostedt (VMware)
     
  • All merge conflicts were simple overlapping changes.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • We may already have a directory to put the blktrace stuff in if

    1. The disk uses blk-mq
    2. CONFIG_BLK_DEBUG_FS is enabled
    3. We are tracing the whole disk and not a partition

    Instead of hardcoding this very specific case, let's use the new
    debugfs_lookup(). If the directory exists, we use it, otherwise we
    create one and clean it up later.

    Fixes: 07e4fead45e6 ("blk-mq: create debugfs directory tree")
    Signed-off-by: Omar Sandoval
    Signed-off-by: Jens Axboe

    Omar Sandoval