06 May, 2013

1 commit

  • Pull mudule updates from Rusty Russell:
    "We get rid of the general module prefix confusion with a binary config
    option, fix a remove/insert race which Never Happens, and (my
    favorite) handle the case when we have too many modules for a single
    commandline. Seriously, the kernel is full, please go away!"

    * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    modpost: fix unwanted VMLINUX_SYMBOL_STR expansion
    X.509: Support parse long form of length octets in Authority Key Identifier
    module: don't unlink the module until we've removed all exposure.
    kernel: kallsyms: memory override issue, need check destination buffer length
    MODSIGN: do not send garbage to stderr when enabling modules signature
    modpost: handle huge numbers of modules.
    modpost: add -T option to read module names from file/stdin.
    modpost: minor cleanup.
    genksyms: pass symbol-prefix instead of arch
    module: fix symbol versioning with symbol prefixes
    CONFIG_SYMBOL_PREFIX: cleanup.

    Linus Torvalds
     

01 May, 2013

1 commit

  • The only use outside of kernel/timer.c was in kernel/compat.c, so move
    compat_sys_sysinfo() next to sys_sysinfo() in kernel/timer.c.

    Signed-off-by: Stephen Rothwell
    Cc: Thomas Gleixner
    Cc: Guenter Roeck
    Cc: Al Viro
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Rothwell
     

30 Apr, 2013

1 commit

  • Pull tracing updates from Steven Rostedt:
    "Along with the usual minor fixes and clean ups there are a few major
    changes with this pull request.

    1) Multiple buffers for the ftrace facility

    This feature has been requested by many people over the last few
    years. I even heard that Google was about to implement it themselves.
    I finally had time and cleaned up the code such that you can now
    create multiple instances of the ftrace buffer and have different
    events go to different buffers. This way, a low frequency event will
    not be lost in the noise of a high frequency event.

    Note, currently only events can go to different buffers, the tracers
    (ie function, function_graph and the latency tracers) still can only
    be written to the main buffer.

    2) The function tracer triggers have now been extended.

    The function tracer had two triggers. One to enable tracing when a
    function is hit, and one to disable tracing. Now you can record a
    stack trace on a single (or many) function(s), take a snapshot of the
    buffer (copy it to the snapshot buffer), and you can enable or disable
    an event to be traced when a function is hit.

    3) A perf clock has been added.

    A "perf" clock can be chosen to be used when tracing. This will cause
    ftrace to use the same clock as perf uses, and hopefully this will
    make it easier to interleave the perf and ftrace data for analysis."

    * tag 'trace-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (82 commits)
    tracepoints: Prevent null probe from being added
    tracing: Compare to 1 instead of zero for is_signed_type()
    tracing: Remove obsolete macro guard _TRACE_PROFILE_INIT
    ftrace: Get rid of ftrace_profile_bits
    tracing: Check return value of tracing_init_dentry()
    tracing: Get rid of unneeded key calculation in ftrace_hash_move()
    tracing: Reset ftrace_graph_filter_enabled if count is zero
    tracing: Fix off-by-one on allocating stat->pages
    kernel: tracing: Use strlcpy instead of strncpy
    tracing: Update debugfs README file
    tracing: Fix ftrace_dump()
    tracing: Rename trace_event_mutex to trace_event_sem
    tracing: Fix comment about prefix in arch_syscall_match_sym_name()
    tracing: Convert trace_destroy_fields() to static
    tracing: Move find_event_field() into trace_events.c
    tracing: Use TRACE_MAX_PRINT instead of constant
    tracing: Use pr_warn_once instead of open coded implementation
    ring-buffer: Add ring buffer startup selftest
    tracing: Bring Documentation/trace/ftrace.txt up to date
    tracing: Add "perf" trace_clock
    ...

    Conflicts:
    kernel/trace/ftrace.c
    kernel/trace/trace.c

    Linus Torvalds
     

23 Mar, 2013

1 commit

  • wake_up_klogd() is useless when CONFIG_PRINTK=n because neither printk()
    nor printk_sched() are in use and there are actually no waiter on
    log_wait waitqueue. It should be a stub in this case for users like
    bust_spinlocks().

    Otherwise this results in this warning when CONFIG_PRINTK=n and
    CONFIG_IRQ_WORK=n:

    kernel/built-in.o In function `wake_up_klogd':
    (.text.wake_up_klogd+0xb4): undefined reference to `irq_work_queue'

    To fix this, provide an off-case for wake_up_klogd() when
    CONFIG_PRINTK=n.

    There is much more from console_unlock() and other console related code
    in printk.c that should be moved under CONFIG_PRINTK. But for now,
    focus on a minimal fix as we passed the merged window already.

    [akpm@linux-foundation.org: include printk.h in bust_spinlocks.c]
    Signed-off-by: Frederic Weisbecker
    Reported-by: James Hogan
    Cc: James Hogan
    Cc: Steven Rostedt
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Frederic Weisbecker
     

15 Mar, 2013

5 commits

  • We have CONFIG_SYMBOL_PREFIX, which three archs define to the string
    "_". But Al Viro broke this in "consolidate cond_syscall and
    SYSCALL_ALIAS declarations" (in linux-next), and he's not the first to
    do so.

    Using CONFIG_SYMBOL_PREFIX is awkward, since we usually just want to
    prefix it so something. So various places define helpers which are
    defined to nothing if CONFIG_SYMBOL_PREFIX isn't set:

    1) include/asm-generic/unistd.h defines __SYMBOL_PREFIX.
    2) include/asm-generic/vmlinux.lds.h defines VMLINUX_SYMBOL(sym)
    3) include/linux/export.h defines MODULE_SYMBOL_PREFIX.
    4) include/linux/kernel.h defines SYMBOL_PREFIX (which differs from #7)
    5) kernel/modsign_certificate.S defines ASM_SYMBOL(sym)
    6) scripts/modpost.c defines MODULE_SYMBOL_PREFIX
    7) scripts/Makefile.lib defines SYMBOL_PREFIX on the commandline if
    CONFIG_SYMBOL_PREFIX is set, so that we have a non-string version
    for pasting.

    (arch/h8300/include/asm/linkage.h defines SYMBOL_NAME(), too).

    Let's solve this properly:
    1) No more generic prefix, just CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX.
    2) Make linux/export.h usable from asm.
    3) Define VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR().
    4) Make everyone use them.

    Signed-off-by: Rusty Russell
    Reviewed-by: James Hogan
    Tested-by: James Hogan (metag)

    Rusty Russell
     
  • Altough the trace_dump_stack() already skips three functions in
    the call to stack trace, which gets the stack trace to start
    at the caller of the function, the caller may want to skip some
    more too (as it may have helper functions).

    Add a skip argument to the trace_dump_stack() that lets the caller
    skip back tracing functions that it doesn't care about.

    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     
  • Although trace_printk() is extremely fast, especially when it uses
    trace_bprintk() (writes args straight to buffer instead of inserting
    into string), it still has the overhead of calling one of the printf
    sprintf() functions, that need to scan the fmt string to determine
    what, if any args it has.

    This is a waste of precious CPU cycles if the printk format has no
    args but a single constant string. It is better to use trace_puts()
    which does not have the overhead of the fmt scanning.

    But wouldn't it be nice if the developer didn't have to think about
    such things, and the compile would just do it for them?

    trace_printk("this string has no args\n");
    [...]
    trace_printk("this sting does %p %d\n", foo, bar);

    As tracing is critical to have the least amount of overhead,
    especially when dealing with race conditions, and you want to
    eliminate any "Heisenbugs", you want the trace_printk() to use the
    fastest possible means of tracing.

    Currently the macro magic determines if it will use trace_bprintk()
    or if the fmt is a dynamic string (a variable), it will fall
    back to the slow trace_printk() method that does a full snprintf()
    before copying it into the buffer, where as trace_bprintk() only
    copys the pointer to the fmt and the args into the buffer.

    Well, now there's a way to spend some more Hogwarts cash and come
    up with new fancy macro magic.

    #define trace_printk(fmt, ...) \
    do { \
    char _______STR[] = __stringify((__VA_ARGS__)); \
    if (sizeof(_______STR) > 3) \
    do_trace_printk(fmt, ##__VA_ARGS__); \
    else \
    trace_puts(fmt); \
    } while (0)

    The above needs a bit of explaining (both here and in the comments).

    By stringifying the __VA_ARGS__, we can, at compile time, determine
    the number of args that are being passed to trace_printk(). The extra
    parenthesis are required, otherwise the compiler complains about
    too many parameters for __stringify if there is more than one arg.

    When there are no args, the __stringify((__VA_ARGS__)) converts into
    "()\0", a string of 3 characters. Anything else, will be a string
    containing more than 3 characters. Now we assign that string to a
    dynamic char array, and then take the sizeof() of that array.
    If it is greater than 3 characters, we know trace_printk() has args
    and we need to do the full "do_trace_printk()" on them, otherwise
    it was only passed a single arg and we can optimize to use trace_puts().

    Cc: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: Frederic Weisbecker
    Signed-off-by: Steven "The King of Nasty Macros!" Rostedt

    Steven Rostedt (Red Hat)
     
  • The trace_printk() is extremely fast and is very handy as it can be
    used in any context (including NMIs!). But it still requires scanning
    the fmt string for parsing the args. Even the trace_bprintk() requires
    a scan to know what args will be saved, although it doesn't copy the
    format string itself.

    Several times trace_printk() has no args, and wastes cpu cycles scanning
    the fmt string.

    Adding trace_puts() allows the developer to use an even faster
    tracing method that only saves the pointer to the string in the
    ring buffer without doing any format parsing at all. This will
    help remove even more of the "Heisenbug" effect, when debugging.

    Also fixed up the F_printk()s for the ftrace internal bprint and print events.

    Cc: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: Frederic Weisbecker
    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     
  • The new snapshot feature is quite handy. It's a way for the user
    to take advantage of the spare buffer that, until then, only
    the latency tracers used to "snapshot" the buffer when it hit
    a max latency. Now users can trigger a "snapshot" manually when
    some condition is hit in a program. But a snapshot currently can
    not be triggered by a condition inside the kernel.

    With the addition of tracing_snapshot() and tracing_snapshot_alloc(),
    snapshots can now be taking when a condition is hit, and the
    developer wants to snapshot the case without stopping the trace.

    Note, any snapshot will overwrite the old one, so take care
    in how this is done.

    These new functions are to be used like tracing_on(), tracing_off()
    and trace_printk() are. That is, they should never be called
    in the mainline Linux kernel. They are solely for the purpose
    of debugging.

    The tracing_snapshot() will not allocate a buffer, but it is
    safe to be called from any context (except NMIs). But if a
    snapshot buffer isn't allocated when it is called, it will write
    to the live buffer, complaining about the lack of a snapshot
    buffer, and then stop tracing (giving you the "permanent snapshot").

    tracing_snapshot_alloc() will allocate the snapshot buffer if
    it was not already allocated and then take the snapshot. This routine
    *may sleep*, and must be called from context that can sleep.
    The allocation is done with GFP_KERNEL and not atomic.

    If you need a snapshot in an atomic context, say in early boot,
    then it is best to call the tracing_snapshot_alloc() before then,
    where it will allocate the buffer, and then you can use the
    tracing_snapshot() anywhere you want and still get snapshots.

    Cc: Hiraku Toyooka
    Cc: Thomas Gleixner
    Cc: Peter Zijlstra
    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     

21 Jan, 2013

1 commit


21 Dec, 2012

1 commit

  • Commit 263a523d18bc ("linux/kernel.h: Fix warning seen with W=1 due to
    change in DIV_ROUND_CLOSEST") fixes a warning seen with W=1 due to
    change in DIV_ROUND_CLOSEST.

    Unfortunately, the C compiler converts divide operations with unsigned
    divisors to unsigned, even if the dividend is signed and negative (for
    example, -10 / 5U = 858993457). The C standard says "If one operand has
    unsigned int type, the other operand is converted to unsigned int", so
    the compiler is not to blame. As a result, DIV_ROUND_CLOSEST(0, 2U) and
    similar operations now return bad values, since the automatic conversion
    of expressions such as "0 - 2U/2" to unsigned was not taken into
    account.

    Fix by checking for the divisor variable type when deciding which
    operation to perform. This fixes DIV_ROUND_CLOSEST(0, 2U), but still
    returns bad values for negative dividends divided by unsigned divisors.
    Mark the latter case as unsupported.

    One observed effect of this problem is that the s2c_hwmon driver reports
    a value of 4198403 instead of 0 if the ADC reads 0.

    Other impact is unpredictable. Problem is seen if the divisor is an
    unsigned variable or constant and the dividend is less than (divisor/2).

    Signed-off-by: Guenter Roeck
    Reported-by: Juergen Beisert
    Tested-by: Juergen Beisert
    Cc: Jean Delvare
    Cc: [3.7.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Guenter Roeck
     

18 Dec, 2012

1 commit

  • As Bruce Fields pointed out, kstrto* is currently lacking kerneldoc
    comments. This patch adds kerneldoc comments to common variants of
    kstrto*: kstrto(u)l, kstrto(u)ll and kstrto(u)int.

    Signed-off-by: Eldad Zack
    Cc: J. Bruce Fields
    Cc: Joe Perches
    Cc: Randy Dunlap
    Cc: Alexey Dobriyan
    Cc: Rob Landley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eldad Zack
     

12 Dec, 2012

3 commits

  • Pull perf updates from Ingo Molnar:
    "Lots of activity:

    211 files changed, 8328 insertions(+), 4116 deletions(-)

    most of it on the tooling side.

    Main changes:

    * ftrace enhancements and fixes from Steve Rostedt.

    * uprobes fixes, cleanups and preparation for the ARM port from Oleg
    Nesterov.

    * UAPI fixes, from David Howels - prepares the arch/x86 UAPI
    transition

    * Separate perf tests into multiple objects, one per test, from Jiri
    Olsa.

    * Make hardware event translations available in sysfs, from Jiri
    Olsa.

    * Fixes to /proc/pid/maps parsing, preparatory to supporting data
    maps, from Namhyung Kim

    * Implement ui_progress for GTK, from Namhyung Kim

    * Add framework for automated perf_event_attr tests, where tools with
    different command line options will be run from a 'perf test', via
    python glue, and the perf syscall will be intercepted to verify
    that the perf_event_attr fields set by the tool are those expected,
    from Jiri Olsa

    * Add a 'link' method for hists, so that we can have the leader with
    buckets for all the entries in all the hists. This new method is
    now used in the default 'diff' output, making the sum of the
    'baseline' column be 100%, eliminating blind spots.

    * libtraceevent fixes for compiler warnings trying to make perf it
    build on some distros, like fedora 14, 32-bit, some of the warnings
    really pointed to real bugs.

    * Add a browser for 'perf script' and make it available from the
    report and annotate browsers. It does filtering to find the
    scripts that handle events found in the perf.data file used. From
    Feng Tang

    * perf inject changes to allow showing where a task sleeps, from
    Andrew Vagin.

    * Makefile improvements from Namhyung Kim.

    * Add --pre and --post command hooks in 'stat', from Peter Zijlstra.

    * Don't stop synthesizing threads when one vanishes, this is for the
    existing threads when we start a tool like trace.

    * Use sched:sched_stat_runtime to provide a thread summary, this
    produces the same output as the 'trace summary' subcommand of
    tglx's original "trace" tool.

    * Support interrupted syscalls in 'trace'

    * Add an event duration column and filter in 'trace'.

    * There are references to the man pages in some tools, so try to
    build Documentation when installing, warning the user if that is
    not possible, from Borislav Petkov.

    * Give user better message if precise is not supported, from David
    Ahern.

    * Try to find cross-built objdump path by using the session
    environment information in the perf.data file header, from Irina
    Tirdea, original patch and idea by Namhyung Kim.

    * Diplays more output on features check for make V=1, so that one can
    figure out what is happening by looking at gcc output, etc. From
    Jiri Olsa.

    * Add on_exit implementation for systems without one, e.g. Android,
    from Bernhard Rosenkraenzer.

    * Only process events for vcpus of interest, helps handling large
    number of events, from David Ahern.

    * Cross compilation fixes for Android, from Irina Tirdea.

    * Add documentation on compiling for Android, from Irina Tirdea.

    * perf diff improvements from Jiri Olsa.

    * Target (task/user/cpu/syswide) handling improvements, from Namhyung
    Kim.

    * Add support in 'trace' for tracing workload given by command line,
    from Namhyung Kim.

    * ... and much more."

    * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (194 commits)
    uprobes: Use percpu_rw_semaphore to fix register/unregister vs dup_mmap() race
    perf evsel: Introduce is_group_member method
    perf powerpc: Use uapi/unistd.h to fix build error
    tools: Pass the target in descend
    tools: Honour the O= flag when tool build called from a higher Makefile
    tools: Define a Makefile function to do subdir processing
    perf ui: Always compile browser setup code
    perf ui: Add ui_progress__finish()
    perf ui gtk: Implement ui_progress functions
    perf ui: Introduce generic ui_progress helper
    perf ui tui: Move progress.c under ui/tui directory
    perf tools: Add basic event modifier sanity check
    perf tools: Omit group members from perf_evlist__disable/enable
    perf tools: Ensure single disable call per event in record comand
    perf tools: Fix 'disabled' attribute config for record command
    perf tools: Fix attributes for '{}' defined event groups
    perf tools: Use sscanf for parsing /proc/pid/maps
    perf tools: Add gtk. config option for launching GTK browser
    perf tools: Fix compile error on NO_NEWT=1 build
    perf hists: Initialize all of he->stat with zeroes
    ...

    Linus Torvalds
     
  • We don't need custom COMPACTION_BUILD anymore, since we have handy
    IS_ENABLED().

    Signed-off-by: Kirill A. Shutemov
    Acked-by: Minchan Kim
    Acked-by: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • We don't need custom NUMA_BUILD anymore, since we have handy
    IS_ENABLED().

    Signed-off-by: Kirill A. Shutemov
    Acked-by: KOSAKI Motohiro
    Acked-by: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     

08 Dec, 2012

1 commit


03 Dec, 2012

1 commit

  • Define SYMBOL_PREFIX to be the same as CONFIG_SYMBOL_PREFIX if set by
    the architecture, or "" otherwise. This avoids the need for ugly #ifdefs
    whenever symbols are referenced in asm blocks.

    Signed-off-by: James Hogan
    Cc: Andrew Morton
    Cc: Joe Perches
    Cc: Paul Gortmaker
    Cc: Jean Delvare
    Cc: Ralf Baechle
    Cc: Mike Frysinger
    Signed-off-by: Rusty Russell

    James Hogan
     

01 Nov, 2012

1 commit


13 Oct, 2012

1 commit


19 Sep, 2012

1 commit

  • After commit b6d86d3d (Fix DIV_ROUND_CLOSEST to support negative dividends),
    the following warning is seen if the kernel is compiled with W=1 (-Wextra):

    warning: comparison of unsigned expression >= 0 is always true

    The warning is due to the test '((typeof(x))-1) >= 0', which is used to detect
    if the variable type is unsigned. Research on the web suggests that the warning
    disappears if '>' instead of '>=' is used for the comparison.

    Tests after changing the macro along that line show that the warning is gone,
    and that the result is still correct:

    i=-4: DIV_ROUND_CLOSEST(i, 2)=-2
    i=-3: DIV_ROUND_CLOSEST(i, 2)=-2
    i=-2: DIV_ROUND_CLOSEST(i, 2)=-1
    i=-1: DIV_ROUND_CLOSEST(i, 2)=-1
    i=0: DIV_ROUND_CLOSEST(i, 2)=0
    i=1: DIV_ROUND_CLOSEST(i, 2)=1
    i=2: DIV_ROUND_CLOSEST(i, 2)=1
    i=3: DIV_ROUND_CLOSEST(i, 2)=2
    i=4: DIV_ROUND_CLOSEST(i, 2)=2

    Code size is the same as before.

    Signed-off-by: Guenter Roeck
    Tested-by: Mauro Carvalho Chehab
    Acked-by: Jean Delvare

    Guenter Roeck
     

02 Sep, 2012

1 commit


22 Jul, 2012

1 commit


01 Jun, 2012

1 commit

  • ULONG_MAX is often used to check for integer overflow when calculating
    allocation size. While ULONG_MAX happens to work on most systems, there
    is no guarantee that `size_t' must be the same size as `long'.

    This patch introduces SIZE_MAX, the maximum value of `size_t', to improve
    portability and readability for allocation size validation.

    Signed-off-by: Xi Wang
    Acked-by: Alex Elder
    Cc: David Airlie
    Cc: Pekka Enberg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Xi Wang
     

25 May, 2012

2 commits

  • Pull sparc changes from David S. Miller:
    "This has the generic strncpy_from_user() implementation architectures
    can now use, which we've been developing on linux-arch over the past
    few days.

    For good measure I ran both a 32-bit and a 64-bit glibc testsuite run,
    and the latter of which pointed out an adjustment I needed to make to
    sparc's user_addr_max() definition. Linus, you were right, STACK_TOP
    was not the right thing to use, even on sparc itself :-)

    From Sam Ravnborg, we have a conversion of sparc32 over to the common
    alloc_thread_info_node(), since the aspect which originally blocked
    our doing so (sun4c) has been removed."

    Fix up trivial arch/sparc/Kconfig and lib/Makefile conflicts.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
    sparc: Fix user_addr_max() definition.
    lib: Sparc's strncpy_from_user is generic enough, move under lib/
    kernel: Move REPEAT_BYTE definition into linux/kernel.h
    sparc: Increase portability of strncpy_from_user() implementation.
    sparc: Optimize strncpy_from_user() zero byte search.
    sparc: Add full proper error handling to strncpy_from_user().
    sparc32: use the common implementation of alloc_thread_info_node()

    Linus Torvalds
     
  • And make sure that everything using it explicitly includes
    that header file.

    Signed-off-by: David S. Miller

    David S. Miller
     

24 Apr, 2012

1 commit

  • Currently, trace_printk() uses a single buffer to write into
    to calculate the size and format needed to save the trace. To
    do this safely in an SMP environment, a spin_lock() is taken
    to only allow one writer at a time to the buffer. But this could
    also affect what is being traced, and add synchronization that
    would not be there otherwise.

    Ideally, using percpu buffers would be useful, but since trace_printk()
    is only used in development, having per cpu buffers for something
    never used is a waste of space. Thus, the use of the trace_bprintk()
    format section is changed to be used for static fmts as well as dynamic ones.
    Then at boot up, we can check if the section that holds the trace_printk
    formats is non-empty, and if it does contain something, then we
    know a trace_printk() has been added to the kernel. At this time
    the trace_printk per cpu buffers are allocated. A check is also
    done at module load time in case a module is added that contains a
    trace_printk().

    Once the buffers are allocated, they are never freed. If you use
    a trace_printk() then you should know what you are doing.

    A buffer is made for each type of context:

    normal
    softirq
    irq
    nmi

    The context is checked and the appropriate buffer is used.
    This allows for totally lockless usage of trace_printk(),
    and they no longer even disable interrupts.

    Requested-by: Peter Zijlstra
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     

01 Apr, 2012

1 commit

  • Pull perf updates and fixes from Ingo Molnar:
    "It's mostly fixes, but there's also two late items:

    - preliminary GTK GUI support for perf report
    - PMU raw event format descriptors in sysfs, to be parsed by tooling

    The raw event format in sysfs is a new ABI. For example for the 'CPU'
    PMU we have:

    aldebaran:~> ll /sys/bus/event_source/devices/cpu/format/*
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/any
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/cmask
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/edge
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/event
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/inv
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/offcore_rsp
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/pc
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/umask

    those lists of fields contain a specific format:

    aldebaran:~> cat /sys/bus/event_source/devices/cpu/format/offcore_rsp
    config1:0-63

    So, those who wish to specify raw events can now use the following
    event format:

    -e cpu/cmask=1,event=2,umask=3

    Most people will not want to specify any events (let alone raw
    events), they'll just use whatever default event the tools use.

    But for more obscure PMU events that have no cross-architecture
    generic events the above syntax is more usable and a bit more
    structured than specifying hex numbers."

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (41 commits)
    perf tools: Remove auto-generated bison/flex files
    perf annotate: Fix off by one symbol hist size allocation and hit accounting
    perf tools: Add missing ref-cycles event back to event parser
    perf annotate: addr2line wants addresses in same format as objdump
    perf probe: Finder fails to resolve function name to address
    tracing: Fix ent_size in trace output
    perf symbols: Handle NULL dso in dso__name_len
    perf symbols: Do not include libgen.h
    perf tools: Fix bug in raw sample parsing
    perf tools: Fix display of first level of callchains
    perf tools: Switch module.h into export.h
    perf: Move mmap page data_head offset assertion out of header
    perf: Fix mmap_page capabilities and docs
    perf diff: Fix to work with new hists design
    perf tools: Fix modifier to be applied on correct events
    perf tools: Fix various casting issues for 32 bits
    perf tools: Simplify event_read_id exit path
    tracing: Fix ftrace stack trace entries
    tracing: Move the tracing_on/off() declarations into CONFIG_TRACING
    perf report: Add a simple GTK2-based 'perf report' browser
    ...

    Linus Torvalds
     

30 Mar, 2012

1 commit

  • Pull x32 support for x86-64 from Ingo Molnar:
    "This tree introduces the X32 binary format and execution mode for x86:
    32-bit data space binaries using 64-bit instructions and 64-bit kernel
    syscalls.

    This allows applications whose working set fits into a 32 bits address
    space to make use of 64-bit instructions while using a 32-bit address
    space with shorter pointers, more compressed data structures, etc."

    Fix up trivial context conflicts in arch/x86/{Kconfig,vdso/vma.c}

    * 'x86-x32-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (71 commits)
    x32: Fix alignment fail in struct compat_siginfo
    x32: Fix stupid ia32/x32 inversion in the siginfo format
    x32: Add ptrace for x32
    x32: Switch to a 64-bit clock_t
    x32: Provide separate is_ia32_task() and is_x32_task() predicates
    x86, mtrr: Use explicit sizing and padding for the 64-bit ioctls
    x86/x32: Fix the binutils auto-detect
    x32: Warn and disable rather than error if binutils too old
    x32: Only clear TIF_X32 flag once
    x32: Make sure TS_COMPAT is cleared for x32 tasks
    fs: Remove missed ->fds_bits from cessation use of fd_set structs internally
    fs: Fix close_on_exec pointer in alloc_fdtable
    x32: Drop non-__vdso weak symbols from the x32 VDSO
    x32: Fix coding style violations in the x32 VDSO code
    x32: Add x32 VDSO support
    x32: Allow x32 to be configured
    x32: If configured, add x32 system calls to system call tables
    x32: Handle process creation
    x32: Signal-related system calls
    x86: Add #ifdef CONFIG_COMPAT to
    ...

    Linus Torvalds
     

26 Mar, 2012

1 commit


25 Mar, 2012

1 commit

  • Pull cleanup from Paul Gortmaker:
    "The changes shown here are to unify linux's BUG support under the one
    file. Due to historical reasons, we have some BUG code
    in bug.h and some in kernel.h -- i.e. the support for BUILD_BUG in
    linux/kernel.h predates the addition of linux/bug.h, but old code in
    kernel.h wasn't moved to bug.h at that time. As a band-aid, kernel.h
    was including to pseudo link them.

    This has caused confusion[1] and general yuck/WTF[2] reactions. Here
    is an example that violates the principle of least surprise:

    CC lib/string.o
    lib/string.c: In function 'strlcat':
    lib/string.c:225:2: error: implicit declaration of function 'BUILD_BUG_ON'
    make[2]: *** [lib/string.o] Error 1
    $
    $ grep linux/bug.h lib/string.c
    #include
    $

    We've included for the BUG infrastructure and yet we
    still get a compile fail! [We've not kernel.h for BUILD_BUG_ON.] Ugh -
    very confusing for someone who is new to kernel development.

    With the above in mind, the goals of this changeset are:

    1) find and fix any include/*.h files that were relying on the
    implicit presence of BUG code.
    2) find and fix any C files that were consuming kernel.h and hence
    relying on implicitly getting some/all BUG code.
    3) Move the BUG related code living in kernel.h to
    4) remove the asm/bug.h from kernel.h to finally break the chain.

    During development, the order was more like 3-4, build-test, 1-2. But
    to ensure that git history for bisect doesn't get needless build
    failures introduced, the commits have been reorderd to fix the problem
    areas in advance.

    [1] https://lkml.org/lkml/2012/1/3/90
    [2] https://lkml.org/lkml/2012/1/17/414"

    Fix up conflicts (new radeon file, reiserfs header cleanups) as per Paul
    and linux-next.

    * tag 'bug-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
    kernel.h: doesn't explicitly use bug.h, so don't include it.
    bug: consolidate BUILD_BUG_ON with other bug code
    BUG: headers with BUG/BUG_ON etc. need linux/bug.h
    bug.h: add include of it to various implicit C users
    lib: fix implicit users of kernel.h for TAINT_WARN
    spinlock: macroize assert_spin_locked to avoid bug.h dependency
    x86: relocate get/set debugreg fcns to include/asm/debugreg.

    Linus Torvalds
     

24 Mar, 2012

2 commits

  • == stat_check.py
    num = 0
    with open("/proc/stat") as f:
    while num < 1000 :
    data = f.read()
    f.seek(0, 0)
    num = num + 1
    ==

    perf shows

    20.39% stat_check.py [kernel.kallsyms] [k] format_decode
    13.41% stat_check.py [kernel.kallsyms] [k] number
    12.61% stat_check.py [kernel.kallsyms] [k] vsnprintf
    10.85% stat_check.py [kernel.kallsyms] [k] memcpy
    4.85% stat_check.py [kernel.kallsyms] [k] radix_tree_lookup
    4.43% stat_check.py [kernel.kallsyms] [k] seq_printf

    This patch removes most of calls to vsnprintf() by adding num_to_str()
    and seq_print_decimal_ull(), which prints decimal numbers without rich
    functions provided by printf().

    On my 8cpu box.
    == Before patch ==
    [root@bluextal test]# time ./stat_check.py

    real 0m0.150s
    user 0m0.026s
    sys 0m0.121s

    == After patch ==
    [root@bluextal test]# time ./stat_check.py

    real 0m0.055s
    user 0m0.022s
    sys 0m0.030s

    [akpm@linux-foundation.org: remove incorrect comment, use less statck in num_to_str(), move comment from .h to .c, simplify seq_put_decimal_ull()]
    [andrea@betterlinux.com: avoid breaking the ABI in /proc/stat]
    Signed-off-by: KAMEZAWA Hiroyuki
    Signed-off-by: Andrea Righi
    Cc: Eric Dumazet
    Cc: Glauber Costa
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: Paul Turner
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     
  • It's equivalent to __printf, so prefer __scanf.

    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     

22 Mar, 2012

1 commit


21 Mar, 2012

1 commit

  • The tracing_on/off() declarations were under CONFIG_RING_BUFFER, but
    the functions are now only defined under CONFIG_TRACING as they are
    specific to ftrace and not the ring buffer.

    But the declarations were still defined under the ring buffer and
    this caused the build to fail when CONFIG_RING_BUFFER was set but
    CONFIG_TRACING was not.

    Reported-by: Ingo Molnar
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     

13 Mar, 2012

1 commit

  • When a machine boots up, the TSC generally gets reset. However,
    when kexec is used to boot into a kernel, the TSC value would be
    carried over from the previous kernel. The computation of
    cycns_offset in set_cyc2ns_scale is prone to an overflow, if the
    machine has been up more than 208 days prior to the kexec. The
    overflow happens when we multiply *scale, even though there is
    enough room to store the final answer.

    We fix this issue by decomposing tsc_now into the quotient and
    remainder of division by CYC2NS_SCALE_FACTOR and then performing
    the multiplication separately on the two components.

    Refactor code to share the calculation with the previous
    fix in __cycles_2_ns().

    Signed-off-by: Salman Qazi
    Acked-by: John Stultz
    Acked-by: Peter Zijlstra
    Cc: Paul Turner
    Cc: john stultz
    Link: http://lkml.kernel.org/r/20120310004027.19291.88460.stgit@dungbeetle.mtv.corp.google.com
    Signed-off-by: Ingo Molnar

    Salman Qazi
     

05 Mar, 2012

2 commits

  • This header isn't using bug.h infrastructure, but due to historical
    reasons, it was including it. Removing it revealed several implicit
    dependencies (since kernel.h is everywhere) so we've fixed those 1st
    before deploying this change.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     
  • The support for BUILD_BUG in linux/kernel.h predates the
    addition of linux/bug.h -- with this chunk off separate,
    you can run into situations where a person gets a compile
    fail even when they've included linux/bug.h, like this:

    CC lib/string.o
    lib/string.c: In function 'strlcat':
    lib/string.c:225:2: error: implicit declaration of function 'BUILD_BUG_ON'
    make[2]: *** [lib/string.o] Error 1
    $
    $ grep linux/bug.h lib/string.c
    #include
    $

    Since the above violates the principle of least surprise, move
    the BUG chunks from kernel.h to bug.h so it is all together.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

21 Feb, 2012

1 commit


13 Jan, 2012

2 commits

  • Use the more commonly used __noreturn instead of ATTRIB_NORETURN.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Joe Perches
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Haavard Skinnemoen
    Cc: Hans-Christian Egtvedt
    Cc: Tony Luck
    Cc: Fenghua Yu
    Acked-by: Geert Uytterhoeven
    Acked-by: Ralf Baechle
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Chris Metcalf
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • It's a very old and now unused prototype marking so just delete it.

    Neaten panic pointer argument style to keep checkpatch quiet.

    Signed-off-by: Joe Perches
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Haavard Skinnemoen
    Cc: Hans-Christian Egtvedt
    Cc: Tony Luck
    Cc: Fenghua Yu
    Acked-by: Geert Uytterhoeven
    Acked-by: Ralf Baechle
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Chris Metcalf
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches