20 Sep, 2016

1 commit

  • Install the callbacks via the state machine and let the core invoke
    the callbacks on the already online CPUs.
    Since the online target runs always on the target CPU we can drop
    smp_call_function_single(). The functions is invoked with interrupts off to
    keep the old calling convention. If the maintainer things that this function
    can be called with interrupts enabled then it can be removed :)

    Signed-off-by: Sebastian Andrzej Siewior
    Cc: Robert Richter
    Cc: Peter Zijlstra
    Cc: oprofile-list@lists.sf.net
    Cc: rt@linutronix.de
    Link: http://lkml.kernel.org/r/20160906170457.32393-10-bigeasy@linutronix.de
    Signed-off-by: Thomas Gleixner

    Sebastian Andrzej Siewior
     

27 Aug, 2014

1 commit


15 Jul, 2013

1 commit

  • The __cpuinit type of throwaway sections might have made sense
    some time ago when RAM was more constrained, but now the savings
    do not offset the cost and complications. For example, the fix in
    commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
    is a good example of the nasty type of bugs that can be created
    with improper use of the various __init prefixes.

    After a discussion on LKML[1] it was decided that cpuinit should go
    the way of devinit and be phased out. Once all the users are gone,
    we can then finally remove the macros themselves from linux/init.h.

    This removes all the remaining one-off uses of the __cpuinit macros
    from all C files in the drivers/* directory.

    [1] https://lkml.org/lkml/2013/5/20/589

    Cc: Greg Kroah-Hartman
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

04 Nov, 2011

2 commits

  • Remove exit functions by moving init/exit code to oprofile's setup/
    shutdown functions. Doing so the oprofile module exit code will be
    easier and less error-prone.

    Signed-off-by: Robert Richter

    Robert Richter
     
  • Oprofile may crash in a KVM guest while unlaoding modules. This
    happens if oprofile_arch_init() fails and oprofile switches to the hr
    timer mode as a fallback. In this case oprofile_arch_exit() is called,
    but it never was initialized properly which causes the crash. This
    patch fixes this.

    oprofile: using timer interrupt.
    BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
    IP: [] unregister_syscore_ops+0x41/0x58
    PGD 41da3f067 PUD 41d80e067 PMD 0
    Oops: 0002 [#1] PREEMPT SMP
    CPU 5
    Modules linked in: oprofile(-)

    Pid: 2382, comm: modprobe Not tainted 3.1.0-rc7-00018-g709a39d #18 Advanced Micro Device Anaheim/Anaheim
    RIP: 0010:[] [] unregister_syscore_ops+0x41/0x58
    RSP: 0018:ffff88041de1de98 EFLAGS: 00010296
    RAX: 0000000000000000 RBX: ffffffffa00060e0 RCX: dead000000200200
    RDX: 0000000000000000 RSI: dead000000100100 RDI: ffffffff8178c620
    RBP: ffff88041de1dea8 R08: 0000000000000001 R09: 0000000000000082
    R10: 0000000000000000 R11: ffff88041de1dde8 R12: 0000000000000080
    R13: fffffffffffffff5 R14: 0000000000000001 R15: 0000000000610210
    FS: 00007f9ae5bef700(0000) GS:ffff88042fd40000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: 0000000000000008 CR3: 000000041ca44000 CR4: 00000000000006e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Process modprobe (pid: 2382, threadinfo ffff88041de1c000, task ffff88042db6d040)
    Stack:
    ffff88041de1deb8 ffffffffa0006770 ffff88041de1deb8 ffffffffa000251e
    ffff88041de1dec8 ffffffffa00022c2 ffff88041de1ded8 ffffffffa0004993
    ffff88041de1df78 ffffffff81073115 656c69666f72706f 0000000000610200
    Call Trace:
    [] op_nmi_exit+0x15/0x17 [oprofile]
    [] oprofile_arch_exit+0xe/0x10 [oprofile]
    [] oprofile_exit+0x13/0x15 [oprofile]
    [] sys_delete_module+0x1c3/0x22f
    [] ? trace_hardirqs_on_thunk+0x3a/0x3f
    [] system_call_fastpath+0x16/0x1b
    Code: 20 c6 78 81 e8 c5 cc 23 00 48 8b 13 48 8b 43 08 48 be 00 01 10 00 00 00 ad de 48 b9 00 02 20 00 00 00 ad de 48 c7 c7 20 c6 78 81
    89 42 08 48 89 10 48 89 33 48 89 4b 08 e8 a6 c0 23 00 5a 5b
    RIP [] unregister_syscore_ops+0x41/0x58
    RSP
    CR2: 0000000000000008
    ---[ end trace 06d4e95b6aa3b437 ]---

    CC: stable@kernel.org # 2.6.37+
    Signed-off-by: Robert Richter

    Robert Richter
     

15 Feb, 2011

2 commits

  • This patch is a rework of the hwsampler oprofile implementation that
    has been applied recently. Now there are less non-architectural
    changes. The only changes are:

    * introduction of oprofile_add_ext_hw_sample(), and
    * removal of section attributes of oprofile_timer_init/_exit().

    To setup hwsampler for oprofile we need to modify start()/stop()
    callbacks and additional hwsampler control files in oprofilefs. We do
    not reinitialize the timer or hwsampler mode by restarting calling
    init/exit() anymore, instead hwsampler_running is used to switch the
    mode directly in oprofile_hwsampler_start/_stop(). For locking reasons
    there is also hwsampler_file that reflects the value in oprofilefs.

    The overall diffstat of the oprofile s390 hwsampler implemenation
    shows the low impact to non-architectural code:

    arch/Kconfig | 3 +
    arch/s390/Kconfig | 1 +
    arch/s390/oprofile/Makefile | 2 +-
    arch/s390/oprofile/hwsampler.c | 1256 ++++++++++++++++++++++++++++++++++
    arch/s390/oprofile/hwsampler.h | 113 +++
    arch/s390/oprofile/hwsampler_files.c | 162 +++++
    arch/s390/oprofile/init.c | 6 +-
    drivers/oprofile/cpu_buffer.c | 24 +-
    drivers/oprofile/timer_int.c | 4 +-
    include/linux/oprofile.h | 7 +
    10 files changed, 1567 insertions(+), 11 deletions(-)

    Acked-by: Heiko Carstens
    Signed-off-by: Robert Richter

    Robert Richter
     
  • OProfile is enhanced to export all files for controlling System z's
    hardware sampling, and to invoke hwsampler exported functions to
    initialize and use System z's hardware sampling.

    The patch invokes hwsampler_setup() during oprofile init and exports
    following hwsampler files under oprofilefs if hwsampler's setup
    succeeded:

    A new directory for hardware sampling based files

    /dev/oprofile/hwsampling/

    The userland daemon must explicitly write to the following files
    to disable (or enable) hardware based sampling

    /dev/oprofile/hwsampling/hwsampler

    to modify the actual sampling rate

    /dev/oprofile/hwsampling/hw_interval

    to modify the amount of sampling memory (measured in 4K pages)

    /dev/oprofile/hwsampling/hw_sdbt_blocks

    The following files are read only and show
    the possible minimum sampling rate

    /dev/oprofile/hwsampling/hw_min_interval

    the possible maximum sampling rate

    /dev/oprofile/hwsampling/hw_max_interval

    The patch splits the oprofile_timer_[init/exit] function so that it
    can be also called through user context (oprofilefs) to avoid kernel
    oops.

    Applied with following changes:
    * whitespace changes in Makefile and timer_int.c

    Signed-off-by: Mahesh Salgaonkar
    Signed-off-by: Maran Pakkirisamy
    Signed-off-by: Heinz Graalfs
    Acked-by: Heiko Carstens
    Signed-off-by: Robert Richter

    Heinz Graalfs
     

29 Oct, 2010

1 commit

  • The kernel build with CONFIG_OPROFILE and CPU_HOTPLUG enabled.
    The oprofile is initialised using system timer in absence of hardware
    counters supports. Oprofile isn't started from userland.

    In this setup while doing a CPU offline the kernel hangs in infinite
    for loop inside lock_hrtimer_base() function

    This happens because as part of oprofile_cpu_notify(, it tries to
    stop an hrtimer which was never started. These per-cpu hrtimers
    are started when the oprfile is started.
    echo 1 > /dev/oprofile/enable

    This problem also existwhen the cpu is booted with maxcpus parameter
    set. When bringing the remaining cpus online the timers are started
    even if oprofile is not yet enabled.

    This patch fix this issue by adding a state variable so that
    these hrtimer start/stop is only attempted when oprofile is
    started

    For stable kernels v2.6.35.y and v2.6.36.y.

    Reported-by: Jan Sebastien
    Tested-by: sricharan
    Signed-off-by: Santosh Shilimkar
    Cc: stable@kernel.org
    Signed-off-by: Robert Richter

    Santosh Shilimkar
     

03 Mar, 2010

1 commit

  • Oprofile is currently broken on systems running with NOHZ enabled.
    A maximum of 1 tick is accounted via the timer_hook if a cpu sleeps
    for a longer period of time. This does bad things to the percentages
    in the profiler output. To solve this problem convert oprofile to
    use a restarting hrtimer instead of the timer_hook.

    Signed-off-by: Martin Schwidefsky
    Signed-off-by: Robert Richter

    Martin Schwidefsky
     

16 Oct, 2008

2 commits


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds