29 Nov, 2017
1 commit
-
printk specifier %p now hashes all addresses before printing. Sometimes
we need to see the actual unmodified address. This can be achieved using
%lx but then we face the risk that if in future we want to change the
way the Kernel handles printing of pointers we will have to grep through
the already existent 50 000 %lx call sites. Let's add specifier %px as a
clear, opt-in, way to print a pointer and maintain some level of
isolation from all the other hex integer output within the Kernel.Add printk specifier %px to print the actual unmodified address.
Signed-off-by: Tobin C. Harding
26 Nov, 2017
2 commits
-
Pull timer updates from Thomas Gleixner:
- The final conversion of timer wheel timers to timer_setup().
A few manual conversions and a large coccinelle assisted sweep and
the removal of the old initialization mechanisms and the related
code.- Remove the now unused VSYSCALL update code
- Fix permissions of /proc/timer_list. I still need to get rid of that
file completely- Rename a misnomed clocksource function and remove a stale declaration
* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (27 commits)
m68k/macboing: Fix missed timer callback assignment
treewide: Remove TIMER_FUNC_TYPE and TIMER_DATA_TYPE casts
timer: Remove redundant __setup_timer*() macros
timer: Pass function down to initialization routines
timer: Remove unused data arguments from macros
timer: Switch callback prototype to take struct timer_list * argument
timer: Pass timer_list pointer to callbacks unconditionally
Coccinelle: Remove setup_timer.cocci
timer: Remove setup_*timer() interface
timer: Remove init_timer() interface
treewide: setup_timer() -> timer_setup() (2 field)
treewide: setup_timer() -> timer_setup()
treewide: init_timer() -> setup_timer()
treewide: Switch DEFINE_TIMER callbacks to struct timer_list *
s390: cmm: Convert timers to use timer_setup()
lightnvm: Convert timers to use timer_setup()
drivers/net: cris: Convert timers to use timer_setup()
drm/vc4: Convert timers to use timer_setup()
block/laptop_mode: Convert timers to use timer_setup()
net/atm/mpc: Avoid open-coded assignment of timer callback function
... -
Pull more Kbuild updates from Masahiro Yamada:
- use 'pwd' instead of '/bin/pwd' for portability
- clean up Makefiles
- fix ld-option for clang
- fix malloc'ed data size in Kconfig
- fix parallel building along with coccicheck
- fix a minor issue of package building
- prompt to use "rpm-pkg" instead of "rpm"
- clean up *.i and *.lst patterns by "make clean"
* tag 'kbuild-v4.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
kbuild: drop $(extra-y) from real-objs-y
kbuild: clean up *.i and *.lst patterns by make clean
kbuild: rpm: prompt to use "rpm-pkg" if "rpm" target is used
kbuild: pkg: use --transform option to prefix paths in tar
coccinelle: fix parallel build with CHECK=scripts/coccicheck
kconfig/symbol.c: use correct pointer type argument for sizeof
kbuild: Set KBUILD_CFLAGS before incl. arch Makefile
kbuild: remove all dummy assignments to obj-
kbuild: create built-in.o automatically if parent directory wants it
kbuild: /bin/pwd -> pwd
24 Nov, 2017
1 commit
-
Pull documentation updates from Jonathan Corbet:
"A few late-arriving docs updates that have no real reason to wait.There's a new "Co-Developed-by" tag described by Greg, and a build
enhancement from Willy to generate docs warnings during a kernel build
(but only when additional warnings have been requested in general)"* tag 'docs-4.15-2' of git://git.lwn.net/linux:
Add optional check for bad kernel-doc comments
Documentation: fix profile= options in kernel-parameters.txt
documentation/svga.txt: update outdated file
kokr/memory-barriers.txt: Fix typo in paring example
kokr/memory-barriers/txt: Replace uses of "transitive"
Documentation/process: add Co-Developed-by: tag for patches with multiple authors
23 Nov, 2017
5 commits
-
$(real-objs-y) in only used in scripts/Makefile.build to form
"targets", but $(extra-y) is added to "targets" in another line.
We do not need to add $(extra-y) twice.Signed-off-by: Masahiro Yamada
-
The "rpm" has been kept for backward compatibility since pre-git era.
I am planning to remove it after the Linux 4.18 release. Annouce the
end of the support, prompting to use "rpm-pkg" instead.If you use "rpm", it will work like "rpm-pkg", but warning messages
will be displayed as follows:WARNING: "rpm" target will be removed after Linux 4.18
Please use "rpm-pkg" instead.Signed-off-by: Masahiro Yamada
-
For rpm-pkg and deb-pkg, a source tar file is created. All paths in
the archive must be prefixed with the base name of the tar so that
everything is contained in the directory when you extract it.Currently, scripts/package/Makefile uses a symlink for that, and
removes it after the tar is created.If you terminate the build during the tar creation, the symlink is
left over. Then, at the next package build, you will see a warning
like follows:ln: '.' and 'kernel-4.14.0+/.' are the same file
It is possible to fix it by adding -n (--no-dereference) option to
the "ln" command, but a cleaner way is to use --transform option
of "tar" command. This option is GNU extension, but it should not
hurt to use it in the Linux build system.The 'S' flag is needed to exclude symlinks from the path fixup.
Without it, symlinks in the kernel are broken.Signed-off-by: Masahiro Yamada
-
The command "make -j8 C=1 CHECK=scripts/coccicheck" produces
lots of "coccicheck failed" error messages.Julia Lawall explained the Coccinelle behavior as follows:
"The problem on the Coccinelle side is that it uses a subdirectory
with the name of the semantic patch to store standard output and
standard error for the different threads. I didn't want to use a
name with the pid, so that one could easily find this information
while Coccinelle is running. Normally the subdirectory is cleaned
up when Coccinelle completes, so there is only one of them at a time.
Maybe it is best to just add the pid. There is the risk that these
subdirectories will accumulate if Coccinelle crashes in a way such
that they don't get cleaned up, but Coccinelle could print a warning
if it detects this case, rather than failing."When scripts/coccicheck is used as CHECK tool and -j option is given
to Make, the whole of build process runs in parallel. So, multiple
processes try to get access to the same subdirectory.I notice spatch creates the subdirectory only when it runs in parallel
(i.e. --jobs is given and is greater than 1).Setting NPROC=1 is a reasonable solution; spatch does not create the
subdirectory. Besides, ONLINE=1 mode takes a single file input for
each spatch invocation, so there is no reason to parallelize it in
the first place.Signed-off-by: Masahiro Yamada
Acked-by: Julia Lawall -
sym_arr is of type struct symbol **.
So in malloc we need sizeof(struct symbol *).The problem was indicated by coccinelle.
Signed-off-by: Heinrich Schuchardt
Signed-off-by: Masahiro Yamada
22 Nov, 2017
1 commit
-
Both the init_timer() and timer_setup() APIs have been removed. This
script will not be needed any more.Signed-off-by: Kees Cook
21 Nov, 2017
1 commit
-
Implement a '-none' output mode for kernel-doc which will only output
warning messages, and suppresses the warning message about there being
no kernel-doc in the file.If the build has requested additional warnings, automatically check all
.c files. This patch does not check .h files. Enabling the warning
by default would add about 1300 warnings, so it's default off for now.
People who care can use this to check they didn't break the docs and
maybe we'll get all the warnings fixed and be able to enable this check
by default in the future.Signed-off-by: Matthew Wilcox
Signed-off-by: Jonathan Corbet
18 Nov, 2017
15 commits
-
"obj-y += foo/" syntax requires Kbuild to visit the "foo" subdirectory
and link built-in.o from that directory. This means foo/Makefile is
responsible for creating built-in.o even if there is no object to
link (in this case, built-in.o is an empty archive).We have had several fixups like commit 4b024242e8a4 ("kbuild: Fix
linking error built-in.o no such file or directory"), then ended up
with a complex condition as follows:ifneq ($(strip $(obj-y) $(obj-m) $(obj-) $(subdir-m) $(lib-target)),)
builtin-target := $(obj)/built-in.o
endifWe still have more cases not covered by the above, so we need to add
obj- := dummy.o
in several places just for creating empty built-in.o.A key point is, the parent Makefile knows whether built-in.o is needed
or not. If a subdirectory needs to create built-in.o, its parent can
tell the fact when descending.If non-empty $(need-builtin) flag is passed from the parent, built-in.o
should be created. $(obj-y) should be still checked to support the
single target "%/". All of ugly tricks will go away.Signed-off-by: Masahiro Yamada
Reviewed-by: Sam Ravnborg -
…asahiroy/linux-kbuild
Pull Kbuild misc updates from Masahiro Yamada:
- Clean up and fix RPM package build
- Fix a warning in DEB package build
- Improve coccicheck script
- Improve some semantic patches
* tag 'kbuild-misc-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
docs: dev-tools: coccinelle: delete out of date wiki reference
coccinelle: orplus: reorganize to improve performance
coccinelle: use exists to improve efficiency
builddeb: Pass the kernel:debarch substvar to dpkg-genchanges
Coccinelle: use false positive annotation
coccinelle: fix verbose message about .cocci file being run
coccinelle: grep Options and Requires fields more precisely
Coccinelle: make DEBUG_FILE option more useful
coccinelle: api: detect identical chip data arrays
coccinelle: Improve setup_timer.cocci matching
Coccinelle: setup_timer: improve messages from setup_timer
kbuild: rpm-pkg: do not force -jN in submake
kbuild: rpm-pkg: keep spec file until make mrproper
kbuild: rpm-pkg: fix jobserver unavailable warning
kbuild: rpm-pkg: replace $RPM_BUILD_ROOT with %{buildroot}
kbuild: rpm-pkg: fix build error when CONFIG_MODULES is disabled
kbuild: rpm-pkg: refactor mkspec with here doc
kbuild: rpm-pkg: clean up mkspec
kbuild: rpm-pkg: install vmlinux.bz2 unconditionally
kbuild: rpm-pkg: remove ppc64 specific image handling -
Pull Kbuild updates from Masahiro Yamada:
"One of the most remarkable improvements in this cycle is, Kbuild is
now able to cache the result of shell commands. Some variables are
expensive to compute, for example, $(call cc-option,...) invokes the
compiler. It is not efficient to redo this computation every time,
even when we are not actually building anything. Kbuild creates a
hidden file ".cache.mk" that contains invoked shell commands and their
results. The speed-up should be noticeable.Summary:
- Fix arch build issues (hexagon, sh)
- Clean up various Makefiles and scripts
- Fix wrong usage of {CFLAGS,LDFLAGS}_MODULE in arch Makefiles
- Cache variables that are expensive to compute
- Improve cc-ldopton and ld-option for Clang
- Optimize output directory creation"
* tag 'kbuild-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (30 commits)
kbuild: move coccicheck help from scripts/Makefile.help to top Makefile
sh: decompressor: add shipped files to .gitignore
frv: .gitignore: ignore vmlinux.lds
selinux: remove unnecessary assignment to subdir-
kbuild: specify FORCE in Makefile.headersinst as .PHONY target
kbuild: remove redundant mkdir from ./Kbuild
kbuild: optimize object directory creation for incremental build
kbuild: create object directories simpler and faster
kbuild: filter-out PHONY targets from "targets"
kbuild: remove redundant $(wildcard ...) for cmd_files calculation
kbuild: create directory for make cache only when necessary
sh: select KBUILD_DEFCONFIG depending on ARCH
kbuild: fix linker feature test macros when cross compiling with Clang
kbuild: shrink .cache.mk when it exceeds 1000 lines
kbuild: do not call cc-option before KBUILD_CFLAGS initialization
kbuild: Cache a few more calls to the compiler
kbuild: Add a cache for generated variables
kbuild: add forward declaration of default target to Makefile.asm-generic
kbuild: remove KBUILD_SUBDIR_ASFLAGS and KBUILD_SUBDIR_CCFLAGS
hexagon/kbuild: replace CFLAGS_MODULE with KBUILD_CFLAGS_MODULE
... -
The flag enables Clang instrumentation of comparison operations
(currently not supported by GCC). This instrumentation is needed by the
new KCOV device to collect comparison operands.Link: http://lkml.kernel.org/r/20171011095459.70721-2-glider@google.com
Signed-off-by: Victor Chibotaru
Signed-off-by: Alexander Potapenko
Cc: Dmitry Vyukov
Cc: Andrey Konovalov
Cc: Mark Rutland
Cc: Alexander Popov
Cc: Andrey Ryabinin
Cc: Kees Cook
Cc: Vegard Nossum
Cc: Quentin Casasnovas
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
checkpatch.pl does not check missing blank line before module_*_driver.
I want it to behave likewise for builtin_*_driver.Link: http://lkml.kernel.org/r/1505700081-12854-1-git-send-email-yamada.masahiro@socionext.com
Signed-off-by: Masahiro Yamada
Acked-by: Joe Perches
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Lines that end in an open bracket or open parenthesis are generally hard
to follow. Lines following those ending with open parenthesis are also
rarely aligned to that open parenthesis.Suggest not ending lines with '[' or '('
Link: http://lkml.kernel.org/r/8fd0b2b4a7482064254e37931eb9302a81d5aa2f.1508340786.git.joe@perches.com
Signed-off-by: Joe Perches
Suggested-by: Vivien Didelot
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
So the line length check can be bypassed by its callers.
Link: http://lkml.kernel.org/r/7de542c08a6e79f2ebe7c1416c9f403c23fdcc09.1508282823.git.joe@perches.com
Signed-off-by: Joe Perches
Reported-by: Song Liu
Tested-by: Song Liu
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Some of the definitions are very long and can't be split into multiple
lines because ctags is limited.Exempt these lines from the line length checks.
See commit 25528213fe9f ("tags: Fix DEFINE_PER_CPU expansions") for more
details.Link: http://lkml.kernel.org/r/1508170320.6530.15.camel@perches.com
Signed-off-by: Joe Perches
Acked-by: Mark Rutland
Cc: Daniel Lezcano
Cc: Marc Zyngier
Cc: Thomas Gleixner
Cc: Ard Biesheuvel
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
There was code in checkpatch that allowed continuation printks to be
used without KERN_CONT. Remove the continuation check and always
require a KERN_.Link: http://lkml.kernel.org/r/61980ef41d5b9b6543da1c49055042e0ab74d308.1507047008.git.joe@perches.com
Signed-off-by: Joe Perches
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
void foo(int a)
switch (a) {
case 'h':
fun1();
exit(1);
default:
}creates a warning "Possible switch case/default not preceded by break or
fallthrough comment".exit( should be treated like return.
Link: http://lkml.kernel.org/r/20170910154618.25819-1-xypron.glpk@gmx.de
Signed-off-by: Heinrich Schuchardt
Acked-by: Joe Perches
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Current unnamed function definition argument does not include function
pointer cases and it reports something like:WARNING: function definition argument 'void' should also have an identifier name
+unsigned int (*dummy)(void);Support function pointers for unnamed function arguments
Link: http://lkml.kernel.org/r/1505389925-31087-1-git-send-email-miles.chen@mediatek.com
Signed-off-by: Miles Chen
Acked-by: Joe Perches
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add tests for duplicate section headers, missing section content, link and
scm reachability.Miscellanea:
o Add --self-test= options
(a comma separated list of any of sections, patterns, links or scm)
where the default without options is all tests
o Rename check_maintainers_patterns to self_test
o Rename self_test_pattern_info to self_test_info[tom.saeger@oracle.com: improvements]
Link: http://lkml.kernel.org/r/13e3986c374902fcf08ae947e36c5c608bbe3b79.1510075301.git.joe@perches.com
Signed-off-by: Joe Perches
Reviewed-by: Tom Saeger
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add "--self-test" option to get_maintainer.pl to show potential
issues in MAINTAINERS file(s) content.Pattern check warnings are shown for "F" and "X" patterns found in
MAINTAINERS file(s) which do not match any files known by git.Link: http://lkml.kernel.org/r/64994f911b3510d0f4c8ac2e113501dfcec1f3c9.1509559540.git.tom.saeger@oracle.com
Signed-off-by: Tom Saeger
Acked-by: Joe Perches
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
parse-maintainers.pl is convenient, but currently hard-codes the
filenames that are used.Allow user-specified filenames to simplify the use of the script.
Link: http://lkml.kernel.org/r/48703c068b3235223ffa3b2eb268fa0a125b25e0.1502251549.git.joe@perches.com
Signed-off-by: Joe Perches
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add unnecessary typos by copying the necessary typos.
Link: http://lkml.kernel.org/r/1505074722.22023.6.camel@perches.com
Signed-off-by: Joe Perches
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
16 Nov, 2017
14 commits
-
In my view, it is not helpful to have a separate file just for
the coccicheck help message. Merge scripts/Makefile.help into
the top-level Makefile.Signed-off-by: Masahiro Yamada
Acked-by: Julia Lawall -
Pull drm updates from Dave Airlie:
"This is the main drm pull request for v4.15.Core:
- Atomic object lifetime fixes
- Atomic iterator improvements
- Sparse/smatch fixes
- Legacy kms ioctls to be interruptible
- EDID override improvements
- fb/gem helper cleanups
- Simple outreachy patches
- Documentation improvements
- Fix dma-buf rcu races
- DRM mode object leasing for improving VR use cases.
- vgaarb improvements for non-x86 platforms.New driver:
- tve200: Faraday Technology TVE200 block.This "TV Encoder" encodes a ITU-T BT.656 stream and can be found in
the StorLink SL3516 (later Cortina Systems CS3516) as well as the
Grain Media GM8180.New bridges:
- SiI9234 supportNew panels:
- S6E63J0X03, OTM8009A, Seiko 43WVF1G, 7" rpi touch panel, Toshiba
LT089AC19000, Innolux AT043TN24i915:
- Remove Coffeelake from alpha support
- Cannonlake workarounds
- Infoframe refactoring for DisplayPort
- VBT updates
- DisplayPort vswing/emph/buffer translation refactoring
- CCS fixes
- Restore GPU clock boost on missed vblanks
- Scatter list updates for userptr allocations
- Gen9+ transition watermarks
- Display IPC (Isochronous Priority Control)
- Private PAT management
- GVT: improved error handling and pci config sanitizing
- Execlist refactoring
- Transparent Huge Page support
- User defined priorities support
- HuC/GuC firmware refactoring
- DP MST fixes
- eDP power sequencing fixes
- Use RCU instead of stop_machine
- PSR state tracking support
- Eviction fixes
- BDW DP aux channel timeout fixes
- LSPCON fixes
- Cannonlake PLL fixesamdgpu:
- Per VM BO support
- Powerplay cleanups
- CI powerplay support
- PASID mgr for kfd
- SR-IOV fixes
- initial GPU reset for vega10
- Prime mmap support
- TTM updates
- Clock query interface for Raven
- Fence to handle ioctl
- UVD encode ring support on Polaris
- Transparent huge page DMA support
- Compute LRU pipe tweaks
- BO flag to allow buffers to opt out of implicit sync
- CTX priority setting API
- VRAM lost infrastructure plumbingqxl:
- fix flicker since atomic reworkamdkfd:
- Further improvements from internal AMD tree
- Usermode events
- Drop radeon supportnouveau:
- Pascal temperature sensor support
- Improved BAR2 handling
- MMU rework to support Pascal MMUexynos:
- Improved HDMI/mixer support
- HDMI audio interface supporttegra:
- Prep work for tegra186
- Cleanup/fixesmsm:
- Preemption support for a5xx
- Display fixes for 8x96 (snapdragon 820)
- Async cursor plane fixes
- FW loading rework
- GPU debugging improvementsvc4:
- Prep for DSI panels
- fix T-format tiling scanout
- New madvise ioctlRockchip:
- LVDS supportomapdrm:
- omap4 HDMI CEC supportetnaviv:
- GPU performance counters groundworksun4i:
- refactor driver load + TCON backend
- HDMI improvements
- A31 support
- Misc fixesudl:
- Probe/EDID read fixes.tilcdc:
- Misc fixes.pl111:
- Support more variantsadv7511:
- Improve EDID handling.
- HDMI CEC supportsii8620:
- Add remote control support"* tag 'drm-for-v4.15' of git://people.freedesktop.org/~airlied/linux: (1480 commits)
drm/rockchip: analogix_dp: Use mutex rather than spinlock
drm/mode_object: fix documentation for object lookups.
drm/i915: Reorder context-close to avoid calling i915_vma_close() under RCU
drm/i915: Move init_clock_gating() back to where it was
drm/i915: Prune the reservation shared fence array
drm/i915: Idle the GPU before shinking everything
drm/i915: Lock llist_del_first() vs llist_del_all()
drm/i915: Calculate ironlake intermediate watermarks correctly, v2.
drm/i915: Disable lazy PPGTT page table optimization for vGPU
drm/i915/execlists: Remove the priority "optimisation"
drm/i915: Filter out spurious execlists context-switch interrupts
drm/amdgpu: use irq-safe lock for kiq->ring_lock
drm/amdgpu: bypass lru touch for KIQ ring submission
drm/amdgpu: Potential uninitialized variable in amdgpu_vm_update_directories()
drm/amdgpu: potential uninitialized variable in amdgpu_vce_ring_parse_cs()
drm/amd/powerplay: initialize a variable before using it
drm/amd/powerplay: suppress KASAN out of bounds warning in vega10_populate_all_memory_levels
drm/amd/amdgpu: fix evicted VRAM bo adjudgement condition
drm/vblank: Tune drm_crtc_accurate_vblank_count() WARN down to a debug
drm/rockchip: add CONFIG_OF dependency for lvds
... -
Pull leaking_addresses script updates from Tobin Harding:
"Here are development patches for the leaking_addresses.pl script.Changes include:
- add summary reporting to the script
- add 'SigIgn' to false positives
- add a file read timeout so the script doesn't block indefinitely
- add infrastructure to enable multi-arch support and add support for ppc
- add some exclude files/paths suggested by various people
- code clean up and refactoring
- overhaul command line options"
* tag 'leaks-4.15-rc1' of git://github.com/tcharding/linux:
leaking_addresses: add SigIgn to false positives
leaking_addresses: add timeout on file read
leaking_addresses: add support for ppc64
leaking_addresses: add summary reporting options
leaking_addresses: add to exclude files/paths list
leaking_addresses: fix comment string typo
leaking_addresses: remove command line options
leaking_addresses: remove dead/unused code
leaking_addresses: use tabs instead of spaces -
Merge updates from Andrew Morton:
- a few misc bits
- ocfs2 updates
- almost all of MM
* emailed patches from Andrew Morton : (131 commits)
memory hotplug: fix comments when adding section
mm: make alloc_node_mem_map a void call if we don't have CONFIG_FLAT_NODE_MEM_MAP
mm: simplify nodemask printing
mm,oom_reaper: remove pointless kthread_run() error check
mm/page_ext.c: check if page_ext is not prepared
writeback: remove unused function parameter
mm: do not rely on preempt_count in print_vma_addr
mm, sparse: do not swamp log with huge vmemmap allocation failures
mm/hmm: remove redundant variable align_end
mm/list_lru.c: mark expected switch fall-through
mm/shmem.c: mark expected switch fall-through
mm/page_alloc.c: broken deferred calculation
mm: don't warn about allocations which stall for too long
fs: fuse: account fuse_inode slab memory as reclaimable
mm, page_alloc: fix potential false positive in __zone_watermark_ok
mm: mlock: remove lru_add_drain_all()
mm, sysctl: make NUMA stats configurable
shmem: convert shmem_init_inodecache() to void
Unify migrate_pages and move_pages access checks
mm, pagevec: rename pagevec drained field
... -
Fix up makefiles, remove references, and git rm kmemcheck.
Link: http://lkml.kernel.org/r/20171007030159.22241-4-alexander.levin@verizon.com
Signed-off-by: Sasha Levin
Cc: Steven Rostedt
Cc: Vegard Nossum
Cc: Pekka Enberg
Cc: Michal Hocko
Cc: Eric W. Biederman
Cc: Alexander Potapenko
Cc: Tim Hansen
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
This patch provides 3 new arguments for bloat-o-meter
1) -c -> for all (showing function and data differently)
2) -d -> data
3) -t -> functionoutput:
./scripts/bloat-o-meter -c "file1" "file2"
add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-152 (-152)
Function old new delta
main 412 260 -152
Total: Before=548, After=396, chg -27.74%
##########################################################
add/remove: 1/0 grow/shrink: 1/0 up/down: 84/0 (84)
Data old new delta
arr - 64 +64
backtrace 60 80 +20
Total: Before=109, After=193, chg +77.06%
##########################################################
add/remove: 0/1 grow/shrink: 0/0 up/down: 0/-64 (-64)
RO Data old new delta
arr 64 - -64
Total: Before=68, After=4, chg -94.12%[maninder1.s@samsung.com: v1 -> v2]
Link: http://lkml.kernel.org/r/1506569402-24787-1-git-send-email-maninder1.s@samsung.com
Link: http://lkml.kernel.org/r/1506336313-27187-1-git-send-email-maninder1.s@samsung.com
Signed-off-by: Vaneet Narang
Signed-off-by: Maninder Singh
Cc: Amit Sahrawat
Cc: Andi Kleen
Cc: Michal Marek
Cc:
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Makefile.clean descends into $(subdir-y). Dummy assignment to subdir-
is meaningless.Signed-off-by: Masahiro Yamada
Acked-by: Paul Moore -
Swap the order of ".PHONY: $(PHONY)" and "PHONY += FORCE"
so that FORCE is correctly specified as a .PHONY target.Use a preferred way for specifying $(subdirs) as .PHONY targets.
Signed-off-by: Masahiro Yamada
-
The previous commit largely optimized the object directory creation.
We can optimize it more for incremental build.There are already *.cmd files in the output directory. The existing
*.cmd files have been picked up by $(wildcard ...). Obviously,
directories containing them exist too, so we can skip "mkdir -p".With this, Kbuild runs almost zero "mkdir -p" in incremental building.
Signed-off-by: Masahiro Yamada
-
For the out-of-tree build, scripts/Makefile.build creates output
directories, but this operation is not efficient.scripts/Makefile.lib calculates obj-dirs as follows:
obj-dirs := $(dir $(multi-objs) $(obj-y))
Please notice $(sort ...) is not used here. Usually the result is
as many "./" as objects here.For a lot of duplicated paths, the following command is invoked.
_dummy := $(foreach d,$(obj-dirs), $(shell [ -d $(d) ] || mkdir -p $(d)))
Then, the costly shell command is run over and over again.
I see many points for optimization:
[1] Use $(sort ...) to cut down duplicated paths before passing them
to system call
[2] Use single $(shell ...) instead of repeating it with $(foreach ...)
This will reduce forking.
[3] We can calculate obj-dirs more simply. Most of objects are already
accumulated in $(targets). So, $(dir $(targets)) is fine and more
comprehensive.I also removed ugly code in arch/x86/entry/vdso/Makefile. This is now
really unnecessary.Signed-off-by: Masahiro Yamada
Acked-by: Ingo Molnar
Tested-by: Douglas Anderson -
The variable "targets" contains object paths for which existing .*.cmd
files should be included.scripts/Makefile.build automatically adds $(MAKECMDGOALS) to "targets"
as follows:targets += $(extra-y) $(MAKECMDGOALS) $(always)
The $(MAKECMDGOALS) is a PHONY target in several places. PHONY targets
never create .*.cmd files.Signed-off-by: Masahiro Yamada
-
I do not see any reason why $(wildcard ...) needs to be called twice
for computing cmd_files. Remove the first one.Signed-off-by: Masahiro Yamada
-
Currently, the existence of $(dir $(make-cache)) is always checked,
and created if it is missing.We can avoid unnecessary system calls by some tricks.
[1] If KBUILD_SRC is unset, we are building in the source tree.
The output directory checks can be entirely skipped.
[2] If at least one cache data is found, it means the cache file
was included. Obviously its directory exists. Skip "mkdir -p".
[3] If Makefile does not contain any call of __run-and-store, it will
not create a cache file. No need to create its directory.
[4] The "mkdir -p" should be only invoked by the first call of
__run-and-storeSigned-off-by: Masahiro Yamada
Reviewed-by: Douglas Anderson -
Adding two #define constants is less common than performing & and |
operations on them, so put the addition first to reduce the set of cases
that have to be considered in detail. At the same time, add & and |
patterns for both arguments of +, to account for commutativity and obtain
more results.Running time is divided by 3 when applying this to the whole kernel on my
laptop with an Intel i5-6200U CPU.Signed-off-by: Julia Lawall
Signed-off-by: Masahiro Yamada