17 May, 2011

12 commits

  • Do the mcount offset adjustment in the recordmcount.pl/recordmcount.[ch]
    at compile time and not in ftrace_call_adjust at run time.

    Signed-off-by: Martin Schwidefsky
    Signed-off-by: Steven Rostedt

    Martin Schwidefsky
     
  • Do the mcount offset adjustment in the recordmcount.pl/recordmcount.[ch]
    at compile time and not in ftrace_call_adjust at run time.

    Signed-off-by: Martin Schwidefsky
    Signed-off-by: Steven Rostedt

    Martin Schwidefsky
     
  • Introduce mcount_adjust{,_32,_64} to the C implementation of
    recordmcount analog to $mcount_adjust in the perl script.
    The adjustment is added to the address of the relocations
    against the mcount symbol. If this adjustment is done by
    recordmcount at compile time the ftrace_call_adjust function
    can be turned into a nop.

    Cc: John Reiser
    Signed-off-by: Martin Schwidefsky
    Signed-off-by: Steven Rostedt

    Martin Schwidefsky
     
  • The code to get the symbol, string, and relp pointers in the two functions
    sift_rel_mcount() and nop_mcount() are identical and also non-trivial.
    Moving this duplicate code into a single helper function makes the code
    easier to read and more maintainable.

    Cc: John Reiser
    Link: http://lkml.kernel.org/r/20110421023739.723658553@goodmis.org
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • The code in sift_rel_mcount() and nop_mcount() to get the mcount symbol
    number is identical. Replace the two locations with a call to a function
    that does the work.

    Cc: John Reiser
    Link: http://lkml.kernel.org/r/20110421023739.488093407@goodmis.org
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • When mcount is called in a section that ftrace will not modify it into
    a nop, we want to warn about this. But not warn about this always. Now
    if the user builds the kernel with the option RECORDMCOUNT_WARN=1 then
    the build will warn about mcount callers that are ignored and will just
    waste execution time.

    Acked-by: Michal Marek
    Cc: linux-kbuild@vger.kernel.org
    Link: http://lkml.kernel.org/r/20110421023738.714956282@goodmis.org
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • There's some sections that should not have mcount recorded and should not have
    modifications to the that code. But currently they waste some time by calling
    mcount anyway (which simply returns). As the real answer should be to
    either whitelist the section or have gcc ignore it fully.

    This change adds a option to recordmcount to warn when it finds a section
    that is ignored by ftrace but still contains mcount callers. This is not on
    by default as developers may not know if the section should be completely
    ignored or added to the whitelist.

    Cc: John Reiser
    Link: http://lkml.kernel.org/r/20110421023738.476989377@goodmis.org
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • There are sections that are ignored by ftrace for the function tracing because
    the text is in a section that can be removed without notice. The mcount calls
    in these sections are ignored and ftrace never sees them. The downside of this
    is that the functions in these sections still call mcount. Although the mcount
    function is defined in assembly simply as a return, this added overhead is
    unnecessary.

    The solution is to convert these callers into nops at compile time.
    A better solution is to add 'notrace' to the section markers, but as new sections
    come up all the time, it would be nice that they are delt with when they
    are created.

    Later patches will deal with finding these sections and doing the proper solution.

    Thanks to H. Peter Anvin for giving me the right nops to use for x86.

    Cc: "H. Peter Anvin"
    Cc: John Reiser
    Link: http://lkml.kernel.org/r/20110421023738.237101176@goodmis.org
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • PROGBITS is not enough to determine if the section should be modified
    or not. Only process sections that are marked as executable.

    Cc: John Reiser
    Link: http://lkml.kernel.org/r/20110421023737.991485123@goodmis.org
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • The .kprobe.text section is safe to modify mcount to nop and tracing.
    Add it to the whitelist in recordmcount.c and recordmcount.pl.

    Cc: John Reiser
    Cc: Masami Hiramatsu
    Link: http://lkml.kernel.org/r/20110421023737.743350547@goodmis.org
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • The Linux style for switch statements is:

    switch (var) {
    case x:
    [...]
    break;
    }

    Not:
    switch (var) {
    case x: {
    [...]
    } break;

    Cc: John Reiser
    Link: http://lkml.kernel.org/r/20110421023737.523968644@goodmis.org
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • The Linux ftrace subsystem style for comparing is:

    var == 1
    var > 0

    and not:

    1 == var
    0 < var

    It is considered that Linux developers are smart enough not to do the

    if (var = 1)

    mistake.

    Cc: John Reiser
    Link: http://lkml.kernel.org/r/20110421023737.290712238@goodmis.org
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     

24 Apr, 2011

1 commit

  • Commit 40aee729b350 ('kconfig: fix default value for choice input')
    fixed some cases where kconfig would select the wrong option from a
    choice with a single valid option and thus enter an infinite loop.

    However, this broke the test for user input of the form 'N?', because
    when kconfig selects the single valid option the input is zero-length
    and the test will read the byte before the input buffer. If this
    happens to contain '?' (as it will in a mips build on Debian unstable
    today) then kconfig again enters an infinite loop.

    Signed-off-by: Ben Hutchings
    Cc: stable@kernel.org [2.6.17+]
    Signed-off-by: Linus Torvalds

    Ben Hutchings
     

31 Mar, 2011

1 commit


23 Mar, 2011

5 commits

  • I'm not sure why the read-only data section is excluded from the report,
    it seems as relevant as the other data sections (b and d).

    I've stripped the symbols starting with __mod_ as they can have their
    names dynamically generated and thus comparison between binaries is not
    possible.

    Signed-off-by: Jean Delvare
    Cc: Andi Kleen
    Acked-by: Nathan Lynch
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jean Delvare
     
  • Because the second and third arguments of memset have the same type, it
    turns out to be really easy to mix them up.

    This bug comes up time after time, so checkpatch should really be checking
    for it at patch submission time.

    Signed-off-by: Dave Jones
    Cc: Steven Rostedt
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Jones
     
  • If you run checkpatch against multiple patches, and one of them has a
    whitespace issue which can be helped via a script (rpt_cleaners), you will
    see the same NOTE over and over for all subsequent patches. It makes it
    seem like those patches also have whitespace problems when in reality,
    there's only one or two bad apples.

    So reset rpt_cleaners back to 0 after we've issued the note so that it
    only shows up near the patch with the actual problems.

    Signed-off-by: Mike Frysinger
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • 1. simple_strto*() do not contain overflow checks and crufty,
    libc way to indicate failure.
    2. strict_strto*() also do not have overflow checks but the name and
    comments pretend they do.
    3. Both families have only "long long" and "long" variants,
    but users want strtou8()
    4. Both "simple" and "strict" prefixes are wrong:
    Simple doesn't exactly say what's so simple, strict should not exist
    because conversion should be strict by default.

    The solution is to use "k" prefix and add convertors for more types.
    Enter
    kstrtoull()
    kstrtoll()
    kstrtoul()
    kstrtol()
    kstrtouint()
    kstrtoint()

    kstrtou64()
    kstrtos64()
    kstrtou32()
    kstrtos32()
    kstrtou16()
    kstrtos16()
    kstrtou8()
    kstrtos8()

    Include runtime testsuite (somewhat incomplete) as well.

    strict_strto*() become deprecated, stubbed to kstrto*() and
    eventually will be removed altogether.

    Use kstrto*() in code today!

    Note: on some archs _kstrtoul() and _kstrtol() are left in tree, even if
    they'll be unused at runtime. This is temporarily solution,
    because I don't want to hardcode list of archs where these
    functions aren't needed. Current solution with sizeof() and
    __alignof__ at least always works.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Extend the usage of the K section in the MAINTAINERS file to support
    matching regular expressions to any arbitrary text that may precede the
    patch itself. For example, the commit message or mail headers generated
    by git-format-patch.

    Signed-off-by: Joe Perches
    Original-patch-by: L. Alberto Giménez
    Acked-by: L. Alberto Giménez

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

    Joe Perches
     

22 Mar, 2011

1 commit

  • * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
    kbuild: Make DEBUG_SECTION_MISMATCH selectable, but not on by default
    genksyms: Regenerate lexer and parser
    genksyms: Track changes to enum constants
    genksyms: simplify usage of find_symbol()
    genksyms: Add helpers for building string lists
    genksyms: Simplify printing of symbol types
    genksyms: Simplify lexer
    genksyms: Do not paste the bison header file to lex.c
    modpost: fix trailing comma
    KBuild: silence "'scripts/unifdef' is up to date."
    kbuild: Add extra gcc checks
    kbuild: reenable section mismatch analysis
    unifdef: update to upstream version 2.5

    Linus Torvalds
     

21 Mar, 2011

2 commits


17 Mar, 2011

11 commits

  • Michal Marek
     
  • Regenerated the parser after "genksyms: Track changes to enum
    constants".

    Signed-off-by: Michal Marek
    Acked-by: Sam Ravnborg

    Michal Marek
     
  • Enum constants can be used as array sizes; if the enum itself does not
    appear in the symbol expansion, a change in the enum constant will go
    unnoticed. Example patch that changes the ABI but does not change the
    checksum with current genksyms:

    | enum e {
    | E1,
    | E2,
    |+ E3,
    | E_MAX
    | };
    |
    | struct s {
    | int a[E_MAX];
    | }
    |
    | int f(struct s *s) { ... }
    | EXPORT_SYMBOL(f)

    Therefore, remember the value of each enum constant and
    expand each occurence to . The value is not actually
    computed, but instead an expression in the form
    (last explicitly assigned value) + N
    is used. This avoids having to parse and semantically understand whole
    of C.

    Note: The changes won't take effect until the lexer and parser are
    rebuilt by the next patch.

    Signed-off-by: Michal Marek
    Acked-by: Sam Ravnborg

    Michal Marek
     
  • Allow searching for symbols of an exact type. The lexer does this and a
    subsequent patch will add one more usage.

    Signed-off-by: Michal Marek
    Acked-by: Sam Ravnborg

    Michal Marek
     
  • Signed-off-by: Michal Marek
    Acked-by: Sam Ravnborg

    Michal Marek
     
  • Instead of special-casing SYM_NORMAL, do not map any name to it. Also
    explicitly set the single-letter name of the symbol type, which will be
    needed by a further patch. The only user-visible change is one debug
    printf.

    Signed-off-by: Michal Marek
    Acked-by: Sam Ravnborg

    Michal Marek
     
  • The V2_TOKENS state is active all the time.

    Signed-off-by: Michal Marek
    Acked-by: Sam Ravnborg

    Michal Marek
     
  • The header is already #included, no need to include it a second time.
    lex.c_shipped was regenerated using flex-2.5.35.

    Signed-off-by: Michal Marek
    Acked-by: Sam Ravnborg

    Michal Marek
     
  • Consolidate locations that print a section whitelist into
    calls to print_section_list().

    Fix print_section_list() so that it does not print a trailing
    comma & space:

    If the reference is valid then annotate the
    variable with __init* or __refdata (see linux/init.h) or name the variable:
    *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

    becomes:
    If the reference is valid then annotate the
    variable with __init* or __refdata (see linux/init.h) or name the variable:
    *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

    Signed-off-by: Randy Dunlap
    Signed-off-by: Michal Marek

    Randy Dunlap
     
  • While changing our build system over to use the headers_install target
    as part of our klibc build, the following message started showing up in
    our logs:

    make[2]: `scripts/unifdef' is up to date.

    It turns out that the build blindly invokes a recursive make on this
    target, which causes make to emit this message when the target is
    already up to date. This isn't seen for most targets as the rest of the
    build relies primarily on the default target and on PHONY targets when
    invoking make recursively.

    Silence the above message when building unifdef as part of
    headers_install by hiding it behind a new PHONY target called
    "build_unifdef" that has an empty recipe.

    Signed-off-by: Mike Waychison
    Acked-by: WANG Cong
    Signed-off-by: Michal Marek

    Mike Waychison
     
  • …s/security-testing-2.6

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6: (33 commits)
    AppArmor: kill unused macros in lsm.c
    AppArmor: cleanup generated files correctly
    KEYS: Add an iovec version of KEYCTL_INSTANTIATE
    KEYS: Add a new keyctl op to reject a key with a specified error code
    KEYS: Add a key type op to permit the key description to be vetted
    KEYS: Add an RCU payload dereference macro
    AppArmor: Cleanup make file to remove cruft and make it easier to read
    SELinux: implement the new sb_remount LSM hook
    LSM: Pass -o remount options to the LSM
    SELinux: Compute SID for the newly created socket
    SELinux: Socket retains creator role and MLS attribute
    SELinux: Auto-generate security_is_socket_class
    TOMOYO: Fix memory leak upon file open.
    Revert "selinux: simplify ioctl checking"
    selinux: drop unused packet flow permissions
    selinux: Fix packet forwarding checks on postrouting
    selinux: Fix wrong checks for selinux_policycap_netpeer
    selinux: Fix check for xfrm selinux context algorithm
    ima: remove unnecessary call to ima_must_measure
    IMA: remove IMA imbalance checking
    ...

    Linus Torvalds
     

16 Mar, 2011

3 commits

  • …git/tip/linux-2.6-tip

    * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (184 commits)
    perf probe: Clean up probe_point_lazy_walker() return value
    tracing: Fix irqoff selftest expanding max buffer
    tracing: Align 4 byte ints together in struct tracer
    tracing: Export trace_set_clr_event()
    tracing: Explain about unstable clock on resume with ring buffer warning
    ftrace/graph: Trace function entry before updating index
    ftrace: Add .ref.text as one of the safe areas to trace
    tracing: Adjust conditional expression latency formatting.
    tracing: Fix event alignment: skb:kfree_skb
    tracing: Fix event alignment: mce:mce_record
    tracing: Fix event alignment: kvm:kvm_hv_hypercall
    tracing: Fix event alignment: module:module_request
    tracing: Fix event alignment: ftrace:context_switch and ftrace:wakeup
    tracing: Remove lock_depth from event entry
    perf header: Stop using 'self'
    perf session: Use evlist/evsel for managing perf.data attributes
    perf top: Don't let events to eat up whole header line
    perf top: Fix events overflow in top command
    ring-buffer: Remove unused #include <linux/trace_irq.h>
    tracing: Add an 'overwrite' trace_option.
    ...

    Linus Torvalds
     
  • …el/git/tip/linux-2.6-tip

    * 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    rtmutex: tester: Remove the remaining BKL leftovers
    lockdep/timers: Explain in detail the locking problems del_timer_sync() may cause
    rtmutex: Simplify PI algorithm and make highest prio task get lock
    rwsem: Remove redundant asmregparm annotation
    rwsem: Move duplicate function prototypes to linux/rwsem.h
    rwsem: Unify the duplicate rwsem_is_locked() inlines
    rwsem: Move duplicate init macros and functions to linux/rwsem.h
    rwsem: Move duplicate struct rwsem declaration to linux/rwsem.h
    x86: Cleanup rwsem_count_t typedef
    rwsem: Cleanup includes
    locking: Remove deprecated lock initializers
    cred: Replace deprecated spinlock initialization
    kthread: Replace deprecated spinlock initialization
    xtensa: Replace deprecated spinlock initialization
    um: Replace deprecated spinlock initialization
    sparc: Replace deprecated spinlock initialization
    mips: Replace deprecated spinlock initialization
    cris: Replace deprecated spinlock initialization
    alpha: Replace deprecated spinlock initialization
    rtmutex-tester: Remove BKL tests

    Linus Torvalds
     
  • James Morris
     

14 Mar, 2011

1 commit

  • Recent change to fixdep:

    commit b7bd182176960fdd139486cadb9962b39f8a2b50
    Author: Michal Marek
    Date: Thu Feb 17 15:13:54 2011 +0100

    fixdep: Do not record dependency on the source file itself

    changed the format of the *.cmd files without realizing that it is also
    used by modpost. Put the path to the source file to the file back, in a
    special variable, so that modpost sees all source files when calculating
    srcversion for modules.

    Reported-and-tested-by: Henrik Rydberg
    Signed-off-by: Michal Marek
    Signed-off-by: Linus Torvalds

    Michal Marek
     

10 Mar, 2011

1 commit


09 Mar, 2011

2 commits