15 Oct, 2020

1 commit

  • Pull kernel_clone() updates from Christian Brauner:
    "During the v5.9 merge window we reworked the process creation
    codepaths across multiple architectures. After this work we were only
    left with the _do_fork() helper based on the struct kernel_clone_args
    calling convention. As was pointed out _do_fork() isn't valid
    kernelese especially for a helper that isn't just static.

    This series removes the _do_fork() helper and introduces the new
    kernel_clone() helper. The process creation cleanup didn't change the
    name to something more reasonable mainly because _do_fork() was used
    in quite a few places. So sending this as a separate series seemed the
    better strategy.

    I originally intended to send this early in the v5.9 development cycle
    after the merge window had closed but given that this was touching
    quite a few places I decided to defer this until the v5.10 merge
    window"

    * tag 'kernel-clone-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
    sched: remove _do_fork()
    tracing: switch to kernel_clone()
    kgdbts: switch to kernel_clone()
    kprobes: switch to kernel_clone()
    x86: switch to kernel_clone()
    sparc: switch to kernel_clone()
    nios2: switch to kernel_clone()
    m68k: switch to kernel_clone()
    ia64: switch to kernel_clone()
    h8300: switch to kernel_clone()
    fork: introduce kernel_clone()

    Linus Torvalds
     

11 Sep, 2020

1 commit


20 Aug, 2020

2 commits

  • The old _do_fork() helper is removed in favor of the new kernel_clone() helper.
    The latter adheres to naming conventions for kernel internal syscall helpers.

    Signed-off-by: Christian Brauner
    Cc: Mauro Carvalho Chehab
    Cc: Alexandre Chartre
    Cc: Jonathan Corbet
    Cc: Thomas Gleixner
    Cc: Masami Hiramatsu
    Cc: Shuah Khan
    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Cc: Xiao Yang
    Cc: Tom Zanussi
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kselftest@vger.kernel.org
    Link: https://lore.kernel.org/r/20200819104655.436656-11-christian.brauner@ubuntu.com

    Christian Brauner
     
  • The old _do_fork() helper is removed in favor of the new kernel_clone() helper.
    The latter adheres to naming conventions for kernel internal syscall helpers.

    Signed-off-by: Christian Brauner
    Cc: Mauro Carvalho Chehab
    Cc: Alexandre Chartre
    Cc: Jonathan Corbet
    Cc: Masami Hiramatsu
    Link: https://lore.kernel.org/r/20200819104655.436656-9-christian.brauner@ubuntu.com

    Christian Brauner
     

20 Jun, 2020

1 commit

  • There are several files that I was unable to find a proper place
    for them, and 3 ones that are still in plain old text format.

    Let's place those stuff behind the carpet, as we'd like to keep the
    root directory clean.

    We can later discuss and move those into better places.

    Signed-off-by: Mauro Carvalho Chehab
    Link: https://lore.kernel.org/r/11bd0d75e65a874f7c276a0aeab0fe13f3376f5f.1592203650.git.mchehab+huawei@kernel.org
    Signed-off-by: Jonathan Corbet

    Mauro Carvalho Chehab
     

12 May, 2020

1 commit


21 May, 2019

2 commits


16 Mar, 2018

1 commit

  • The Tile architecture port was added by Chris Metcalf in 2010, and
    maintained until early 2018 when he orphaned it due to his departure
    from Mellanox, and nobody else stepped up to maintain it. The product
    line is still around in the form of the BlueField SoC, but no longer
    uses the Tile architecture.

    There are also still products for sale with Tile-GX SoCs, notably the
    Mikrotik CCR router family. The products all use old (linux-3.3) kernels
    with lots of patches and won't be upgraded by their manufacturers. There
    have been efforts to port both OpenWRT and Debian to these, but both
    projects have stalled and are very unlikely to be continued in the future.

    Given that we are reasonably sure that nobody is still using the port
    with an upstream kernel any more, it seems better to remove it now while
    the port is in a good shape than to let it bitrot for a few years first.

    Cc: Chris Metcalf
    Cc: John Paul Adrian Glaubitz
    Link: http://www.mellanox.com/page/npu_multicore_overview
    Link: https://jenkins.debian.net/view/rebootstrap/job/rebootstrap_tilegx_gcc7/
    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     

14 Nov, 2017

1 commit

  • Pull perf updates from Ingo Molnar:
    "The main changes in this cycle were:

    Kernel:

    - kprobes updates: use better W^X patterns for code modifications,
    improve optprobes, remove jprobes. (Masami Hiramatsu, Kees Cook)

    - core fixes: event timekeeping (enabled/running times statistics)
    fixes, perf_event_read() locking fixes and cleanups, etc. (Peter
    Zijlstra)

    - Extend x86 Intel free-running PEBS support and support x86
    user-register sampling in perf record and perf script. (Andi Kleen)

    Tooling:

    - Completely rework the way inline frames are handled. Instead of
    querying for the inline nodes on-demand in the individual tools, we
    now create proper callchain nodes for inlined frames. (Milian
    Wolff)

    - 'perf trace' updates (Arnaldo Carvalho de Melo)

    - Implement a way to print formatted output to per-event files in
    'perf script' to facilitate generate flamegraphs, elliminating the
    need to write scripts to do that separation (yuzhoujian, Arnaldo
    Carvalho de Melo)

    - Update vendor events JSON metrics for Intel's Broadwell, Broadwell
    Server, Haswell, Haswell Server, IvyBridge, IvyTown, JakeTown,
    Sandy Bridge, Skylake, SkyLake Server - and Goldmont Plus V1 (Andi
    Kleen, Kan Liang)

    - Multithread the synthesizing of PERF_RECORD_ events for
    pre-existing threads in 'perf top', speeding up that phase, greatly
    improving the user experience in systems such as Intel's Knights
    Mill (Kan Liang)

    - Introduce the concept of weak groups in 'perf stat': try to set up
    a group, but if it's not schedulable fallback to not using a group.
    That gives us the best of both worlds: groups if they work, but
    still a usable fallback if they don't. E.g: (Andi Kleen)

    - perf sched timehist enhancements (David Ahern)

    - ... various other enhancements, updates, cleanups and fixes"

    * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (139 commits)
    kprobes: Don't spam the build log with deprecation warnings
    arm/kprobes: Remove jprobe test case
    arm/kprobes: Fix kretprobe test to check correct counter
    perf srcline: Show correct function name for srcline of callchains
    perf srcline: Fix memory leak in addr2inlines()
    perf trace beauty kcmp: Beautify arguments
    perf trace beauty: Implement pid_fd beautifier
    tools include uapi: Grab a copy of linux/kcmp.h
    perf callchain: Fix double mapping al->addr for children without self period
    perf stat: Make --per-thread update shadow stats to show metrics
    perf stat: Move the shadow stats scale computation in perf_stat__update_shadow_stats
    perf tools: Add perf_data_file__write function
    perf tools: Add struct perf_data_file
    perf tools: Rename struct perf_data_file to perf_data
    perf script: Print information about per-event-dump files
    perf trace beauty prctl: Generate 'option' string table from kernel headers
    tools include uapi: Grab a copy of linux/prctl.h
    perf script: Allow creating per-event dump files
    perf evsel: Restore evsel->priv as a tool private area
    perf script: Use event_format__fprintf()
    ...

    Linus Torvalds
     

20 Oct, 2017

1 commit

  • Remove the jprobes sample module because jprobes are deprecated.

    Signed-off-by: Masami Hiramatsu
    Cc: Alexei Starovoitov
    Cc: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: David S . Miller
    Cc: Ian McDonald
    Cc: Kees Cook
    Cc: Linus Torvalds
    Cc: Paul E . McKenney
    Cc: Peter Zijlstra
    Cc: Stephen Hemminger
    Cc: Steven Rostedt
    Cc: Thomas Gleixner
    Cc: Vlad Yasevich
    Link: http://lkml.kernel.org/r/150724535709.5014.7261513316230565780.stgit@devbox
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     

28 Sep, 2017

1 commit


04 Aug, 2016

4 commits

  • The regs_return_value() returns "unsigned long" or "long" value. But the
    retval is int type now, it may cause overflow, the log may becomes:

    [ 2911.078869] do_brk returned -2003877888 and took 4620 ns to execute

    This patch converts the retval to "unsigned long" type, and fixes the
    overflow issue.

    Link: http://lkml.kernel.org/r/1464143083-3877-4-git-send-email-shijie.huang@arm.com
    Signed-off-by: Huang Shijie
    Cc: Petr Mladek
    Cc: Steve Capper
    Cc: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: Masami Hiramatsu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Huang Shijie
     
  • We prefer to use the pr_* to print out the log now, this patch converts
    the printk to pr_info. In the error path, use the pr_err to replace the
    printk.

    Link: http://lkml.kernel.org/r/1464143083-3877-3-git-send-email-shijie.huang@arm.com
    Signed-off-by: Huang Shijie
    Cc: Petr Mladek
    Cc: Steve Capper
    Cc: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: Masami Hiramatsu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Huang Shijie
     
  • We prefer to use the pr_* to print out the log now, this patch converts
    the printk to pr_info. In the error path, use the pr_err to replace the
    printk.

    Link: http://lkml.kernel.org/r/1464143083-3877-2-git-send-email-shijie.huang@arm.com
    Signed-off-by: Huang Shijie
    Cc: Petr Mladek
    Cc: Steve Capper
    Cc: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: Masami Hiramatsu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Huang Shijie
     
  • We prefer to use the pr_* to print out the log now, this patch converts
    the printk to pr_info. In the error path, use the pr_err to replace the
    printk.

    Link: http://lkml.kernel.org/r/1464143083-3877-1-git-send-email-shijie.huang@arm.com
    Signed-off-by: Huang Shijie
    Cc: Petr Mladek
    Cc: Steve Capper
    Cc: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: Masami Hiramatsu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Huang Shijie
     

19 Jul, 2016

1 commit


21 May, 2016

3 commits

  • Print out the symbol name for the hooks, it makes the logs more
    readable.

    Link: http://lkml.kernel.org/r/1463535417-29637-2-git-send-email-shijie.huang@arm.com
    Signed-off-by: Huang Shijie
    Cc: Petr Mladek
    Cc: Steve Capper
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Huang Shijie
     
  • Add a new module parameter which can be used as the symbol name.

    Without this patch, we can only test the "_do_fork" function with this
    kernel module. With this patch, the module becomes more flexible; we
    can test any functions with this module with

    # insmod kprobe_example.ko symbol="xxx"

    Link: http://lkml.kernel.org/r/1463535417-29637-1-git-send-email-shijie.huang@arm.com
    Signed-off-by: Huang Shijie
    Cc: Petr Mladek
    Cc: Steve Capper
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Huang Shijie
     
  • Commit 3033f14ab78c ("clone: support passing tls argument via C rather
    than pt_regs magic") added the tls argument for _do_fork(). This patch
    adds the "tls" argument for j_do_fork to make it match _do_fork().

    Signed-off-by: Huang Shijie
    Acked-by: Steve Capper
    Reviewed-by: Josh Triplett
    Cc: Masami Hiramatsu
    Cc: Andy Lutomirski
    Cc: Thiago Macieira
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Huang Shijie
     

02 Oct, 2015

1 commit

  • Commit 3033f14ab78c ("clone: support passing tls argument via C rather
    than pt_regs magic") introduced _do_fork() that allowed to pass @tls
    parameter.

    The old do_fork() is defined only for architectures that are not ready
    to use this way and do not define HAVE_COPY_THREAD_TLS.

    Let's use _do_fork() in the kprobe examples to make them work again on
    all architectures.

    Signed-off-by: Petr Mladek
    Cc: Ingo Molnar
    Cc: Masami Hiramatsu
    Cc: Andy Lutomirski
    Cc: Peter Zijlstra
    Cc: "H. Peter Anvin"
    Cc: Thomas Gleixner
    Cc: Thiago Macieira
    Cc: Jiri Kosina
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Petr Mladek
     

26 Sep, 2014

1 commit

  • In commit e80d666 "flagday: kill pt_regs argument of do_fork()", the
    arguments to do_fork() changed.

    The example code in jprobe_example.c was not updated to match, so the
    arguments inside the jprobe handler do not match reality.

    Fix it by updating the arguments to match do_fork(). While we're at it
    use pr_info() for brevity, and print stack_start as well for interest.

    Signed-off-by: Michael Ellerman
    Acked-by: Masami Hiramatsu
    Signed-off-by: Jiri Kosina

    Michael Ellerman
     

30 Aug, 2013

1 commit


05 Aug, 2010

1 commit

  • This KProbes example is a little useless if it doesn't print anything.
    For MIPS print similar messages to those produced on x86 and PPC.

    Signed-off-by: David Daney
    To: linux-mips@linux-mips.org
    To: ananth@in.ibm.com
    To: anil.s.keshavamurthy@intel.com
    To: davem@davemloft.net
    To: masami.hiramatsu.pt@hitachi.com
    Cc: linux-kernel@vger.kernel.org
    Cc: hschauhan@nulltrace.org
    Patchwork: https://patchwork.linux-mips.org/patch/1528/
    Signed-off-by: Ralf Baechle

    David Daney
     

17 Aug, 2009

1 commit


05 Mar, 2008

1 commit

  • Move kprobes examples from Documentation/kprobes.txt to under samples/.
    Patch originally by Randy Dunlap.

    o Updated the patch to apply on 2.6.25-rc3
    o Modified examples code to build on multiple architectures. Currently,
    the kprobe and jprobe examples code works for x86 and powerpc
    o Cleaned up unneeded #includes
    o Cleaned up Kconfig per Sam Ravnborg's suggestions to fix build break
    on archs that don't have kretprobes
    o Implemented suggestions by Mathieu Desnoyers on CONFIG_KRETPROBES
    o Included Andrew Morton's cleanup based on x86-git
    o Modified kretprobe_example to act as a arch-agnostic module to
    determine routine execution times:
    Use 'modprobe kretprobe_example func=' to determine
    execution time of func_name in nanoseconds.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Ananth N Mavinakayanahalli
    Acked-by: Mathieu Desnoyers
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ananth N Mavinakayanahalli