Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild

Pull misc kbuild changes from Michal Marek:
"Here is the non-critical part of kbuild:
- One bogus coccinelle check removed, one check fixed not to suggest
the obsolete PTR_RET macro
- scripts/tags.sh does not index the generated *.mod.c files
- new objdiff tool to list differences between two versions of an
object file
- A fix for scripts/bootgraph.pl"

* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
scripts/coccinelle: Use PTR_ERR_OR_ZERO
scripts/bootgraph.pl: Add graphic header
scripts: objdiff: detect object code changes between two commits
Coccicheck: Remove memcpy to struct assignment test
scripts/tags.sh: Ignore *.mod.c

+196 -120
+4 -3
Makefile
··· 428 428 429 429 # Files to ignore in find ... statements 430 430 431 - RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \ 432 - -o -name .pc -o -name .hg -o -name .git \) -prune -o 431 + export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o \ 432 + -name CVS -o -name .pc -o -name .hg -o -name .git \) \ 433 + -prune -o 433 434 export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \ 434 435 --exclude CVS --exclude .pc --exclude .hg --exclude .git 435 436 ··· 1104 1103 1105 1104 # Directories & files removed with 'make mrproper' 1106 1105 MRPROPER_DIRS += include/config usr/include include/generated \ 1107 - arch/*/include/generated 1106 + arch/*/include/generated .tmp_objdiff 1108 1107 MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \ 1109 1108 Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \ 1110 1109 signing_key.priv signing_key.x509 x509.genkey \
+40 -2
scripts/bootgraph.pl
··· 38 38 # 39 39 40 40 use strict; 41 + use Getopt::Long; 42 + my $header = 0; 43 + 44 + sub help { 45 + my $text = << "EOM"; 46 + Usage: 47 + 1) dmesg | perl scripts/bootgraph.pl [OPTION] > output.svg 48 + 2) perl scripts/bootgraph.pl -h 49 + 50 + Options: 51 + -header Insert kernel version and date 52 + EOM 53 + my $std=shift; 54 + if ($std == 1) { 55 + print STDERR $text; 56 + } else { 57 + print $text; 58 + } 59 + exit; 60 + } 61 + 62 + GetOptions( 63 + 'h|help' =>\&help, 64 + 'header' =>\$header 65 + ); 41 66 42 67 my %start; 43 68 my %end; ··· 73 48 my $count = 0; 74 49 my %pids; 75 50 my %pidctr; 51 + 52 + my $headerstep = 20; 53 + my $xheader = 15; 54 + my $yheader = 25; 55 + my $cyheader = 0; 76 56 77 57 while (<>) { 78 58 my $line = $_; ··· 142 112 print STDERR <<END; 143 113 No data found in the dmesg. Make sure that 'printk.time=1' and 144 114 'initcall_debug' are passed on the kernel command line. 145 - Usage: 146 - dmesg | perl scripts/bootgraph.pl > output.svg 147 115 END 116 + help(1); 148 117 exit 1; 149 118 } 150 119 151 120 print "<?xml version=\"1.0\" standalone=\"no\"?> \n"; 152 121 print "<svg width=\"2000\" height=\"100%\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n"; 122 + 123 + 124 + if ($header) { 125 + my $version = `uname -a`; 126 + my $date = `date`; 127 + print "<text transform=\"translate($xheader,$yheader)\">Kernel version: $version</text>\n"; 128 + $cyheader = $yheader+$headerstep; 129 + print "<text transform=\"translate($xheader,$cyheader)\">Date: $date</text>\n"; 130 + } 153 131 154 132 my @styles; 155 133
+7 -7
scripts/coccinelle/api/ptr_ret.cocci
··· 7 7 // URL: http://coccinelle.lip6.fr/ 8 8 // Options: --no-includes --include-headers 9 9 // 10 - // Keywords: ERR_PTR, PTR_ERR, PTR_RET, PTR_ERR_OR_ZERO 10 + // Keywords: ERR_PTR, PTR_ERR, PTR_ERR_OR_ZERO 11 11 // Version min: 2.6.39 12 12 // 13 13 ··· 62 62 p << r1.p1; 63 63 @@ 64 64 65 - coccilib.org.print_todo(p[0], "WARNING: PTR_RET can be used") 65 + coccilib.org.print_todo(p[0], "WARNING: PTR_ERR_OR_ZERO can be used") 66 66 67 67 68 68 @script:python depends on org@ 69 69 p << r2.p2; 70 70 @@ 71 71 72 - coccilib.org.print_todo(p[0], "WARNING: PTR_RET can be used") 72 + coccilib.org.print_todo(p[0], "WARNING: PTR_ERR_OR_ZERO can be used") 73 73 74 74 @script:python depends on org@ 75 75 p << r3.p3; 76 76 @@ 77 77 78 - coccilib.org.print_todo(p[0], "WARNING: PTR_RET can be used") 78 + coccilib.org.print_todo(p[0], "WARNING: PTR_ERR_OR_ZERO can be used") 79 79 80 80 @script:python depends on report@ 81 81 p << r1.p1; 82 82 @@ 83 83 84 - coccilib.report.print_report(p[0], "WARNING: PTR_RET can be used") 84 + coccilib.report.print_report(p[0], "WARNING: PTR_ERR_OR_ZERO can be used") 85 85 86 86 @script:python depends on report@ 87 87 p << r2.p2; 88 88 @@ 89 89 90 - coccilib.report.print_report(p[0], "WARNING: PTR_RET can be used") 90 + coccilib.report.print_report(p[0], "WARNING: PTR_ERR_OR_ZERO can be used") 91 91 92 92 @script:python depends on report@ 93 93 p << r3.p3; 94 94 @@ 95 95 96 - coccilib.report.print_report(p[0], "WARNING: PTR_RET can be used") 96 + coccilib.report.print_report(p[0], "WARNING: PTR_ERR_OR_ZERO can be used")
-103
scripts/coccinelle/misc/memcpy-assign.cocci
··· 1 - // 2 - // Replace memcpy with struct assignment. 3 - // 4 - // Confidence: High 5 - // Copyright: (C) 2012 Peter Senna Tschudin, INRIA/LIP6. GPLv2. 6 - // URL: http://coccinelle.lip6.fr/ 7 - // Comments: 8 - // Options: --no-includes --include-headers 9 - 10 - virtual patch 11 - virtual report 12 - virtual context 13 - virtual org 14 - 15 - @r1 depends on !patch@ 16 - identifier struct_name; 17 - struct struct_name to; 18 - struct struct_name from; 19 - struct struct_name *top; 20 - struct struct_name *fromp; 21 - position p; 22 - @@ 23 - memcpy@p(\(&(to)\|top\), \(&(from)\|fromp\), \(sizeof(to)\|sizeof(from)\|sizeof(struct struct_name)\|sizeof(*top)\|sizeof(*fromp)\)) 24 - 25 - @script:python depends on report@ 26 - p << r1.p; 27 - @@ 28 - coccilib.report.print_report(p[0],"Replace memcpy with struct assignment") 29 - 30 - @depends on context@ 31 - position r1.p; 32 - @@ 33 - *memcpy@p(...); 34 - 35 - @script:python depends on org@ 36 - p << r1.p; 37 - @@ 38 - cocci.print_main("Replace memcpy with struct assignment",p) 39 - 40 - @depends on patch@ 41 - identifier struct_name; 42 - struct struct_name to; 43 - struct struct_name from; 44 - @@ 45 - ( 46 - -memcpy(&(to), &(from), sizeof(to)); 47 - +to = from; 48 - | 49 - -memcpy(&(to), &(from), sizeof(from)); 50 - +to = from; 51 - | 52 - -memcpy(&(to), &(from), sizeof(struct struct_name)); 53 - +to = from; 54 - ) 55 - 56 - @depends on patch@ 57 - identifier struct_name; 58 - struct struct_name to; 59 - struct struct_name *from; 60 - @@ 61 - ( 62 - -memcpy(&(to), from, sizeof(to)); 63 - +to = *from; 64 - | 65 - -memcpy(&(to), from, sizeof(*from)); 66 - +to = *from; 67 - | 68 - -memcpy(&(to), from, sizeof(struct struct_name)); 69 - +to = *from; 70 - ) 71 - 72 - @depends on patch@ 73 - identifier struct_name; 74 - struct struct_name *to; 75 - struct struct_name from; 76 - @@ 77 - ( 78 - -memcpy(to, &(from), sizeof(*to)); 79 - + *to = from; 80 - | 81 - -memcpy(to, &(from), sizeof(from)); 82 - + *to = from; 83 - | 84 - -memcpy(to, &(from), sizeof(struct struct_name)); 85 - + *to = from; 86 - ) 87 - 88 - @depends on patch@ 89 - identifier struct_name; 90 - struct struct_name *to; 91 - struct struct_name *from; 92 - @@ 93 - ( 94 - -memcpy(to, from, sizeof(*to)); 95 - + *to = *from; 96 - | 97 - -memcpy(to, from, sizeof(*from)); 98 - + *to = *from; 99 - | 100 - -memcpy(to, from, sizeof(struct struct_name)); 101 - + *to = *from; 102 - ) 103 -
+141
scripts/objdiff
··· 1 + #!/bin/bash 2 + 3 + # objdiff - a small script for validating that a commit or series of commits 4 + # didn't change object code. 5 + # 6 + # Copyright 2014, Jason Cooper <jason@lakedaemon.net> 7 + # 8 + # Licensed under the terms of the GNU GPL version 2 9 + 10 + # usage example: 11 + # 12 + # $ git checkout COMMIT_A 13 + # $ <your fancy build command here> 14 + # $ ./scripts/objdiff record path/to/*.o 15 + # 16 + # $ git checkout COMMIT_B 17 + # $ <your fancy build command here> 18 + # $ ./scripts/objdiff record path/to/*.o 19 + # 20 + # $ ./scripts/objdiff diff COMMIT_A COMMIT_B 21 + # $ 22 + 23 + # And to clean up (everything is in .tmp_objdiff/*) 24 + # $ ./scripts/objdiff clean all 25 + # 26 + # Note: 'make mrproper' will also remove .tmp_objdiff 27 + 28 + GIT_DIR="`git rev-parse --git-dir`" 29 + 30 + if [ -d "$GIT_DIR" ]; then 31 + TMPD="${GIT_DIR%git}tmp_objdiff" 32 + 33 + [ -d "$TMPD" ] || mkdir "$TMPD" 34 + else 35 + echo "ERROR: git directory not found." 36 + exit 1 37 + fi 38 + 39 + usage() { 40 + echo "Usage: $0 <command> <args>" 41 + echo " record <list of object files>" 42 + echo " diff <commitA> <commitB>" 43 + echo " clean all | <commit>" 44 + exit 1 45 + } 46 + 47 + dorecord() { 48 + [ $# -eq 0 ] && usage 49 + 50 + FILES="$*" 51 + 52 + CMT="`git rev-parse --short HEAD`" 53 + 54 + OBJDUMP="${CROSS_COMPILE}objdump" 55 + OBJDIFFD="$TMPD/$CMT" 56 + 57 + [ ! -d "$OBJDIFFD" ] && mkdir -p "$OBJDIFFD" 58 + 59 + for f in $FILES; do 60 + dn="${f%/*}" 61 + bn="${f##*/}" 62 + 63 + [ ! -d "$OBJDIFFD/$dn" ] && mkdir -p "$OBJDIFFD/$dn" 64 + 65 + # remove addresses for a more clear diff 66 + # http://dummdida.tumblr.com/post/60924060451/binary-diff-between-libc-from-scientificlinux-and 67 + $OBJDUMP -D "$f" | sed "s/^[[:space:]]\+[0-9a-f]\+//" \ 68 + >"$OBJDIFFD/$dn/$bn" 69 + done 70 + } 71 + 72 + dodiff() { 73 + [ $# -ne 2 ] && [ $# -ne 0 ] && usage 74 + 75 + if [ $# -eq 0 ]; then 76 + SRC="`git rev-parse --short HEAD^`" 77 + DST="`git rev-parse --short HEAD`" 78 + else 79 + SRC="`git rev-parse --short $1`" 80 + DST="`git rev-parse --short $2`" 81 + fi 82 + 83 + DIFF="`which colordiff`" 84 + 85 + if [ ${#DIFF} -eq 0 ] || [ ! -x "$DIFF" ]; then 86 + DIFF="`which diff`" 87 + fi 88 + 89 + SRCD="$TMPD/$SRC" 90 + DSTD="$TMPD/$DST" 91 + 92 + if [ ! -d "$SRCD" ]; then 93 + echo "ERROR: $SRCD doesn't exist" 94 + exit 1 95 + fi 96 + 97 + if [ ! -d "$DSTD" ]; then 98 + echo "ERROR: $DSTD doesn't exist" 99 + exit 1 100 + fi 101 + 102 + $DIFF -Nurd $SRCD $DSTD 103 + } 104 + 105 + doclean() { 106 + [ $# -eq 0 ] && usage 107 + [ $# -gt 1 ] && usage 108 + 109 + if [ "x$1" = "xall" ]; then 110 + rm -rf $TMPD/* 111 + else 112 + CMT="`git rev-parse --short $1`" 113 + 114 + if [ -d "$TMPD/$CMT" ]; then 115 + rm -rf $TMPD/$CMT 116 + else 117 + echo "$CMT not found" 118 + fi 119 + fi 120 + } 121 + 122 + [ $# -eq 0 ] && usage 123 + 124 + case "$1" in 125 + record) 126 + shift 127 + dorecord $* 128 + ;; 129 + diff) 130 + shift 131 + dodiff $* 132 + ;; 133 + clean) 134 + shift 135 + doclean $* 136 + ;; 137 + *) 138 + echo "Unrecognized command '$1'" 139 + exit 1 140 + ;; 141 + esac
+4 -5
scripts/tags.sh
··· 11 11 set -x 12 12 fi 13 13 14 - # This is a duplicate of RCS_FIND_IGNORE without escaped '()' 15 - ignore="( -name SCCS -o -name BitKeeper -o -name .svn -o \ 16 - -name CVS -o -name .pc -o -name .hg -o \ 17 - -name .git ) \ 18 - -prune -o" 14 + # RCS_FIND_IGNORE has escaped ()s -- remove them. 15 + ignore="$(echo "$RCS_FIND_IGNORE" | sed 's|\\||g' )" 16 + # tags and cscope files should also ignore MODVERSION *.mod.c files 17 + ignore="$ignore ( -name *.mod.c ) -prune -o" 19 18 20 19 # Do not use full path if we do not use O=.. builds 21 20 # Use make O=. {tags|cscope}