The new check for asm/types.h and linux/types.h had
a few false positives.
o We cannot let linux/types.h include linux/types.h
o The int-ll64.h and int-ll64.h define the types
and are included by linux/types.h
Handle this by hardcoding the filenames in the headers_check script.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
If we see __[us](8|16|32|64) then we must include <linux/types.h>
If wee see include of <asm/types.h> then we recommend <linux/types.h>
Original script from Mike but modified by me.
Cc: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Headers in userspace should be using the __xxx__ form of the asm, inline,
and volatile keywords. Since people like to revert these things without
realizing what's going on, have the headers install step autoconvert these
keywords.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Since prototypes with "extern" refer to kernel functions, they make no
sense in userspace, so reject them automatically.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
[sam: made it into a warning]
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
We now say where we detect the second source of a file,
and where we detect a recursively source of the same file.
This makes it easier to fix such errors.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next: (25 commits)
allow stripping of generated symbols under CONFIG_KALLSYMS_ALL
kbuild: strip generated symbols from *.ko
kbuild: simplify use of genksyms
kernel-doc: check for extra kernel-doc notations
kbuild: add headerdep used to detect inclusion cycles in header files
kbuild: fix string equality testing in tags.sh
kbuild: fix make tags/cscope
kbuild: fix make incompatibility
kbuild: remove TAR_IGNORE
setlocalversion: add git-svn support
setlocalversion: print correct subversion revision
scripts: improve the decodecode script
scripts/package: allow custom options to rpm
genksyms: allow to ignore symbol checksum changes
genksyms: track symbol checksum changes
tags and cscope support really belongs in a shell script
kconfig: fix options to check-lxdialog.sh
kbuild: gen_init_cpio expands shell variables in file names
remove bashisms from scripts/extract-ikconfig
kbuild: teach mkmakfile to be silent
...
Building upon parts of the module stripping patch, this patch
introduces similar stripping for vmlinux when CONFIG_KALLSYMS_ALL=y.
Using CONFIG_KALLSYMS_STRIP_GENERATED reduces the overhead of
CONFIG_KALLSYMS_ALL from 245k/310k to 65k/80k for the (i386/x86-64)
kernels I tested with.
The patch also does away with the need to special case the kallsyms-
internal symbols by making them available even in the first linking
stage.
While it is a generated file, the patch includes the changes to
scripts/genksyms/keywords.c_shipped, as I'm unsure what the procedure
here is.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
This patch changes the way __crc_ symbols are being resolved from
using ld to do so to using the assembler, thus allowing these symbols
to be marked local (the linker creates then as global ones) and hence
allow stripping (for modules) or ignoring (for vmlinux) them. While at
this, also strip other generated symbols during module installation.
One potentially debatable point is the handling of the flags passeed
to gcc when translating the intermediate assembly file into an object:
passing $(c_flags) unchanged doesn't work as gcc passes --gdwarf2 to
gas whenever is sees any -g* option, even for -g0, and despite the
fact that the compiler would have already produced all necessary debug
info in the C->assembly translation phase. I took the approach of just
filtering out all -g* options, but an alternative to such negative
filtering might be to have a positive filter which might, in the ideal
case allow just all the -Wa,* options to pass through.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Add functionality to check for function parameters or structure (or
union/typedef/enum) field members that are described in kernel-doc but
are not part of the expected (declared) parameters or structure.
These generate warnings that are called "Excess" descriptions.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
- fix combining O=... and tags
- don't allow * expansion during sh function calls
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
[sam: use KBUILD_SRC to check if we use O=...]
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Impact: let the function-graph-tracer be aware of the irq entrypoints
Add a new .irqentry.text section to store the irq entrypoints functions
inside the same section. This way, the tracer will be able to signal
an interrupts triggering on output by recognizing these entrypoints.
Also, make this section recordable for dynamic tracing.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Given that there is no usage of a TAR_IGNORE variable remove it
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Print svn revision in addition to git info on git-svn repos.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Output svn revision of latest change, instead of repo revision as thats
what we're interested in (especially when working on a branch/tag).
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
kerneloops.org has been using an improved "decodecode" script,
specifically it has a special marker that shows which line in the assembly
the oops happened at, like this:
20: 83 e0 03 and $0x3,%eax
23: 09 d8 or %ebx,%eax
25: 85 db test %ebx,%ebx
27: 89 02 mov %eax,(%edx)
29: 74 0f je 0x3a
2b:* 3b 73 04 cmp 0x4(%ebx),%esi <-- trapping instruction
2e: 75 05 jne 0x35
30: 89 53 04 mov %edx,0x4(%ebx)
33: eb 07 jmp 0x3c
35: 89 53 08 mov %edx,0x8(%ebx)
this patch updates the kernel copy to also have this functionality.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Reviewed-by: WANG Cong <wangcong@zeuux.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Add a RPMOPTS make variable to allow arbitrary options to be passed
to rpm during 'make rpm-pkg'. For example:
make RPMOPTS="--define '_topdir /home/jk/rpm'" rpm-pkg
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
This adds an "override" keyword for use in *.symvers / *.symref files.
When a symbol is overridden, the symbol's old definition will be used for
computing checksums instead of the new one, preserving the previous
checksum. (Genksyms will still warn about the change.)
This is meant to allow distributions to hide minor actual as well as fake
ABI changes. (For example, when extra type information becomes available
because additional headers are included, this may change checksums even
though none of the types used have actully changed.)
This approach also allows to get rid of "#ifdef __GENKSYMS__" hacks in the
code, which are currently used in some vendor kernels to work around
checksum changes.
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Sometimes it is preferable to avoid changes of exported symbol checksums
(to avoid breaking externally provided modules). When a checksum change
occurs, it can be hard to figure out what caused this change: underlying
types may have changed, or additional type information may simply have
become available at the point where a symbol is exported.
Add a new --reference option to genksyms which allows it to report why
checksums change, based on the type information dumps it creates with the
--dump-types flag. Genksyms will read in such a dump from a previous run,
and report which symbols have changed (and why).
The behavior can be controlled for an entire build as follows: If
KBUILD_SYMTYPES is set, genksyms uses --dump-types to produce *.symtypes
dump files. If any *.symref files exist, those will be used as the
reference to check against. If KBUILD_PRESERVE is set, checksum changes
will fail the build.
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
as they do not benefit from the make functionality.
Moving the support to a shell script has several benefits:
- The readability of the code has increased a lot
- More people is able to extend the tags support
- We see less changes to the top-level Makefile
The shell script version includes improvements from:
Alexey Dobriyan <adobriyan@gmail.com> (jump to kconfig symbols)
Alexey Dobriyan <adobriyan@gmail.com> (drop ./ in paths)
Ian Campbell <ijc@hellion.org.uk> (simplified find algorithms)
This version has a few caveats:
=> It does not support ALLSOURCE_ARCHS
- it is easy to add if it is really used
=> It assumes all archs have moved to arch/$ARCH/include
- until that happens we have a few additional hits in the archs
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Tested-by: Ian Campbell <ijc@hellion.org.uk>
unbashify-extract-ikconfig.patch
scripts/extract-ikconfig contains a lot of gratuituous bashisms,
which make it fail if /bin/sh isn't bash. This patch replaces them
with regular Bourne shell constructs.
Signed-off-by: Werner Almesberger <werner@openmoko.org>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com> # as file author
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Convert a few echos in the build system to new $(kecho) so we get correct
output according to build verbosity.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
[sam: added kecho in a few more places for O=... builds]
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
There is a bunch of places in the build system where we do 'echo' to show
some nice status lines. This means we still get output when running in
silent mode. So declare a new KECHO variable that only does 'echo' when we
are in a suitable verbose build mode.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
[sam: added Documentation]
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
The mkcompile_h script does `echo` regardless of silent mode the make is
running at, so have it respect $quiet from kbuild and only echo when not in
silent mode.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
kbuild failed to expand include flags in KBUILD_CPPFLAGS
resulting in code like this in arch Makefiles:
ifeq ($(KBUILD_SRC),)
KBUILD_CPPFLAGS += -Iinclude/foo
else
KBUILD_CPPFLAGS += -I$(srctree)/include/foo
endif
Move use of LINUXINCLUDE into Makefile.lib to allow
us to expand -I directives of KBUILD_CPPFLAGS so
we can avoid the above code.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
When adding extra -I options with O=... we could
end up in a situation where there were no parameters to -I.
So we had a commandline that looked like this:
... -I -Wall ...
This had the undesired side effect that gcc assumed "-Wall"
was a path to look for include files so this options was
effectively ignored.
This happens only when we build the generated module.mod.c files
as part of the final modules builds and is as such harmless
with current kbuild.
This bug was exposed when we rearranged the options to gcc.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
The method for listing varargs in kernel-doc notation is:
* @...: these arguments are printed by the @fmt argument
but scripts/kernel-doc is confused: it always lists varargs as:
... variable arguments
and ignores the @...: line's description, but then prints that
line after the list of function parameters as though it's
not part of the function parameters.
This patch makes kernel-doc print the supplied @... description if it is
present; otherwise a boilerplate "variable arguments" is printed.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Impact: new "power-tracer" ftrace plugin
This patch adds a C/P-state ftrace plugin that will generate
detailed statistics about the C/P-states that are being used,
so that we can look at detailed decisions that the C/P-state
code is making, rather than the too high level "average"
that we have today.
An example way of using this is:
mount -t debugfs none /sys/kernel/debug
echo cstate > /sys/kernel/debug/tracing/current_tracer
echo 1 > /sys/kernel/debug/tracing/tracing_enabled
sleep 1
echo 0 > /sys/kernel/debug/tracing/tracing_enabled
cat /sys/kernel/debug/tracing/trace | perl scripts/trace/cstate.pl > out.svg
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Impact: widen the scope of recordmcount.pl
Besides .text section, there are three .text sections that won't
be freed after kernel booting. They are: .sched.text, .spinlock.text
and .kprobes.text, which contain functions we can trace. But the last
section ".kprobes.text" is particular, which has been marked as "notrace",
we ignore it. Thus we add other two sections.
Signed-off-by: Liming Wang <liming.wang@windriver.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Impact: extend scripts/recordmcount.pl to ARM
Arm uses %progbits instead of @progbits and requires only 4 byte alignment.
[ Thanks to Sam Ravnborg for mentioning that ARM uses %progbits ]
Signed-off-by: Jim Radford <radford@galvanix.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Impact: extend scripts/recordmcount.pl with default alignment for SH
Set $alignment=2 for the sh architecture so that a ".align 2" directive
will be emitted for all __mcount_loc sections. Fix a whitspace error
while I'm here (converted spaces to tabs).
Signed-off-by: Matt Fleming <mjf@gentoo.org>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Impact: cleanup of recordmcount.pl
Now that more architectures are being ported to the MCOUNT_RECORD
method, there is no reason to have each declare their own arch
specific variable if most of them share the same value. This patch
creates a set of default values for the arch specific variables
based off of i386.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Impact: Add PowerPC port to recordmcount.pl script
This patch updates the recordmcount.pl script to process
PowerPC.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
First cut at dynamic ftrace support.
[
Steven Rostedt - only updated the recordmcount.pl file.
There are updates for PowerPC that will conflict with this,
and we need to base off of these changes.
]
Signed-off-by: Matt Fleming <mjf@gentoo.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Since this scripts output is usually redirected, put error messages
on standard error and exit with error code if no data is found.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Impact: cleanup
Fix the following warning from the perl syntax checking tool perlcritic.
This tool is a lint like tool that checks for perl best practices.
Loop iterator is not lexical at line 113, column 1.
See page 108 of PBP. (Severity: 5)
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
The below is a simplistic fix for "make deb-pkg"; it splits the
firmware out to a linux-firmware-image package and adds an
(unversioned) Suggests to the linux package for this firmware.
Signed-Off-By: Jonathan McDowell <noodles@earth.li>
Acked-by: Frans Pop <elendil@planet.nl>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Impact: add alignment option for recordmcount.pl script
Align the __mcount_loc sections so that architectures with strict
alignment requirements need not worry about performing unaligned
accesses.
This fixes an issue where I was seeing unaligned accesses, which are not
supported on our architecture (the results of an unaligned access are
undefined).
Signed-off-by: Matt Fleming <matthew.fleming@imgtec.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>