02 May, 2019

1 commit

  • Rework the dump_trace() stack unwinder interface to support different
    unwinding algorithms. The new interface looks like this:

    struct unwind_state state;
    unwind_for_each_frame(&state, task, regs, start_stack)
    do_something(state.sp, state.ip, state.reliable);

    The unwind_bc.c file contains the implementation for the classic
    back-chain unwinder.

    One positive side effect of the new code is it now handles ftraced
    functions gracefully. It prints the real name of the return function
    instead of 'return_to_handler'.

    Signed-off-by: Martin Schwidefsky

    Martin Schwidefsky
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

17 Oct, 2016

1 commit

  • Before merging all different stack tracers the call traces printed had
    an indicator if an entry can be considered reliable or not.
    Unreliable entries were put in braces, reliable not. Currently all
    lines contain these extra braces.

    This patch restores the old behaviour by adding an extra "reliable"
    parameter to the callback functions. Only show_trace makes currently
    use of it.

    Before:
    [ 0.804751] Call Trace:
    [ 0.804753] ([] try_to_wake_up+0x318/0x5e0)
    [ 0.804756] ([] create_worker+0x174/0x1c0)

    After:
    [ 0.804751] Call Trace:
    [ 0.804753] ([] try_to_wake_up+0x318/0x5e0)
    [ 0.804756] [] create_worker+0x174/0x1c0

    Fixes: 758d39ebd3d5 ("s390/dumpstack: merge all four stack tracers")
    Signed-off-by: Heiko Carstens
    Signed-off-by: Martin Schwidefsky

    Heiko Carstens
     

28 Jun, 2016

1 commit

  • Remove hardware sampler support from oprofile module.

    The oprofile user space utilty has been switched to use the kernel
    perf interface, for which we also provide hardware sampling support.

    In addition the hardware sampling support is also slightly broken: it
    supports only 16 bits for the pid and therefore would generate wrong
    results on machines which have a pid >64k.

    Also the pt_regs structure which was passed to oprofile common code
    cannot necessarily be used to generate sane backtraces, since the
    task(s) in question may run while the samples are fed to oprofile.
    So the result would be more or less random.

    However given that the only user space tools switched to the perf
    interface already four years ago the hardware sampler code seems to be
    unused code, and therefore it should be reasonable to remove it.

    The timer based oprofile support continues to work.

    Signed-off-by: Heiko Carstens
    Acked-by: Andreas Arnez
    Acked-by: Andreas Krebbel
    Acked-by: Robert Richter
    Reviewed-by: Hendrik Brueckner
    Signed-off-by: Martin Schwidefsky

    Heiko Carstens
     

24 Feb, 2016

1 commit


23 Feb, 2016

1 commit

  • We have four different stack tracers of which three had bugs. So it's
    time to merge them to a single stack tracer which allows to specify a
    call back function which will be called for each step.

    This patch changes behavior a bit:

    - the "nosched" and "in_sched_functions" check within
    save_stack_trace_tsk did work only for the last stack frame within a
    context. Now it considers the check for each stack frame like it
    should.

    - both the oprofile variant and the perf_events variant did save a
    return address twice if a zero back chain was detected, which
    indicates an interrupt frame. The new dump_trace function will call
    the oprofile and perf_events backends with the psw address that is
    contained within the corresponding pt_regs structure instead.

    - the original show_trace and save_context_stack functions did already
    use the psw address of the pt_regs structure if a zero back chain
    was detected. However now we ignore the psw address if it is a user
    space address. After all we trace the kernel stack and not the user
    space stack. This way we also get rid of the garbage user space
    address in case of warnings and / or panic call traces.

    So this should make life easier since now there is only one stack
    tracer left which we can break.

    Signed-off-by: Heiko Carstens
    Signed-off-by: Martin Schwidefsky

    Heiko Carstens
     

01 Jul, 2015

1 commit

  • Fix these errors when compiling with CONFIG_OPROFILE=y and
    CONFIG_PERF_EVENTS=n:
    arch/s390/oprofile/init.c: In function ‘oprofile_hwsampler_start’:
    arch/s390/oprofile/init.c:93:2: error: implicit declaration of function 'perf_reserve_sampling' [-Werror=implicit-function-declaration]
    retval = perf_reserve_sampling();
    ^
    arch/s390/oprofile/init.c:99:3: error: implicit declaration of function 'perf_release_sampling' [-Werror=implicit-function-declaration]
    perf_release_sampling();
    ^

    Signed-off-by: Sebastian Ott
    Signed-off-by: Martin Schwidefsky

    Sebastian Ott
     

25 Mar, 2015

1 commit

  • Remove the 31 bit support in order to reduce maintenance cost and
    effectively remove dead code. Since a couple of years there is no
    distribution left that comes with a 31 bit kernel.

    The 31 bit kernel also has been broken since more than a year before
    anybody noticed. In addition I added a removal warning to the kernel
    shown at ipl for 5 minutes: a960062e5826 ("s390: add 31 bit warning
    message") which let everybody know about the plan to remove 31 bit
    code. We didn't get any response.

    Given that the last 31 bit only machine was introduced in 1999 let's
    remove the code.
    Anybody with 31 bit user space code can still use the compat mode.

    Signed-off-by: Heiko Carstens
    Signed-off-by: Martin Schwidefsky

    Heiko Carstens
     

16 Dec, 2013

1 commit


04 Sep, 2013

3 commits


26 Jul, 2013

1 commit


06 Apr, 2013

1 commit


27 Aug, 2012

1 commit


20 Jul, 2012

1 commit

  • Remove the file name from the comment at top of many files. In most
    cases the file name was wrong anyway, so it's rather pointless.

    Also unify the IBM copyright statement. We did have a lot of sightly
    different statements and wanted to change them one after another
    whenever a file gets touched. However that never happened. Instead
    people start to take the old/"wrong" statements to use as a template
    for new files.
    So unify all of them in one go.

    Signed-off-by: Heiko Carstens

    Heiko Carstens
     

07 Jan, 2012

1 commit

  • * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (106 commits)
    perf kvm: Fix copy & paste error in description
    perf script: Kill script_spec__delete
    perf top: Fix a memory leak
    perf stat: Introduce get_ratio_color() helper
    perf session: Remove impossible condition check
    perf tools: Fix feature-bits rework fallout, remove unused variable
    perf script: Add generic perl handler to process events
    perf tools: Use for_each_set_bit() to iterate over feature flags
    perf tools: Unify handling of features when writing feature section
    perf report: Accept fifos as input file
    perf tools: Moving code in some files
    perf tools: Fix out-of-bound access to struct perf_session
    perf tools: Continue processing header on unknown features
    perf tools: Improve macros for struct feature_ops
    perf: builtin-record: Document and check that mmap_pages must be a power of two.
    perf: builtin-record: Provide advice if mmap'ing fails with EPERM.
    perf tools: Fix truncated annotation
    perf script: look up thread using tid instead of pid
    perf tools: Look up thread names for system wide profiling
    perf tools: Fix comm for processes with named threads
    ...

    Linus Torvalds
     

20 Dec, 2011

1 commit

  • If oprofilefs_ulong_from_user() is called with count equals
    zero, *val remains unchanged. Depending on the implementation it
    might be uninitialized.

    Change oprofilefs_ulong_from_user()'s interface to return count
    on success. Thus, we are able to return early if count equals
    zero which avoids using *val uninitialized. Fixing all users of
    oprofilefs_ulong_ from_user().

    This follows write syscall implementation when count is zero:
    "If count is zero ... [and if] no errors are detected, 0 will be
    returned without causing any other effect." (man 2 write)

    Reported-By: Mike Waychison
    Signed-off-by: Robert Richter
    Cc: Andrew Morton
    Cc:
    Cc: oprofile-list
    Link: http://lkml.kernel.org/r/20111219153830.GH16765@erda.amd.com
    Signed-off-by: Ingo Molnar

    Robert Richter
     

07 Dec, 2011

2 commits

  • With this patch the OProfile Basic Mode Sampling support for System z
    is enhanced with a counter file system. That way hardware sampling
    can be configured using the user space tools with only little
    modifications.

    With the patch by default new cpu_types (s390/z10, s390/z196) are
    returned in order to indicate that we are running a CPU which provides
    the hardware sampling facility. Existing user space tools will
    complain about an unknown cpu type. In order to be compatible with
    existing user space tools the `cpu_type' module parameter has been
    added. Setting the parameter to `timer' will force the module to
    return `timer' as cpu_type. The module will still try to use hardware
    sampling if available and the hwsampling virtual filesystem will be
    also be available for configuration. So this has a different effect
    than using the generic oprofile module parameter `timer=1'.

    If the basic mode sampling is enabled on the machine and the
    cpu_type=timer parameter is not used the kernel module will provide
    the following virtual filesystem:

    /dev/oprofile/0/enabled
    /dev/oprofile/0/event
    /dev/oprofile/0/count
    /dev/oprofile/0/unit_mask
    /dev/oprofile/0/kernel
    /dev/oprofile/0/user

    In the counter file system only the values of 'enabled', 'count',
    'kernel', and 'user' are evaluated by the kernel module. Everything
    else must contain fixed values.

    The 'event' value only supports a single event - HWSAMPLING with value
    0.

    The 'count' value specifies the hardware sampling rate as it is passed
    to the CPU measurement facility.

    The 'kernel' and 'user' flags can now be used to filter for samples
    when using hardware sampling.

    Additionally also the following file will be created:
    /dev/oprofile/timer/enabled

    This will always be the inverted value of /dev/oprofile/0/enabled. 0
    is not accepted without hardware sampling.

    Signed-off-by: Andreas Krebbel
    Signed-off-by: Robert Richter

    Andreas Krebbel
     
  • Removing remainings of oprofile_timer_exit() completly.

    Signed-off-by: Robert Richter

    Robert Richter
     

11 Jul, 2011

1 commit


22 Jun, 2011

2 commits

  • The sampling interval for the hardware sampler is specified in cycles.
    (see SA23-2260-01 The Load-Program-Parameter and the CPU-Measurement
    Facilities)
    The current default value will therefore result in millions of samples.
    This patch changes the default sampling interval to 4M, which will
    result in ~1500 samples per second on a z196 reducing the overhead
    of sampling.

    Signed-off-by: Christian Borntraeger
    Signed-off-by: Martin Schwidefsky

    Christian Borntraeger
     
  • On specific configurations with hwsampler opcontrol --start returns an
    error on "echo 1 >/dev/oprofile/enable". Turns out that the hw sampling
    interval is not checked against the hardware limits.

    Signed-off-by: Christian Borntraeger
    Signed-off-by: Martin Schwidefsky

    Christian Borntraeger
     

20 Jun, 2011

1 commit


10 May, 2011

1 commit

  • oprofile_min_interval and oprofile_max_interval are unsigned, checking
    for negative values doesn't work. Change hwsampler_query_min_interval
    and hwsampler_query_max_interval to return an unsigned long and
    check for a zero value instead.

    Reported-by: Nicolas Kaiser
    Acked-by: Robert Richter
    Signed-off-by: Martin Schwidefsky

    Martin Schwidefsky
     

23 Mar, 2011

1 commit


16 Mar, 2011

2 commits


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
     

07 Jan, 2006

1 commit


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