Showing the changes to scripts (33 of 9467 files). Show all
Unified · Split
| @@ -260,14 +260,19 @@ endif · 259 unmodified lines | ||
| 260 | 260 | |
| 261 | 261 | ifdef CONFIG_FTRACE_MCOUNT_RECORD |
| 262 | 262 | ifdef BUILD_C_RECORDMCOUNT |
| 263 | +ifeq ("$(origin RECORDMCOUNT_WARN)", "command line") | |
| 264 | + RECORDMCOUNT_FLAGS = -w | |
| 265 | +endif | |
| 263 | 266 | # Due to recursion, we must skip empty.o. |
| 264 | 267 | # The empty.o file is created in the make process in order to determine |
| 265 | 268 | # the target endianness and word size. It is made before all other C |
| 266 | 269 | # files, including recordmcount. |
| 267 | 270 | sub_cmd_record_mcount = \ |
| 268 | 271 | if [ $(@) != "scripts/mod/empty.o" ]; then \ |
| 269 | − $(objtree)/scripts/recordmcount "$(@)"; \ | |
| 272 | + $(objtree)/scripts/recordmcount $(RECORDMCOUNT_FLAGS) "$(@)"; \ | |
| 270 | 273 | fi; |
| 274 | +recordmcount_source := $(srctree)/scripts/recordmcount.c \ | |
| 275 | + $(srctree)/scripts/recordmcount.h | |
| 271 | 276 | else |
| 272 | 277 | sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \ |
| 273 | 278 | "$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \ |
| @@ -275,6 +280,7 @@ sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH · 1 unmodified line | ||
| 275 | 280 | "$(OBJDUMP)" "$(OBJCOPY)" "$(CC) $(KBUILD_CFLAGS)" \ |
| 276 | 281 | "$(LD)" "$(NM)" "$(RM)" "$(MV)" \ |
| 277 | 282 | "$(if $(part-of-module),1,0)" "$(@)"; |
| 283 | +recordmcount_source := $(srctree)/scripts/recordmcount.pl | |
| 278 | 284 | endif |
| 279 | 285 | cmd_record_mcount = \ |
| 280 | 286 | if [ "$(findstring -pg,$(_c_flags))" = "-pg" ]; then \ |
| @@ -295,13 +301,13 @@ define rule_cc_o_c · 14 unmodified lines | ||
| 295 | 301 | endef |
| 296 | 302 | |
| 297 | 303 | # Built-in and composite module parts |
| 298 | −$(obj)/%.o: $(src)/%.c FORCE | |
| 304 | +$(obj)/%.o: $(src)/%.c $(recordmcount_source) FORCE | |
| 299 | 305 | $(call cmd,force_checksrc) |
| 300 | 306 | $(call if_changed_rule,cc_o_c) |
| 301 | 307 | |
| 302 | 308 | # Single-part modules are special since we need to mark them in $(MODVERDIR) |
| 303 | 309 | |
| 304 | −$(single-used-m): $(obj)/%.o: $(src)/%.c FORCE | |
| 310 | +$(single-used-m): $(obj)/%.o: $(src)/%.c $(recordmcount_source) FORCE | |
| 305 | 311 | $(call cmd,force_checksrc) |
| 306 | 312 | $(call if_changed_rule,cc_o_c) |
| 307 | 313 | @{ echo $(@:.o=.ko); echo $@; } > $(MODVERDIR)/$(@F:.o=.mod) |
| @@ -35,14 +35,14 @@ · 34 unmodified lines | ||
| 35 | 35 | # KBUILD_MODPOST_WARN can be set to avoid error out in case of undefined |
| 36 | 36 | # symbols in the final module linking stage |
| 37 | 37 | # KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules. |
| 38 | −# This is solely usefull to speed up test compiles | |
| 38 | +# This is solely useful to speed up test compiles | |
| 39 | 39 | PHONY := _modpost |
| 40 | 40 | _modpost: __modpost |
| 41 | 41 | |
| 42 | 42 | include include/config/auto.conf |
| 43 | 43 | include scripts/Kbuild.include |
| 44 | 44 | |
| 45 | −# When building external modules load the Kbuild file to retreive EXTRA_SYMBOLS info | |
| 45 | +# When building external modules load the Kbuild file to retrieve EXTRA_SYMBOLS info | |
| 46 | 46 | ifneq ($(KBUILD_EXTMOD),) |
| 47 | 47 | |
| 48 | 48 | # set src + obj - they may be used when building the .mod.c file |
| @@ -210,10 +210,10 @@ our $typeTypedefs = qr{(?x: · 209 unmodified lines | ||
| 210 | 210 | |
| 211 | 211 | our $logFunctions = qr{(?x: |
| 212 | 212 | printk| |
| 213 | − pr_(debug|dbg|vdbg|devel|info|warning|err|notice|alert|crit|emerg|cont)| | |
| 214 | − (dev|netdev|netif)_(printk|dbg|vdbg|info|warn|err|notice|alert|crit|emerg|WARN)| | |
| 213 | + [a-z]+_(emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)| | |
| 215 | 214 | WARN| |
| 216 | − panic | |
| 215 | + panic| | |
| 216 | + MODULE_[A-Z_]+ | |
| 217 | 217 | )}; |
| 218 | 218 | |
| 219 | 219 | our @typeList = ( |
| @@ -1462,7 +1462,7 @@ sub process { · 1242 unmodified lines | ||
| 1462 | 1462 | #80 column limit |
| 1463 | 1463 | if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ && |
| 1464 | 1464 | $rawline !~ /^.\s*\*\s*\@$Ident\s/ && |
| 1465 | − !($line =~ /^\+\s*$logFunctions\s*\(\s*(?:(KERN_\S+\s*|[^"]*))?"[X\t]*"\s*(?:,|\)\s*;)\s*$/ || | |
| 1465 | + !($line =~ /^\+\s*$logFunctions\s*\(\s*(?:(KERN_\S+\s*|[^"]*))?"[X\t]*"\s*(?:|,|\)\s*;)\s*$/ || | |
| 1466 | 1466 | $line =~ /^\+\s*"[^"]*"\s*(?:\s*|,|\)\s*;)\s*$/) && |
| 1467 | 1467 | $length > 80) |
| 1468 | 1468 | { |
| @@ -1946,13 +1946,13 @@ sub process { · 477 unmodified lines | ||
| 1946 | 1946 | # printk should use KERN_* levels. Note that follow on printk's on the |
| 1947 | 1947 | # same line do not need a level, so we use the current block context |
| 1948 | 1948 | # to try and find and validate the current printk. In summary the current |
| 1949 | −# printk includes all preceeding printk's which have no newline on the end. | |
| 1949 | +# printk includes all preceding printk's which have no newline on the end. | |
| 1950 | 1950 | # we assume the first bad printk is the one to report. |
| 1951 | 1951 | if ($line =~ /\bprintk\((?!KERN_)\s*"/) { |
| 1952 | 1952 | my $ok = 0; |
| 1953 | 1953 | for (my $ln = $linenr - 1; $ln >= $first_line; $ln--) { |
| 1954 | 1954 | #print "CHECK<$lines[$ln - 1]\n"; |
| 1955 | − # we have a preceeding printk if it ends | |
| 1955 | + # we have a preceding printk if it ends | |
| 1956 | 1956 | # with "\n" ignore it, else it is to blame |
| 1957 | 1957 | if ($lines[$ln - 1] =~ m{\bprintk\(}) { |
| 1958 | 1958 | if ($rawlines[$ln - 1] !~ m{\\n"}) { |
| @@ -2044,7 +2044,7 @@ sub process { · 85 unmodified lines | ||
| 2044 | 2044 | for (my $n = 0; $n < $#elements; $n += 2) { |
| 2045 | 2045 | $off += length($elements[$n]); |
| 2046 | 2046 | |
| 2047 | − # Pick up the preceeding and succeeding characters. | |
| 2047 | + # Pick up the preceding and succeeding characters. | |
| 2048 | 2048 | my $ca = substr($opline, 0, $off); |
| 2049 | 2049 | my $cc = ''; |
| 2050 | 2050 | if (length($opline) >= ($off + length($elements[$n + 1]))) { |
| @@ -2748,6 +2748,11 @@ sub process { · 697 unmodified lines | ||
| 2748 | 2748 | WARN("sizeof(& should be avoided\n" . $herecurr); |
| 2749 | 2749 | } |
| 2750 | 2750 | |
| 2751 | +# check for line continuations in quoted strings with odd counts of " | |
| 2752 | + if ($rawline =~ /\\$/ && $rawline =~ tr/"/"/ % 2) { | |
| 2753 | + WARN("Avoid line continuations in quoted strings\n" . $herecurr); | |
| 2754 | + } | |
| 2755 | + | |
| 2751 | 2756 | # check for new externs in .c files. |
| 2752 | 2757 | if ($realfile =~ /\.c$/ && defined $stat && |
| 2753 | 2758 | $stat =~ /^.\s*(?:extern\s+)?$Type\s+($Ident)(\s*)\(/s) |
| @@ -12,7 +12,7 @@ · 11 unmodified lines | ||
| 12 | 12 | # sh64 port by Paul Mundt |
| 13 | 13 | # Random bits by Matt Mackall <mpm@selenic.com> |
| 14 | 14 | # M68k port by Geert Uytterhoeven and Andreas Schwab |
| 15 | −# AVR32 port by Haavard Skinnemoen <hskinnemoen@atmel.com> | |
| 15 | +# AVR32 port by Haavard Skinnemoen (Atmel) | |
| 16 | 16 | # PARISC port by Kyle McMartin <kyle@parisc-linux.org> |
| 17 | 17 | # sparc port by Martin Habets <errandir_news@mph.eclipse.co.uk> |
| 18 | 18 | # |
| @@ -12,6 +12,7 @@ $| = 1; · 11 unmodified lines | ||
| 12 | 12 | my $debugging; |
| 13 | 13 | |
| 14 | 14 | foreach my $file (@ARGV) { |
| 15 | + next if $file =~ "include/linux/version\.h"; | |
| 15 | 16 | # Open this file. |
| 16 | 17 | open( my $f, '<', $file ) |
| 17 | 18 | or die "Can't open $file: $!\n"; |
| @@ -61,7 +61,7 @@ · 60 unmodified lines | ||
| 61 | 61 | #define FDT_ERR_NOTFOUND 1 |
| 62 | 62 | /* FDT_ERR_NOTFOUND: The requested node or property does not exist */ |
| 63 | 63 | #define FDT_ERR_EXISTS 2 |
| 64 | − /* FDT_ERR_EXISTS: Attemped to create a node or property which | |
| 64 | + /* FDT_ERR_EXISTS: Attempted to create a node or property which | |
| 65 | 65 | * already exists */ |
| 66 | 66 | #define FDT_ERR_NOSPACE 3 |
| 67 | 67 | /* FDT_ERR_NOSPACE: Operation needed to expand the device |
| @@ -155,7 +155,7 @@ struct node *merge_nodes(struct node *old_node, struct node *new_node) · 154 unmodified lines | ||
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | − /* if no collision occured, add child to the old node. */ | |
| 158 | + /* if no collision occurred, add child to the old node. */ | |
| 159 | 159 | if (new_child) |
| 160 | 160 | add_child(old_node, new_child); |
| 161 | 161 | } |
| @@ -25,11 +25,12 @@ sub alphabetically { · 24 unmodified lines | ||
| 25 | 25 | sub print_depends_on { |
| 26 | 26 | my ($href) = @_; |
| 27 | 27 | print "\n"; |
| 28 | − while (my ($mod, $list) = each %$href) { | |
| 28 | + for my $mod (sort keys %$href) { | |
| 29 | + my $list = $href->{$mod}; | |
| 29 | 30 | print "\t$mod:\n"; |
| 30 | 31 | foreach my $sym (sort numerically @{$list}) { |
| 31 | 32 | my ($symbol, $no) = split /\s+/, $sym; |
| 32 | − printf("\t\t%-25s\t%-25d\n", $symbol, $no); | |
| 33 | + printf("\t\t%-25s\n", $symbol); | |
| 33 | 34 | } |
| 34 | 35 | print "\n"; |
| 35 | 36 | } |
| @@ -49,8 +50,14 @@ sub usage { · 13 unmodified lines | ||
| 49 | 50 | } |
| 50 | 51 | |
| 51 | 52 | sub collectcfiles { |
| 52 | − my @file | |
| 53 | − = `cat .tmp_versions/*.mod | grep '.*\.ko\$' | sed s/\.ko$/.mod.c/`; | |
| 53 | + my @file; | |
| 54 | + while (<.tmp_versions/*.mod>) { | |
| 55 | + open my $fh, '<', $_ or die "cannot open $_: $!\n"; | |
| 56 | + push (@file, | |
| 57 | + grep s/\.ko/.mod.c/, # change the suffix | |
| 58 | + grep m/.+\.ko/, # find the .ko path | |
| 59 | + <$fh>); # lines in opened file | |
| 60 | + } | |
| 54 | 61 | chomp @file; |
| 55 | 62 | return @file; |
| 56 | 63 | } |
| @@ -95,6 +102,8 @@ close($module_symvers); · 38 unmodified lines | ||
| 95 | 102 | # |
| 96 | 103 | # collect the usage count of each symbol. |
| 97 | 104 | # |
| 105 | +my $modversion_warnings = 0; | |
| 106 | + | |
| 98 | 107 | foreach my $thismod (@allcfiles) { |
| 99 | 108 | my $module; |
| 100 | 109 | |
| @@ -125,7 +134,8 @@ foreach my $thismod (@allcfiles) { · 24 unmodified lines | ||
| 125 | 134 | } |
| 126 | 135 | } |
| 127 | 136 | if ($state != 2) { |
| 128 | − print "WARNING:$thismod is not built with CONFIG_MODVERSION enabled\n"; | |
| 137 | + warn "WARNING:$thismod is not built with CONFIG_MODVERSIONS enabled\n"; | |
| 138 | + $modversion_warnings++; | |
| 129 | 139 | } |
| 130 | 140 | close($module); |
| 131 | 141 | } |
| @@ -159,8 +169,12 @@ printf("SECTION 2:\n\tThis section reports export-symbol-usage of in-kernel · 27 unmodified lines | ||
| 159 | 169 | modules. Each module lists the modules, and the symbols from that module that |
| 160 | 170 | it uses. Each listed symbol reports the number of modules using it\n"); |
| 161 | 171 | |
| 172 | +print "\nNOTE: Got $modversion_warnings CONFIG_MODVERSIONS warnings\n\n" | |
| 173 | + if $modversion_warnings; | |
| 174 | + | |
| 162 | 175 | print "~"x80 , "\n"; |
| 163 | −while (my ($thismod, $list) = each %MODULE) { | |
| 176 | +for my $thismod (sort keys %MODULE) { | |
| 177 | + my $list = $MODULE{$thismod}; | |
| 164 | 178 | my %depends; |
| 165 | 179 | $thismod =~ s/\.mod\.c/.ko/; |
| 166 | 180 | print "\t\t\t$thismod\n"; |
| @@ -284,7 +284,7 @@ while [ $# -gt 0 ]; do · 283 unmodified lines | ||
| 284 | 284 | done |
| 285 | 285 | |
| 286 | 286 | # If output_file is set we will generate cpio archive and compress it |
| 287 | −# we are carefull to delete tmp files | |
| 287 | +# we are careful to delete tmp files | |
| 288 | 288 | if [ ! -z ${output_file} ]; then |
| 289 | 289 | if [ -z ${cpio_file} ]; then |
| 290 | 290 | timestamp= |
| @@ -77,14 +77,15 @@ localyesconfig: $(obj)/streamline_config.pl $(obj)/conf · 76 unmodified lines | ||
| 77 | 77 | # The symlink is used to repair a deficiency in arch/um |
| 78 | 78 | update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h |
| 79 | 79 | $(Q)echo " GEN config" |
| 80 | − $(Q)xgettext --default-domain=linux \ | |
| 81 | − --add-comments --keyword=_ --keyword=N_ \ | |
| 82 | − --from-code=UTF-8 \ | |
| 83 | − --files-from=scripts/kconfig/POTFILES.in \ | |
| 80 | + $(Q)xgettext --default-domain=linux \ | |
| 81 | + --add-comments --keyword=_ --keyword=N_ \ | |
| 82 | + --from-code=UTF-8 \ | |
| 83 | + --files-from=$(srctree)/scripts/kconfig/POTFILES.in \ | |
| 84 | + --directory=$(srctree) --directory=$(objtree) \ | |
| 84 | 85 | --output $(obj)/config.pot |
| 85 | 86 | $(Q)sed -i s/CHARSET/UTF-8/ $(obj)/config.pot |
| 86 | − $(Q)ln -fs Kconfig.i386 arch/um/Kconfig.arch | |
| 87 | − $(Q)(for i in `ls arch/*/Kconfig`; \ | |
| 87 | + $(Q)ln -fs Kconfig.x86 arch/um/Kconfig | |
| 88 | + $(Q)(for i in `ls $(srctree)/arch/*/Kconfig`; \ | |
| 88 | 89 | do \ |
| 89 | 90 | echo " GEN $$i"; \ |
| 90 | 91 | $(obj)/kxgettext $$i \ |
| @@ -92,7 +93,7 @@ update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h · 1 unmodified line | ||
| 92 | 93 | done ) |
| 93 | 94 | $(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \ |
| 94 | 95 | --output $(obj)/linux.pot |
| 95 | − $(Q)rm -f arch/um/Kconfig.arch | |
| 96 | + $(Q)rm -f $(srctree)/arch/um/Kconfig | |
| 96 | 97 | $(Q)rm -f $(obj)/config.pot |
| 97 | 98 | |
| 98 | 99 | PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig |
| @@ -168,8 +169,11 @@ conf-objs := conf.o zconf.tab.o · 69 unmodified lines | ||
| 168 | 169 | mconf-objs := mconf.o zconf.tab.o $(lxdialog) |
| 169 | 170 | nconf-objs := nconf.o zconf.tab.o nconf.gui.o |
| 170 | 171 | kxgettext-objs := kxgettext.o zconf.tab.o |
| 172 | +qconf-cxxobjs := qconf.o | |
| 173 | +qconf-objs := kconfig_load.o zconf.tab.o | |
| 174 | +gconf-objs := gconf.o kconfig_load.o zconf.tab.o | |
| 171 | 175 | |
| 172 | −hostprogs-y := conf qconf gconf kxgettext | |
| 176 | +hostprogs-y := conf | |
| 173 | 177 | |
| 174 | 178 | ifeq ($(MAKECMDGOALS),nconfig) |
| 175 | 179 | hostprogs-y += nconf |
| @@ -179,6 +183,10 @@ ifeq ($(MAKECMDGOALS),menuconfig) · 3 unmodified lines | ||
| 179 | 183 | hostprogs-y += mconf |
| 180 | 184 | endif |
| 181 | 185 | |
| 186 | +ifeq ($(MAKECMDGOALS),update-po-config) | |
| 187 | + hostprogs-y += kxgettext | |
| 188 | +endif | |
| 189 | + | |
| 182 | 190 | ifeq ($(MAKECMDGOALS),xconfig) |
| 183 | 191 | qconf-target := 1 |
| 184 | 192 | endif |
| @@ -188,16 +196,15 @@ endif · 3 unmodified lines | ||
| 188 | 196 | |
| 189 | 197 | |
| 190 | 198 | ifeq ($(qconf-target),1) |
| 191 | −qconf-cxxobjs := qconf.o | |
| 192 | −qconf-objs := kconfig_load.o zconf.tab.o | |
| 199 | + hostprogs-y += qconf | |
| 193 | 200 | endif |
| 194 | 201 | |
| 195 | 202 | ifeq ($(gconf-target),1) |
| 196 | −gconf-objs := gconf.o kconfig_load.o zconf.tab.o | |
| 203 | + hostprogs-y += gconf | |
| 197 | 204 | endif |
| 198 | 205 | |
| 199 | −clean-files := lkc_defs.h qconf.moc .tmp_qtcheck \ | |
| 200 | − .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h | |
| 206 | +clean-files := lkc_defs.h qconf.moc .tmp_qtcheck .tmp_gtkcheck | |
| 207 | +clean-files += zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h | |
| 201 | 208 | clean-files += mconf qconf gconf nconf |
| 202 | 209 | clean-files += config.pot linux.pot |
| 203 | 210 | |
| @@ -321,11 +328,12 @@ $(obj)/%.moc: $(src)/%.h · 117 unmodified lines | ||
| 321 | 328 | $(KC_QT_MOC) -i $< -o $@ |
| 322 | 329 | |
| 323 | 330 | $(obj)/lkc_defs.h: $(src)/lkc_proto.h |
| 324 | − sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/' | |
| 331 | + $(Q)sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/' | |
| 325 | 332 | |
| 326 | 333 | # Extract gconf menu items for I18N support |
| 327 | 334 | $(obj)/gconf.glade.h: $(obj)/gconf.glade |
| 328 | − intltool-extract --type=gettext/glade $(obj)/gconf.glade | |
| 335 | + $(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \ | |
| 336 | + $(obj)/gconf.glade | |
| 329 | 337 | |
| 330 | 338 | ### |
| 331 | 339 | # The following requires flex/bison/gperf |
| @@ -332,7 +332,7 @@ static int conf_choice(struct menu *menu) · 331 unmodified lines | ||
| 332 | 332 | } |
| 333 | 333 | if (!child) |
| 334 | 334 | continue; |
| 335 | − if (line[strlen(line) - 1] == '?') { | |
| 335 | + if (line[0] && line[strlen(line) - 1] == '?') { | |
| 336 | 336 | print_help(child); |
| 337 | 337 | continue; |
| 338 | 338 | } |
| @@ -560,8 +560,6 @@ int conf_write(const char *name) · 559 unmodified lines | ||
| 560 | 560 | const char *basename; |
| 561 | 561 | const char *str; |
| 562 | 562 | char dirname[PATH_MAX+1], tmpname[PATH_MAX+1], newname[PATH_MAX+1]; |
| 563 | − time_t now; | |
| 564 | − int use_timestamp = 1; | |
| 565 | 563 | char *env; |
| 566 | 564 | |
| 567 | 565 | dirname[0] = 0; |
| @@ -598,19 +596,11 @@ int conf_write(const char *name) · 30 unmodified lines | ||
| 598 | 596 | if (!out) |
| 599 | 597 | return 1; |
| 600 | 598 | |
| 601 | − time(&now); | |
| 602 | − env = getenv("KCONFIG_NOTIMESTAMP"); | |
| 603 | − if (env && *env) | |
| 604 | − use_timestamp = 0; | |
| 605 | − | |
| 606 | 599 | fprintf(out, _("#\n" |
| 607 | 600 | "# Automatically generated make config: don't edit\n" |
| 608 | 601 | "# %s\n" |
| 609 | − "%s%s" | |
| 610 | 602 | "#\n"), |
| 611 | − rootmenu.prompt->text, | |
| 612 | − use_timestamp ? "# " : "", | |
| 613 | − use_timestamp ? ctime(&now) : ""); | |
| 603 | + rootmenu.prompt->text); | |
| 614 | 604 | |
| 615 | 605 | if (!conf_get_changed()) |
| 616 | 606 | sym_clear_all_valid(); |
| @@ -784,7 +774,6 @@ int conf_write_autoconf(void) · 167 unmodified lines | ||
| 784 | 774 | const char *str; |
| 785 | 775 | const char *name; |
| 786 | 776 | FILE *out, *tristate, *out_h; |
| 787 | − time_t now; | |
| 788 | 777 | int i; |
| 789 | 778 | |
| 790 | 779 | sym_clear_all_valid(); |
| @@ -811,22 +800,19 @@ int conf_write_autoconf(void) · 20 unmodified lines | ||
| 811 | 800 | return 1; |
| 812 | 801 | } |
| 813 | 802 | |
| 814 | − time(&now); | |
| 815 | 803 | fprintf(out, "#\n" |
| 816 | 804 | "# Automatically generated make config: don't edit\n" |
| 817 | 805 | "# %s\n" |
| 818 | − "# %s" | |
| 819 | 806 | "#\n", |
| 820 | − rootmenu.prompt->text, ctime(&now)); | |
| 807 | + rootmenu.prompt->text); | |
| 821 | 808 | fprintf(tristate, "#\n" |
| 822 | 809 | "# Automatically generated - do not edit\n" |
| 823 | 810 | "\n"); |
| 824 | 811 | fprintf(out_h, "/*\n" |
| 825 | 812 | " * Automatically generated C config: don't edit\n" |
| 826 | 813 | " * %s\n" |
| 827 | − " * %s" | |
| 828 | 814 | " */\n", |
| 829 | − rootmenu.prompt->text, ctime(&now)); | |
| 815 | + rootmenu.prompt->text); | |
| 830 | 816 | |
| 831 | 817 | for_all_symbols(i, sym) { |
| 832 | 818 | sym_calc_value(sym); |
| @@ -20,12 +20,8 @@ struct file { · 19 unmodified lines | ||
| 20 | 20 | struct file *parent; |
| 21 | 21 | const char *name; |
| 22 | 22 | int lineno; |
| 23 | − int flags; | |
| 24 | 23 | }; |
| 25 | 24 | |
| 26 | −#define FILE_BUSY 0x0001 | |
| 27 | −#define FILE_SCANNED 0x0002 | |
| 28 | − | |
| 29 | 25 | typedef enum tristate { |
| 30 | 26 | no, mod, yes |
| 31 | 27 | } tristate; |
| @@ -253,7 +253,7 @@ void init_left_tree(void) · 252 unmodified lines | ||
| 253 | 253 | |
| 254 | 254 | gtk_tree_view_set_model(view, model1); |
| 255 | 255 | gtk_tree_view_set_headers_visible(view, TRUE); |
| 256 | − gtk_tree_view_set_rules_hint(view, FALSE); | |
| 256 | + gtk_tree_view_set_rules_hint(view, TRUE); | |
| 257 | 257 | |
| 258 | 258 | column = gtk_tree_view_column_new(); |
| 259 | 259 | gtk_tree_view_append_column(view, column); |
| @@ -298,7 +298,7 @@ void init_right_tree(void) · 38 unmodified lines | ||
| 298 | 298 | |
| 299 | 299 | gtk_tree_view_set_model(view, model2); |
| 300 | 300 | gtk_tree_view_set_headers_visible(view, TRUE); |
| 301 | − gtk_tree_view_set_rules_hint(view, FALSE); | |
| 301 | + gtk_tree_view_set_rules_hint(view, TRUE); | |
| 302 | 302 | |
| 303 | 303 | column = gtk_tree_view_column_new(); |
| 304 | 304 | gtk_tree_view_append_column(view, column); |
| @@ -756,7 +756,6 @@ void on_load_clicked(GtkButton * button, gpointer user_data) · 451 unmodified lines | ||
| 756 | 756 | void on_single_clicked(GtkButton * button, gpointer user_data) |
| 757 | 757 | { |
| 758 | 758 | view_mode = SINGLE_VIEW; |
| 759 | − gtk_paned_set_position(GTK_PANED(hpaned), 0); | |
| 760 | 759 | gtk_widget_hide(tree1_w); |
| 761 | 760 | current = &rootmenu; |
| 762 | 761 | display_tree_part(); |
| @@ -782,7 +781,6 @@ void on_split_clicked(GtkButton * button, gpointer user_data) · 19 unmodified lines | ||
| 782 | 781 | void on_full_clicked(GtkButton * button, gpointer user_data) |
| 783 | 782 | { |
| 784 | 783 | view_mode = FULL_VIEW; |
| 785 | − gtk_paned_set_position(GTK_PANED(hpaned), 0); | |
| 786 | 784 | gtk_widget_hide(tree1_w); |
| 787 | 785 | if (tree2) |
| 788 | 786 | gtk_tree_store_clear(tree2); |
| @@ -1444,6 +1442,12 @@ static void display_tree(struct menu *menu) · 655 unmodified lines | ||
| 1444 | 1442 | if (((menu != &rootmenu) && !(menu->flags & MENU_ROOT)) |
| 1445 | 1443 | || (view_mode == FULL_VIEW) |
| 1446 | 1444 | || (view_mode == SPLIT_VIEW))*/ |
| 1445 | + | |
| 1446 | + /* Change paned position if the view is not in 'split mode' */ | |
| 1447 | + if (view_mode == SINGLE_VIEW || view_mode == FULL_VIEW) { | |
| 1448 | + gtk_paned_set_position(GTK_PANED(hpaned), 0); | |
| 1449 | + } | |
| 1450 | + | |
| 1447 | 1451 | if (((view_mode == SINGLE_VIEW) && (menu->flags & MENU_ROOT)) |
| 1448 | 1452 | || (view_mode == FULL_VIEW) |
| 1449 | 1453 | || (view_mode == SPLIT_VIEW)) { |
| @@ -2363,11 +2363,11 @@ void zconf_initscan(const char *name) · 2362 unmodified lines | ||
| 2363 | 2363 | |
| 2364 | 2364 | current_file = file_lookup(name); |
| 2365 | 2365 | current_file->lineno = 1; |
| 2366 | − current_file->flags = FILE_BUSY; | |
| 2367 | 2366 | } |
| 2368 | 2367 | |
| 2369 | 2368 | void zconf_nextfile(const char *name) |
| 2370 | 2369 | { |
| 2370 | + struct file *iter; | |
| 2371 | 2371 | struct file *file = file_lookup(name); |
| 2372 | 2372 | struct buffer *buf = malloc(sizeof(*buf)); |
| 2373 | 2373 | memset(buf, 0, sizeof(*buf)); |
| @@ -2383,18 +2383,25 @@ void zconf_nextfile(const char *name) · 9 unmodified lines | ||
| 2383 | 2383 | buf->parent = current_buf; |
| 2384 | 2384 | current_buf = buf; |
| 2385 | 2385 | |
| 2386 | − if (file->flags & FILE_BUSY) { | |
| 2387 | − printf("%s:%d: do not source '%s' from itself\n", | |
| 2388 | − zconf_curname(), zconf_lineno(), name); | |
| 2389 | − exit(1); | |
| 2390 | − } | |
| 2391 | − if (file->flags & FILE_SCANNED) { | |
| 2392 | − printf("%s:%d: file '%s' is already sourced from '%s'\n", | |
| 2393 | − zconf_curname(), zconf_lineno(), name, | |
| 2394 | − file->parent->name); | |
| 2395 | − exit(1); | |
| 2386 | + for (iter = current_file->parent; iter; iter = iter->parent ) { | |
| 2387 | + if (!strcmp(current_file->name,iter->name) ) { | |
| 2388 | + printf("%s:%d: recursive inclusion detected. " | |
| 2389 | + "Inclusion path:\n current file : '%s'\n", | |
| 2390 | + zconf_curname(), zconf_lineno(), | |
| 2391 | + zconf_curname()); | |
| 2392 | + iter = current_file->parent; | |
| 2393 | + while (iter && \ | |
| 2394 | + strcmp(iter->name,current_file->name)) { | |
| 2395 | + printf(" included from: '%s:%d'\n", | |
| 2396 | + iter->name, iter->lineno-1); | |
| 2397 | + iter = iter->parent; | |
| 2398 | + } | |
| 2399 | + if (iter) | |
| 2400 | + printf(" included from: '%s:%d'\n", | |
| 2401 | + iter->name, iter->lineno+1); | |
| 2402 | + exit(1); | |
| 2403 | + } | |
| 2396 | 2404 | } |
| 2397 | − file->flags |= FILE_BUSY; | |
| 2398 | 2405 | file->lineno = 1; |
| 2399 | 2406 | file->parent = current_file; |
| 2400 | 2407 | current_file = file; |
| @@ -2404,8 +2411,6 @@ static void zconf_endfile(void) · 3 unmodified lines | ||
| 2404 | 2411 | { |
| 2405 | 2412 | struct buffer *parent; |
| 2406 | 2413 | |
| 2407 | − current_file->flags |= FILE_SCANNED; | |
| 2408 | − current_file->flags &= ~FILE_BUSY; | |
| 2409 | 2414 | current_file = current_file->parent; |
| 2410 | 2415 | |
| 2411 | 2416 | parent = current_buf->parent; |
| @@ -373,18 +373,18 @@ static void print_function_line(void) · 372 unmodified lines | ||
| 373 | 373 | const int skip = 1; |
| 374 | 374 | |
| 375 | 375 | for (i = 0; i < function_keys_num; i++) { |
| 376 | − wattrset(main_window, attributes[FUNCTION_HIGHLIGHT]); | |
| 376 | + (void) wattrset(main_window, attributes[FUNCTION_HIGHLIGHT]); | |
| 377 | 377 | mvwprintw(main_window, LINES-3, offset, |
| 378 | 378 | "%s", |
| 379 | 379 | function_keys[i].key_str); |
| 380 | − wattrset(main_window, attributes[FUNCTION_TEXT]); | |
| 380 | + (void) wattrset(main_window, attributes[FUNCTION_TEXT]); | |
| 381 | 381 | offset += strlen(function_keys[i].key_str); |
| 382 | 382 | mvwprintw(main_window, LINES-3, |
| 383 | 383 | offset, "%s", |
| 384 | 384 | function_keys[i].func); |
| 385 | 385 | offset += strlen(function_keys[i].func) + skip; |
| 386 | 386 | } |
| 387 | − wattrset(main_window, attributes[NORMAL]); | |
| 387 | + (void) wattrset(main_window, attributes[NORMAL]); | |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | /* help */ |
| @@ -953,16 +953,16 @@ static void show_menu(const char *prompt, const char *instructions, · 562 unmodified lines | ||
| 953 | 953 | current_instructions = instructions; |
| 954 | 954 | |
| 955 | 955 | clear(); |
| 956 | − wattrset(main_window, attributes[NORMAL]); | |
| 956 | + (void) wattrset(main_window, attributes[NORMAL]); | |
| 957 | 957 | print_in_middle(stdscr, 1, 0, COLS, |
| 958 | 958 | menu_backtitle, |
| 959 | 959 | attributes[MAIN_HEADING]); |
| 960 | 960 | |
| 961 | − wattrset(main_window, attributes[MAIN_MENU_BOX]); | |
| 961 | + (void) wattrset(main_window, attributes[MAIN_MENU_BOX]); | |
| 962 | 962 | box(main_window, 0, 0); |
| 963 | − wattrset(main_window, attributes[MAIN_MENU_HEADING]); | |
| 963 | + (void) wattrset(main_window, attributes[MAIN_MENU_HEADING]); | |
| 964 | 964 | mvwprintw(main_window, 0, 3, " %s ", prompt); |
| 965 | − wattrset(main_window, attributes[NORMAL]); | |
| 965 | + (void) wattrset(main_window, attributes[NORMAL]); | |
| 966 | 966 | |
| 967 | 967 | set_menu_items(curses_menu, curses_menu_items); |
| 968 | 968 | |
| @@ -1489,8 +1489,7 @@ void ConfigMainWindow::saveConfigAs(void) · 1488 unmodified lines | ||
| 1489 | 1489 | QString s = Q3FileDialog::getSaveFileName(conf_get_configname(), NULL, this); |
| 1490 | 1490 | if (s.isNull()) |
| 1491 | 1491 | return; |
| 1492 | − if (conf_write(QFile::encodeName(s))) | |
| 1493 | − QMessageBox::information(this, "qconf", _("Unable to save configuration!")); | |
| 1492 | + saveConfig(); | |
| 1494 | 1493 | } |
| 1495 | 1494 | |
| 1496 | 1495 | void ConfigMainWindow::searchConfig(void) |
| @@ -1643,7 +1642,7 @@ void ConfigMainWindow::closeEvent(QCloseEvent* e) · 146 unmodified lines | ||
| 1643 | 1642 | mb.setButtonText(QMessageBox::Cancel, _("Cancel Exit")); |
| 1644 | 1643 | switch (mb.exec()) { |
| 1645 | 1644 | case QMessageBox::Yes: |
| 1646 | − conf_write(NULL); | |
| 1645 | + saveConfig(); | |
| 1647 | 1646 | case QMessageBox::No: |
| 1648 | 1647 | e->accept(); |
| 1649 | 1648 | break; |
| @@ -294,11 +294,11 @@ void zconf_initscan(const char *name) · 293 unmodified lines | ||
| 294 | 294 | |
| 295 | 295 | current_file = file_lookup(name); |
| 296 | 296 | current_file->lineno = 1; |
| 297 | − current_file->flags = FILE_BUSY; | |
| 298 | 297 | } |
| 299 | 298 | |
| 300 | 299 | void zconf_nextfile(const char *name) |
| 301 | 300 | { |
| 301 | + struct file *iter; | |
| 302 | 302 | struct file *file = file_lookup(name); |
| 303 | 303 | struct buffer *buf = malloc(sizeof(*buf)); |
| 304 | 304 | memset(buf, 0, sizeof(*buf)); |
| @@ -314,18 +314,25 @@ void zconf_nextfile(const char *name) · 9 unmodified lines | ||
| 314 | 314 | buf->parent = current_buf; |
| 315 | 315 | current_buf = buf; |
| 316 | 316 | |
| 317 | − if (file->flags & FILE_BUSY) { | |
| 318 | − printf("%s:%d: do not source '%s' from itself\n", | |
| 319 | − zconf_curname(), zconf_lineno(), name); | |
| 320 | − exit(1); | |
| 321 | − } | |
| 322 | − if (file->flags & FILE_SCANNED) { | |
| 323 | − printf("%s:%d: file '%s' is already sourced from '%s'\n", | |
| 324 | − zconf_curname(), zconf_lineno(), name, | |
| 325 | − file->parent->name); | |
| 326 | − exit(1); | |
| 317 | + for (iter = current_file->parent; iter; iter = iter->parent ) { | |
| 318 | + if (!strcmp(current_file->name,iter->name) ) { | |
| 319 | + printf("%s:%d: recursive inclusion detected. " | |
| 320 | + "Inclusion path:\n current file : '%s'\n", | |
| 321 | + zconf_curname(), zconf_lineno(), | |
| 322 | + zconf_curname()); | |
| 323 | + iter = current_file->parent; | |
| 324 | + while (iter && \ | |
| 325 | + strcmp(iter->name,current_file->name)) { | |
| 326 | + printf(" included from: '%s:%d'\n", | |
| 327 | + iter->name, iter->lineno-1); | |
| 328 | + iter = iter->parent; | |
| 329 | + } | |
| 330 | + if (iter) | |
| 331 | + printf(" included from: '%s:%d'\n", | |
| 332 | + iter->name, iter->lineno+1); | |
| 333 | + exit(1); | |
| 334 | + } | |
| 327 | 335 | } |
| 328 | − file->flags |= FILE_BUSY; | |
| 329 | 336 | file->lineno = 1; |
| 330 | 337 | file->parent = current_file; |
| 331 | 338 | current_file = file; |
| @@ -335,8 +342,6 @@ static void zconf_endfile(void) · 3 unmodified lines | ||
| 335 | 342 | { |
| 336 | 343 | struct buffer *parent; |
| 337 | 344 | |
| 338 | − current_file->flags |= FILE_SCANNED; | |
| 339 | − current_file->flags &= ~FILE_BUSY; | |
| 340 | 345 | current_file = current_file->parent; |
| 341 | 346 | |
| 342 | 347 | parent = current_buf->parent; |
| @@ -1705,7 +1705,7 @@ sub push_parameter($$$) { · 1704 unmodified lines | ||
| 1705 | 1705 | |
| 1706 | 1706 | $param = xml_escape($param); |
| 1707 | 1707 | |
| 1708 | − # strip spaces from $param so that it is one continous string | |
| 1708 | + # strip spaces from $param so that it is one continuous string | |
| 1709 | 1709 | # on @parameterlist; |
| 1710 | 1710 | # this fixes a problem where check_sections() cannot find |
| 1711 | 1711 | # a parameter like "addr[6 + 2]" because it actually appears |
| @@ -702,6 +702,24 @@ static int do_ssb_entry(const char *filename, · 701 unmodified lines | ||
| 702 | 702 | return 1; |
| 703 | 703 | } |
| 704 | 704 | |
| 705 | +/* Looks like: bcma:mNidNrevNclN. */ | |
| 706 | +static int do_bcma_entry(const char *filename, | |
| 707 | + struct bcma_device_id *id, char *alias) | |
| 708 | +{ | |
| 709 | + id->manuf = TO_NATIVE(id->manuf); | |
| 710 | + id->id = TO_NATIVE(id->id); | |
| 711 | + id->rev = TO_NATIVE(id->rev); | |
| 712 | + id->class = TO_NATIVE(id->class); | |
| 713 | + | |
| 714 | + strcpy(alias, "bcma:"); | |
| 715 | + ADD(alias, "m", id->manuf != BCMA_ANY_MANUF, id->manuf); | |
| 716 | + ADD(alias, "id", id->id != BCMA_ANY_ID, id->id); | |
| 717 | + ADD(alias, "rev", id->rev != BCMA_ANY_REV, id->rev); | |
| 718 | + ADD(alias, "cl", id->class != BCMA_ANY_CLASS, id->class); | |
| 719 | + add_wildcard(alias); | |
| 720 | + return 1; | |
| 721 | +} | |
| 722 | + | |
| 705 | 723 | /* Looks like: virtio:dNvN */ |
| 706 | 724 | static int do_virtio_entry(const char *filename, struct virtio_device_id *id, |
| 707 | 725 | char *alias) |
| @@ -968,6 +986,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, · 260 unmodified lines | ||
| 968 | 986 | do_table(symval, sym->st_size, |
| 969 | 987 | sizeof(struct ssb_device_id), "ssb", |
| 970 | 988 | do_ssb_entry, mod); |
| 989 | + else if (sym_is(symname, "__mod_bcma_device_table")) | |
| 990 | + do_table(symval, sym->st_size, | |
| 991 | + sizeof(struct bcma_device_id), "bcma", | |
| 992 | + do_bcma_entry, mod); | |
| 971 | 993 | else if (sym_is(symname, "__mod_virtio_device_table")) |
| 972 | 994 | do_table(symval, sym->st_size, |
| 973 | 995 | sizeof(struct virtio_device_id), "virtio", |
| @@ -420,11 +420,10 @@ static int parse_elf(struct elf_info *info, const char *filename) · 419 unmodified lines | ||
| 420 | 420 | return 0; |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | − if (hdr->e_shnum == 0) { | |
| 423 | + if (hdr->e_shnum == SHN_UNDEF) { | |
| 424 | 424 | /* |
| 425 | 425 | * There are more than 64k sections, |
| 426 | 426 | * read count from .sh_size. |
| 427 | − * note: it doesn't need shndx2secindex() | |
| 428 | 427 | */ |
| 429 | 428 | info->num_sections = TO_NATIVE(sechdrs[0].sh_size); |
| 430 | 429 | } |
| @@ -432,8 +431,7 @@ static int parse_elf(struct elf_info *info, const char *filename) · 1 unmodified line | ||
| 432 | 431 | info->num_sections = hdr->e_shnum; |
| 433 | 432 | } |
| 434 | 433 | if (hdr->e_shstrndx == SHN_XINDEX) { |
| 435 | − info->secindex_strings = | |
| 436 | − shndx2secindex(TO_NATIVE(sechdrs[0].sh_link)); | |
| 434 | + info->secindex_strings = TO_NATIVE(sechdrs[0].sh_link); | |
| 437 | 435 | } |
| 438 | 436 | else { |
| 439 | 437 | info->secindex_strings = hdr->e_shstrndx; |
| @@ -489,7 +487,7 @@ static int parse_elf(struct elf_info *info, const char *filename) · 49 unmodified lines | ||
| 489 | 487 | sechdrs[i].sh_offset; |
| 490 | 488 | info->symtab_stop = (void *)hdr + |
| 491 | 489 | sechdrs[i].sh_offset + sechdrs[i].sh_size; |
| 492 | − sh_link_idx = shndx2secindex(sechdrs[i].sh_link); | |
| 490 | + sh_link_idx = sechdrs[i].sh_link; | |
| 493 | 491 | info->strtab = (void *)hdr + |
| 494 | 492 | sechdrs[sh_link_idx].sh_offset; |
| 495 | 493 | } |
| @@ -516,11 +514,9 @@ static int parse_elf(struct elf_info *info, const char *filename) · 20 unmodified lines | ||
| 516 | 514 | |
| 517 | 515 | if (symtab_shndx_idx != ~0U) { |
| 518 | 516 | Elf32_Word *p; |
| 519 | − if (symtab_idx != | |
| 520 | − shndx2secindex(sechdrs[symtab_shndx_idx].sh_link)) | |
| 517 | + if (symtab_idx != sechdrs[symtab_shndx_idx].sh_link) | |
| 521 | 518 | fatal("%s: SYMTAB_SHNDX has bad sh_link: %u!=%u\n", |
| 522 | − filename, | |
| 523 | − shndx2secindex(sechdrs[symtab_shndx_idx].sh_link), | |
| 519 | + filename, sechdrs[symtab_shndx_idx].sh_link, | |
| 524 | 520 | symtab_idx); |
| 525 | 521 | /* Fix endianness */ |
| 526 | 522 | for (p = info->symtab_shndx_start; p < info->symtab_shndx_stop; |
| @@ -1446,7 +1442,7 @@ static unsigned int *reloc_location(struct elf_info *elf, · 919 unmodified lines | ||
| 1446 | 1442 | Elf_Shdr *sechdr, Elf_Rela *r) |
| 1447 | 1443 | { |
| 1448 | 1444 | Elf_Shdr *sechdrs = elf->sechdrs; |
| 1449 | − int section = shndx2secindex(sechdr->sh_info); | |
| 1445 | + int section = sechdr->sh_info; | |
| 1450 | 1446 | |
| 1451 | 1447 | return (void *)elf->hdr + sechdrs[section].sh_offset + |
| 1452 | 1448 | r->r_offset; |
| @@ -145,33 +145,22 @@ static inline int is_shndx_special(unsigned int i) · 144 unmodified lines | ||
| 145 | 145 | return i != SHN_XINDEX && i >= SHN_LORESERVE && i <= SHN_HIRESERVE; |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | −/* shndx is in [0..SHN_LORESERVE) U (SHN_HIRESERVE, 0xfffffff], thus: | |
| 149 | − * shndx == 0 <=> sechdrs[0] | |
| 150 | − * ...... | |
| 151 | − * shndx == SHN_LORESERVE-1 <=> sechdrs[SHN_LORESERVE-1] | |
| 152 | − * shndx == SHN_HIRESERVE+1 <=> sechdrs[SHN_LORESERVE] | |
| 153 | − * shndx == SHN_HIRESERVE+2 <=> sechdrs[SHN_LORESERVE+1] | |
| 154 | − * ...... | |
| 155 | − * fyi: sym->st_shndx is uint16, SHN_LORESERVE = ff00, SHN_HIRESERVE = ffff, | |
| 156 | − * so basically we map 0000..feff -> 0000..feff | |
| 157 | − * ff00..ffff -> (you are a bad boy, dont do it) | |
| 158 | − * 10000..xxxx -> ff00..(xxxx-0x100) | |
| 148 | +/* | |
| 149 | + * Move reserved section indices SHN_LORESERVE..SHN_HIRESERVE out of | |
| 150 | + * the way to -256..-1, to avoid conflicting with real section | |
| 151 | + * indices. | |
| 159 | 152 | */ |
| 160 | −static inline unsigned int shndx2secindex(unsigned int i) | |
| 161 | −{ | |
| 162 | − if (i <= SHN_HIRESERVE) | |
| 163 | − return i; | |
| 164 | − return i - (SHN_HIRESERVE + 1 - SHN_LORESERVE); | |
| 165 | −} | |
| 153 | +#define SPECIAL(i) ((i) - (SHN_HIRESERVE + 1)) | |
| 166 | 154 | |
| 167 | 155 | /* Accessor for sym->st_shndx, hides ugliness of "64k sections" */ |
| 168 | 156 | static inline unsigned int get_secindex(const struct elf_info *info, |
| 169 | 157 | const Elf_Sym *sym) |
| 170 | 158 | { |
| 159 | + if (is_shndx_special(sym->st_shndx)) | |
| 160 | + return SPECIAL(sym->st_shndx); | |
| 171 | 161 | if (sym->st_shndx != SHN_XINDEX) |
| 172 | 162 | return sym->st_shndx; |
| 173 | − return shndx2secindex(info->symtab_shndx_start[sym - | |
| 174 | − info->symtab_start]); | |
| 163 | + return info->symtab_shndx_start[sym - info->symtab_start]; | |
| 175 | 164 | } |
| 176 | 165 | |
| 177 | 166 | /* file2alias.c */ |
| @@ -5,4 +5,15 @@ · 4 unmodified lines | ||
| 5 | 5 | */ |
| 6 | 6 | SECTIONS { |
| 7 | 7 | /DISCARD/ : { *(.discard) } |
| 8 | + | |
| 9 | + __ksymtab : { *(SORT(___ksymtab+*)) } | |
| 10 | + __ksymtab_gpl : { *(SORT(___ksymtab_gpl+*)) } | |
| 11 | + __ksymtab_unused : { *(SORT(___ksymtab_unused+*)) } | |
| 12 | + __ksymtab_unused_gpl : { *(SORT(___ksymtab_unused_gpl+*)) } | |
| 13 | + __ksymtab_gpl_future : { *(SORT(___ksymtab_gpl_future+*)) } | |
| 14 | + __kcrctab : { *(SORT(___kcrctab+*)) } | |
| 15 | + __kcrctab_gpl : { *(SORT(___kcrctab_gpl+*)) } | |
| 16 | + __kcrctab_unused : { *(SORT(___kcrctab_unused+*)) } | |
| 17 | + __kcrctab_unused_gpl : { *(SORT(___kcrctab_unused_gpl+*)) } | |
| 18 | + __kcrctab_gpl_future : { *(SORT(___kcrctab_gpl_future+*)) } | |
| 8 | 19 | } |
| @@ -26,9 +26,9 @@ RPM := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \ · 25 unmodified lines | ||
| 26 | 26 | else echo rpm; fi) |
| 27 | 27 | |
| 28 | 28 | # Remove hyphens since they have special meaning in RPM filenames |
| 29 | −KERNELPATH := kernel-$(subst -,,$(KERNELRELEASE)) | |
| 29 | +KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE)) | |
| 30 | 30 | MKSPEC := $(srctree)/scripts/package/mkspec |
| 31 | −PREV := set -e; cd ..; | |
| 31 | +PREV := set -e; cd -P ..; | |
| 32 | 32 | |
| 33 | 33 | # rpm-pkg |
| 34 | 34 | # --------------------------------------------------------------------------- |
| @@ -92,7 +92,7 @@ case "${ARCH}" in · 91 unmodified lines | ||
| 92 | 92 | echo "" >&2 |
| 93 | 93 | echo '** ** ** WARNING ** ** **' >&2 |
| 94 | 94 | echo "" >&2 |
| 95 | − echo "Your architecture did not define any architecture-dependant files" >&2 | |
| 95 | + echo "Your architecture did not define any architecture-dependent files" >&2 | |
| 96 | 96 | echo "to be placed into the tarball. Please add those to ${0} ..." >&2 |
| 97 | 97 | echo "" >&2 |
| 98 | 98 | sleep 5 |
| @@ -22,7 +22,7 @@ if [ "`grep CONFIG_DRM=y .config | cut -f2 -d\=`" = "y" ]; then · 21 unmodified lines | ||
| 22 | 22 | fi |
| 23 | 23 | |
| 24 | 24 | PROVIDES="$PROVIDES kernel-$KERNELRELEASE" |
| 25 | −__KERNELRELEASE=`echo $KERNELRELEASE | sed -e "s/-//g"` | |
| 25 | +__KERNELRELEASE=`echo $KERNELRELEASE | sed -e "s/-/_/g"` | |
| 26 | 26 | |
| 27 | 27 | echo "Name: kernel" |
| 28 | 28 | echo "Summary: The Linux Kernel" |
| @@ -47,6 +47,18 @@ echo "" · 18 unmodified lines | ||
| 47 | 47 | echo "%description" |
| 48 | 48 | echo "The Linux Kernel, the operating system core itself" |
| 49 | 49 | echo "" |
| 50 | +echo "%package headers" | |
| 51 | +echo "Summary: Header files for the Linux kernel for use by glibc" | |
| 52 | +echo "Group: Development/System" | |
| 53 | +echo "Obsoletes: kernel-headers" | |
| 54 | +echo "Provides: kernel-headers = %{version}" | |
| 55 | +echo "%description headers" | |
| 56 | +echo "Kernel-headers includes the C header files that specify the interface" | |
| 57 | +echo "between the Linux kernel and userspace libraries and programs. The" | |
| 58 | +echo "header files define structures and constants that are needed for" | |
| 59 | +echo "building most standard programs and are also needed for rebuilding the" | |
| 60 | +echo "glibc package." | |
| 61 | +echo "" | |
| 50 | 62 | |
| 51 | 63 | if ! $PREBUILT; then |
| 52 | 64 | echo "%prep" |
| @@ -83,6 +95,7 @@ echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/vmlinuz-$KERNELRELEASE" · 30 unmodified lines | ||
| 83 | 95 | echo "%endif" |
| 84 | 96 | echo "%endif" |
| 85 | 97 | |
| 98 | +echo 'make %{?_smp_mflags} INSTALL_HDR_PATH=$RPM_BUILD_ROOT/usr headers_install' | |
| 86 | 99 | echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$KERNELRELEASE" |
| 87 | 100 | |
| 88 | 101 | echo 'cp .config $RPM_BUILD_ROOT'"/boot/config-$KERNELRELEASE" |
| @@ -105,3 +118,7 @@ echo "/lib/modules/$KERNELRELEASE" · 16 unmodified lines | ||
| 105 | 118 | echo "/lib/firmware" |
| 106 | 119 | echo "/boot/*" |
| 107 | 120 | echo "" |
| 121 | +echo "%files headers" | |
| 122 | +echo '%defattr (-, root, root)' | |
| 123 | +echo "/usr/include" | |
| 124 | +echo "" | |
| @@ -250,7 +250,7 @@ while : # incrementing SUBLEVEL (s in v.p.s) · 249 unmodified lines | ||
| 250 | 250 | do |
| 251 | 251 | CURRENTFULLVERSION="$VERSION.$PATCHLEVEL.$SUBLEVEL" |
| 252 | 252 | EXTRAVER= |
| 253 | − if [ $STOPFULLVERSION = $CURRENTFULLVERSION ]; then | |
| 253 | + if [ x$STOPFULLVERSION = x$CURRENTFULLVERSION ]; then | |
| 254 | 254 | echo "Stopping at $CURRENTFULLVERSION base as requested." |
| 255 | 255 | break |
| 256 | 256 | fi |
| @@ -24,6 +24,7 @@ · 23 unmodified lines | ||
| 24 | 24 | #include <sys/types.h> |
| 25 | 25 | #include <sys/mman.h> |
| 26 | 26 | #include <sys/stat.h> |
| 27 | +#include <getopt.h> | |
| 27 | 28 | #include <elf.h> |
| 28 | 29 | #include <fcntl.h> |
| 29 | 30 | #include <setjmp.h> |
| @@ -39,6 +40,7 @@ static char gpfx; /* prefix for global symbol name (sometimes '_') */ · 9 unmodified lines | ||
| 39 | 40 | static struct stat sb; /* Remember .st_size, etc. */ |
| 40 | 41 | static jmp_buf jmpenv; /* setjmp/longjmp per-file error escape */ |
| 41 | 42 | static const char *altmcount; /* alternate mcount symbol name */ |
| 43 | +static int warn_on_notrace_sect; /* warn when section has mcount not being recorded */ | |
| 42 | 44 | |
| 43 | 45 | /* setjmp() return values */ |
| 44 | 46 | enum { |
| @@ -78,7 +80,7 @@ static off_t · 33 unmodified lines | ||
| 78 | 80 | ulseek(int const fd, off_t const offset, int const whence) |
| 79 | 81 | { |
| 80 | 82 | off_t const w = lseek(fd, offset, whence); |
| 81 | − if ((off_t)-1 == w) { | |
| 83 | + if (w == (off_t)-1) { | |
| 82 | 84 | perror("lseek"); |
| 83 | 85 | fail_file(); |
| 84 | 86 | } |
| @@ -111,13 +113,41 @@ static void * · 26 unmodified lines | ||
| 111 | 113 | umalloc(size_t size) |
| 112 | 114 | { |
| 113 | 115 | void *const addr = malloc(size); |
| 114 | − if (0 == addr) { | |
| 116 | + if (addr == 0) { | |
| 115 | 117 | fprintf(stderr, "malloc failed: %zu bytes\n", size); |
| 116 | 118 | fail_file(); |
| 117 | 119 | } |
| 118 | 120 | return addr; |
| 119 | 121 | } |
| 120 | 122 | |
| 123 | +static unsigned char ideal_nop5_x86_64[5] = { 0x0f, 0x1f, 0x44, 0x00, 0x00 }; | |
| 124 | +static unsigned char ideal_nop5_x86_32[5] = { 0x3e, 0x8d, 0x74, 0x26, 0x00 }; | |
| 125 | +static unsigned char *ideal_nop; | |
| 126 | + | |
| 127 | +static char rel_type_nop; | |
| 128 | + | |
| 129 | +static int (*make_nop)(void *map, size_t const offset); | |
| 130 | + | |
| 131 | +static int make_nop_x86(void *map, size_t const offset) | |
| 132 | +{ | |
| 133 | + uint32_t *ptr; | |
| 134 | + unsigned char *op; | |
| 135 | + | |
| 136 | + /* Confirm we have 0xe8 0x0 0x0 0x0 0x0 */ | |
| 137 | + ptr = map + offset; | |
| 138 | + if (*ptr != 0) | |
| 139 | + return -1; | |
| 140 | + | |
| 141 | + op = map + offset - 1; | |
| 142 | + if (*op != 0xe8) | |
| 143 | + return -1; | |
| 144 | + | |
| 145 | + /* convert to nop */ | |
| 146 | + ulseek(fd_map, offset - 1, SEEK_SET); | |
| 147 | + uwrite(fd_map, ideal_nop, 5); | |
| 148 | + return 0; | |
| 149 | +} | |
| 150 | + | |
| 121 | 151 | /* |
| 122 | 152 | * Get the whole file as a programming convenience in order to avoid |
| 123 | 153 | * malloc+lseek+read+free of many pieces. If successful, then mmap |
| @@ -136,7 +166,7 @@ static void *mmap_file(char const *fname) · 12 unmodified lines | ||
| 136 | 166 | void *addr; |
| 137 | 167 | |
| 138 | 168 | fd_map = open(fname, O_RDWR); |
| 139 | − if (0 > fd_map || 0 > fstat(fd_map, &sb)) { | |
| 169 | + if (fd_map < 0 || fstat(fd_map, &sb) < 0) { | |
| 140 | 170 | perror(fname); |
| 141 | 171 | fail_file(); |
| 142 | 172 | } |
| @@ -147,7 +177,7 @@ static void *mmap_file(char const *fname) · 4 unmodified lines | ||
| 147 | 177 | addr = mmap(0, sb.st_size, PROT_READ|PROT_WRITE, MAP_PRIVATE, |
| 148 | 178 | fd_map, 0); |
| 149 | 179 | mmap_failed = 0; |
| 150 | − if (MAP_FAILED == addr) { | |
| 180 | + if (addr == MAP_FAILED) { | |
| 151 | 181 | mmap_failed = 1; |
| 152 | 182 | addr = umalloc(sb.st_size); |
| 153 | 183 | uread(fd_map, addr, sb.st_size); |
| @@ -206,12 +236,13 @@ static uint32_t (*w2)(uint16_t); · 52 unmodified lines | ||
| 206 | 236 | static int |
| 207 | 237 | is_mcounted_section_name(char const *const txtname) |
| 208 | 238 | { |
| 209 | − return 0 == strcmp(".text", txtname) || | |
| 210 | − 0 == strcmp(".ref.text", txtname) || | |
| 211 | − 0 == strcmp(".sched.text", txtname) || | |
| 212 | − 0 == strcmp(".spinlock.text", txtname) || | |
| 213 | − 0 == strcmp(".irqentry.text", txtname) || | |
| 214 | − 0 == strcmp(".text.unlikely", txtname); | |
| 239 | + return strcmp(".text", txtname) == 0 || | |
| 240 | + strcmp(".ref.text", txtname) == 0 || | |
| 241 | + strcmp(".sched.text", txtname) == 0 || | |
| 242 | + strcmp(".spinlock.text", txtname) == 0 || | |
| 243 | + strcmp(".irqentry.text", txtname) == 0 || | |
| 244 | + strcmp(".kprobes.text", txtname) == 0 || | |
| 245 | + strcmp(".text.unlikely", txtname) == 0; | |
| 215 | 246 | } |
| 216 | 247 | |
| 217 | 248 | /* 32 bit and 64 bit are very similar */ |
| @@ -264,43 +295,48 @@ do_file(char const *const fname) · 46 unmodified lines | ||
| 264 | 295 | w8 = w8nat; |
| 265 | 296 | switch (ehdr->e_ident[EI_DATA]) { |
| 266 | 297 | static unsigned int const endian = 1; |
| 267 | − default: { | |
| 298 | + default: | |
| 268 | 299 | fprintf(stderr, "unrecognized ELF data encoding %d: %s\n", |
| 269 | 300 | ehdr->e_ident[EI_DATA], fname); |
| 270 | 301 | fail_file(); |
| 271 | − } break; | |
| 272 | − case ELFDATA2LSB: { | |
| 273 | − if (1 != *(unsigned char const *)&endian) { | |
| 302 | + break; | |
| 303 | + case ELFDATA2LSB: | |
| 304 | + if (*(unsigned char const *)&endian != 1) { | |
| 274 | 305 | /* main() is big endian, file.o is little endian. */ |
| 275 | 306 | w = w4rev; |
| 276 | 307 | w2 = w2rev; |
| 277 | 308 | w8 = w8rev; |
| 278 | 309 | } |
| 279 | − } break; | |
| 280 | − case ELFDATA2MSB: { | |
| 281 | − if (0 != *(unsigned char const *)&endian) { | |
| 310 | + break; | |
| 311 | + case ELFDATA2MSB: | |
| 312 | + if (*(unsigned char const *)&endian != 0) { | |
| 282 | 313 | /* main() is little endian, file.o is big endian. */ |
| 283 | 314 | w = w4rev; |
| 284 | 315 | w2 = w2rev; |
| 285 | 316 | w8 = w8rev; |
| 286 | 317 | } |
| 287 | − } break; | |
| 318 | + break; | |
| 288 | 319 | } /* end switch */ |
| 289 | − if (0 != memcmp(ELFMAG, ehdr->e_ident, SELFMAG) | |
| 290 | − || ET_REL != w2(ehdr->e_type) | |
| 291 | − || EV_CURRENT != ehdr->e_ident[EI_VERSION]) { | |
| 320 | + if (memcmp(ELFMAG, ehdr->e_ident, SELFMAG) != 0 | |
| 321 | + || w2(ehdr->e_type) != ET_REL | |
| 322 | + || ehdr->e_ident[EI_VERSION] != EV_CURRENT) { | |
| 292 | 323 | fprintf(stderr, "unrecognized ET_REL file %s\n", fname); |
| 293 | 324 | fail_file(); |
| 294 | 325 | } |
| 295 | 326 | |
| 296 | 327 | gpfx = 0; |
| 297 | 328 | switch (w2(ehdr->e_machine)) { |
| 298 | − default: { | |
| 329 | + default: | |
| 299 | 330 | fprintf(stderr, "unrecognized e_machine %d %s\n", |
| 300 | 331 | w2(ehdr->e_machine), fname); |
| 301 | 332 | fail_file(); |
| 302 | − } break; | |
| 303 | − case EM_386: reltype = R_386_32; break; | |
| 333 | + break; | |
| 334 | + case EM_386: | |
| 335 | + reltype = R_386_32; | |
| 336 | + make_nop = make_nop_x86; | |
| 337 | + ideal_nop = ideal_nop5_x86_32; | |
| 338 | + mcount_adjust_32 = -1; | |
| 339 | + break; | |
| 304 | 340 | case EM_ARM: reltype = R_ARM_ABS32; |
| 305 | 341 | altmcount = "__gnu_mcount_nc"; |
| 306 | 342 | break; |
| @@ -311,67 +347,91 @@ do_file(char const *const fname) · 4 unmodified lines | ||
| 311 | 347 | case EM_S390: /* reltype: e_class */ gpfx = '_'; break; |
| 312 | 348 | case EM_SH: reltype = R_SH_DIR32; break; |
| 313 | 349 | case EM_SPARCV9: reltype = R_SPARC_64; gpfx = '_'; break; |
| 314 | − case EM_X86_64: reltype = R_X86_64_64; break; | |
| 350 | + case EM_X86_64: | |
| 351 | + make_nop = make_nop_x86; | |
| 352 | + ideal_nop = ideal_nop5_x86_64; | |
| 353 | + reltype = R_X86_64_64; | |
| 354 | + mcount_adjust_64 = -1; | |
| 355 | + break; | |
| 315 | 356 | } /* end switch */ |
| 316 | 357 | |
| 317 | 358 | switch (ehdr->e_ident[EI_CLASS]) { |
| 318 | − default: { | |
| 359 | + default: | |
| 319 | 360 | fprintf(stderr, "unrecognized ELF class %d %s\n", |
| 320 | 361 | ehdr->e_ident[EI_CLASS], fname); |
| 321 | 362 | fail_file(); |
| 322 | − } break; | |
| 323 | − case ELFCLASS32: { | |
| 324 | − if (sizeof(Elf32_Ehdr) != w2(ehdr->e_ehsize) | |
| 325 | − || sizeof(Elf32_Shdr) != w2(ehdr->e_shentsize)) { | |
| 363 | + break; | |
| 364 | + case ELFCLASS32: | |
| 365 | + if (w2(ehdr->e_ehsize) != sizeof(Elf32_Ehdr) | |
| 366 | + || w2(ehdr->e_shentsize) != sizeof(Elf32_Shdr)) { | |
| 326 | 367 | fprintf(stderr, |
| 327 | 368 | "unrecognized ET_REL file: %s\n", fname); |
| 328 | 369 | fail_file(); |
| 329 | 370 | } |
| 330 | − if (EM_S390 == w2(ehdr->e_machine)) | |
| 371 | + if (w2(ehdr->e_machine) == EM_S390) { | |
| 331 | 372 | reltype = R_390_32; |
| 332 | − if (EM_MIPS == w2(ehdr->e_machine)) { | |
| 373 | + mcount_adjust_32 = -4; | |
| 374 | + } | |
| 375 | + if (w2(ehdr->e_machine) == EM_MIPS) { | |
| 333 | 376 | reltype = R_MIPS_32; |
| 334 | 377 | is_fake_mcount32 = MIPS32_is_fake_mcount; |
| 335 | 378 | } |
| 336 | 379 | do32(ehdr, fname, reltype); |
| 337 | − } break; | |
| 380 | + break; | |
| 338 | 381 | case ELFCLASS64: { |
| 339 | 382 | Elf64_Ehdr *const ghdr = (Elf64_Ehdr *)ehdr; |
| 340 | − if (sizeof(Elf64_Ehdr) != w2(ghdr->e_ehsize) | |
| 341 | − || sizeof(Elf64_Shdr) != w2(ghdr->e_shentsize)) { | |
| 383 | + if (w2(ghdr->e_ehsize) != sizeof(Elf64_Ehdr) | |
| 384 | + || w2(ghdr->e_shentsize) != sizeof(Elf64_Shdr)) { | |
| 342 | 385 | fprintf(stderr, |
| 343 | 386 | "unrecognized ET_REL file: %s\n", fname); |
| 344 | 387 | fail_file(); |
| 345 | 388 | } |
| 346 | − if (EM_S390 == w2(ghdr->e_machine)) | |
| 389 | + if (w2(ghdr->e_machine) == EM_S390) { | |
| 347 | 390 | reltype = R_390_64; |
| 348 | − if (EM_MIPS == w2(ghdr->e_machine)) { | |
| 391 | + mcount_adjust_64 = -8; | |
| 392 | + } | |
| 393 | + if (w2(ghdr->e_machine) == EM_MIPS) { | |
| 349 | 394 | reltype = R_MIPS_64; |
| 350 | 395 | Elf64_r_sym = MIPS64_r_sym; |
| 351 | 396 | Elf64_r_info = MIPS64_r_info; |
| 352 | 397 | is_fake_mcount64 = MIPS64_is_fake_mcount; |
| 353 | 398 | } |
| 354 | 399 | do64(ghdr, fname, reltype); |
| 355 | − } break; | |
| 400 | + break; | |
| 401 | + } | |
| 356 | 402 | } /* end switch */ |
| 357 | 403 | |
| 358 | 404 | cleanup(); |
| 359 | 405 | } |
| 360 | 406 | |
| 361 | 407 | int |
| 362 | −main(int argc, char const *argv[]) | |
| 408 | +main(int argc, char *argv[]) | |
| 363 | 409 | { |
| 364 | 410 | const char ftrace[] = "/ftrace.o"; |
| 365 | 411 | int ftrace_size = sizeof(ftrace) - 1; |
| 366 | 412 | int n_error = 0; /* gcc-4.3.0 false positive complaint */ |
| 413 | + int c; | |
| 414 | + int i; | |
| 415 | + | |
| 416 | + while ((c = getopt(argc, argv, "w")) >= 0) { | |
| 417 | + switch (c) { | |
| 418 | + case 'w': | |
| 419 | + warn_on_notrace_sect = 1; | |
| 420 | + break; | |
| 421 | + default: | |
| 422 | + fprintf(stderr, "usage: recordmcount [-w] file.o...\n"); | |
| 423 | + return 0; | |
| 424 | + } | |
| 425 | + } | |
| 367 | 426 | |
| 368 | − if (argc <= 1) { | |
| 369 | − fprintf(stderr, "usage: recordmcount file.o...\n"); | |
| 427 | + if ((argc - optind) < 1) { | |
| 428 | + fprintf(stderr, "usage: recordmcount [-w] file.o...\n"); | |
| 370 | 429 | return 0; |
| 371 | 430 | } |
| 372 | 431 | |
| 373 | 432 | /* Process each file in turn, allowing deep failure. */ |
| 374 | − for (--argc, ++argv; 0 < argc; --argc, ++argv) { | |
| 433 | + for (i = optind; i < argc; i++) { | |
| 434 | + char *file = argv[i]; | |
| 375 | 435 | int const sjval = setjmp(jmpenv); |
| 376 | 436 | int len; |
| 377 | 437 | |
| @@ -380,29 +440,29 @@ main(int argc, char const *argv[]) · 2 unmodified lines | ||
| 380 | 440 | * function but does not call it. Since ftrace.o should |
| 381 | 441 | * not be traced anyway, we just skip it. |
| 382 | 442 | */ |
| 383 | − len = strlen(argv[0]); | |
| 443 | + len = strlen(file); | |
| 384 | 444 | if (len >= ftrace_size && |
| 385 | − strcmp(argv[0] + (len - ftrace_size), ftrace) == 0) | |
| 445 | + strcmp(file + (len - ftrace_size), ftrace) == 0) | |
| 386 | 446 | continue; |
| 387 | 447 | |
| 388 | 448 | switch (sjval) { |
| 389 | − default: { | |
| 390 | − fprintf(stderr, "internal error: %s\n", argv[0]); | |
| 449 | + default: | |
| 450 | + fprintf(stderr, "internal error: %s\n", file); | |
| 391 | 451 | exit(1); |
| 392 | − } break; | |
| 393 | − case SJ_SETJMP: { /* normal sequence */ | |
| 452 | + break; | |
| 453 | + case SJ_SETJMP: /* normal sequence */ | |
| 394 | 454 | /* Avoid problems if early cleanup() */ |
| 395 | 455 | fd_map = -1; |
| 396 | 456 | ehdr_curr = NULL; |
| 397 | 457 | mmap_failed = 1; |
| 398 | − do_file(argv[0]); | |
| 399 | − } break; | |
| 400 | − case SJ_FAIL: { /* error in do_file or below */ | |
| 458 | + do_file(file); | |
| 459 | + break; | |
| 460 | + case SJ_FAIL: /* error in do_file or below */ | |
| 401 | 461 | ++n_error; |
| 402 | − } break; | |
| 403 | − case SJ_SUCCEED: { /* premature success */ | |
| 462 | + break; | |
| 463 | + case SJ_SUCCEED: /* premature success */ | |
| 404 | 464 | /* do nothing */ |
| 405 | − } break; | |
| 465 | + break; | |
| 406 | 466 | } /* end switch */ |
| 407 | 467 | } |
| 408 | 468 | return !!n_error; |
| @@ -22,11 +22,15 @@ · 21 unmodified lines | ||
| 22 | 22 | #undef is_fake_mcount |
| 23 | 23 | #undef fn_is_fake_mcount |
| 24 | 24 | #undef MIPS_is_fake_mcount |
| 25 | +#undef mcount_adjust | |
| 25 | 26 | #undef sift_rel_mcount |
| 27 | +#undef nop_mcount | |
| 26 | 28 | #undef find_secsym_ndx |
| 27 | 29 | #undef __has_rel_mcount |
| 28 | 30 | #undef has_rel_mcount |
| 29 | 31 | #undef tot_relsize |
| 32 | +#undef get_mcountsym | |
| 33 | +#undef get_sym_str_and_relp | |
| 30 | 34 | #undef do_func |
| 31 | 35 | #undef Elf_Addr |
| 32 | 36 | #undef Elf_Ehdr |
| @@ -39,6 +43,7 @@ · 6 unmodified lines | ||
| 39 | 43 | #undef ELF_R_INFO |
| 40 | 44 | #undef Elf_r_info |
| 41 | 45 | #undef ELF_ST_BIND |
| 46 | +#undef ELF_ST_TYPE | |
| 42 | 47 | #undef fn_ELF_R_SYM |
| 43 | 48 | #undef fn_ELF_R_INFO |
| 44 | 49 | #undef uint_t |
| @@ -49,14 +54,18 @@ · 4 unmodified lines | ||
| 49 | 54 | #ifdef RECORD_MCOUNT_64 |
| 50 | 55 | # define append_func append64 |
| 51 | 56 | # define sift_rel_mcount sift64_rel_mcount |
| 57 | +# define nop_mcount nop_mcount_64 | |
| 52 | 58 | # define find_secsym_ndx find64_secsym_ndx |
| 53 | 59 | # define __has_rel_mcount __has64_rel_mcount |
| 54 | 60 | # define has_rel_mcount has64_rel_mcount |
| 55 | 61 | # define tot_relsize tot64_relsize |
| 62 | +# define get_sym_str_and_relp get_sym_str_and_relp_64 | |
| 56 | 63 | # define do_func do64 |
| 64 | +# define get_mcountsym get_mcountsym_64 | |
| 57 | 65 | # define is_fake_mcount is_fake_mcount64 |
| 58 | 66 | # define fn_is_fake_mcount fn_is_fake_mcount64 |
| 59 | 67 | # define MIPS_is_fake_mcount MIPS64_is_fake_mcount |
| 68 | +# define mcount_adjust mcount_adjust_64 | |
| 60 | 69 | # define Elf_Addr Elf64_Addr |
| 61 | 70 | # define Elf_Ehdr Elf64_Ehdr |
| 62 | 71 | # define Elf_Shdr Elf64_Shdr |
| @@ -68,6 +77,7 @@ · 5 unmodified lines | ||
| 68 | 77 | # define ELF_R_INFO ELF64_R_INFO |
| 69 | 78 | # define Elf_r_info Elf64_r_info |
| 70 | 79 | # define ELF_ST_BIND ELF64_ST_BIND |
| 80 | +# define ELF_ST_TYPE ELF64_ST_TYPE | |
| 71 | 81 | # define fn_ELF_R_SYM fn_ELF64_R_SYM |
| 72 | 82 | # define fn_ELF_R_INFO fn_ELF64_R_INFO |
| 73 | 83 | # define uint_t uint64_t |
| @@ -77,14 +87,18 @@ · 3 unmodified lines | ||
| 77 | 87 | #else |
| 78 | 88 | # define append_func append32 |
| 79 | 89 | # define sift_rel_mcount sift32_rel_mcount |
| 90 | +# define nop_mcount nop_mcount_32 | |
| 80 | 91 | # define find_secsym_ndx find32_secsym_ndx |
| 81 | 92 | # define __has_rel_mcount __has32_rel_mcount |
| 82 | 93 | # define has_rel_mcount has32_rel_mcount |
| 83 | 94 | # define tot_relsize tot32_relsize |
| 95 | +# define get_sym_str_and_relp get_sym_str_and_relp_32 | |
| 84 | 96 | # define do_func do32 |
| 97 | +# define get_mcountsym get_mcountsym_32 | |
| 85 | 98 | # define is_fake_mcount is_fake_mcount32 |
| 86 | 99 | # define fn_is_fake_mcount fn_is_fake_mcount32 |
| 87 | 100 | # define MIPS_is_fake_mcount MIPS32_is_fake_mcount |
| 101 | +# define mcount_adjust mcount_adjust_32 | |
| 88 | 102 | # define Elf_Addr Elf32_Addr |
| 89 | 103 | # define Elf_Ehdr Elf32_Ehdr |
| 90 | 104 | # define Elf_Shdr Elf32_Shdr |
| @@ -96,6 +110,7 @@ · 5 unmodified lines | ||
| 96 | 110 | # define ELF_R_INFO ELF32_R_INFO |
| 97 | 111 | # define Elf_r_info Elf32_r_info |
| 98 | 112 | # define ELF_ST_BIND ELF32_ST_BIND |
| 113 | +# define ELF_ST_TYPE ELF32_ST_TYPE | |
| 99 | 114 | # define fn_ELF_R_SYM fn_ELF32_R_SYM |
| 100 | 115 | # define fn_ELF_R_INFO fn_ELF32_R_INFO |
| 101 | 116 | # define uint_t uint32_t |
| @@ -123,6 +138,8 @@ static void fn_ELF_R_INFO(Elf_Rel *const rp, unsigned sym, unsigned type) · 21 unmodified lines | ||
| 123 | 138 | } |
| 124 | 139 | static void (*Elf_r_info)(Elf_Rel *const rp, unsigned sym, unsigned type) = fn_ELF_R_INFO; |
| 125 | 140 | |
| 141 | +static int mcount_adjust = 0; | |
| 142 | + | |
| 126 | 143 | /* |
| 127 | 144 | * MIPS mcount long call has 2 _mcount symbols, only the position of the 1st |
| 128 | 145 | * _mcount symbol is needed for dynamic function tracer, with it, to disable |
| @@ -234,6 +251,49 @@ static void append_func(Elf_Ehdr *const ehdr, · 105 unmodified lines | ||
| 234 | 251 | uwrite(fd_map, ehdr, sizeof(*ehdr)); |
| 235 | 252 | } |
| 236 | 253 | |
| 254 | +static unsigned get_mcountsym(Elf_Sym const *const sym0, | |
| 255 | + Elf_Rel const *relp, | |
| 256 | + char const *const str0) | |
| 257 | +{ | |
| 258 | + unsigned mcountsym = 0; | |
| 259 | + | |
| 260 | + Elf_Sym const *const symp = | |
| 261 | + &sym0[Elf_r_sym(relp)]; | |
| 262 | + char const *symname = &str0[w(symp->st_name)]; | |
| 263 | + char const *mcount = gpfx == '_' ? "_mcount" : "mcount"; | |
| 264 | + | |
| 265 | + if (symname[0] == '.') | |
| 266 | + ++symname; /* ppc64 hack */ | |
| 267 | + if (strcmp(mcount, symname) == 0 || | |
| 268 | + (altmcount && strcmp(altmcount, symname) == 0)) | |
| 269 | + mcountsym = Elf_r_sym(relp); | |
| 270 | + | |
| 271 | + return mcountsym; | |
| 272 | +} | |
| 273 | + | |
| 274 | +static void get_sym_str_and_relp(Elf_Shdr const *const relhdr, | |
| 275 | + Elf_Ehdr const *const ehdr, | |
| 276 | + Elf_Sym const **sym0, | |
| 277 | + char const **str0, | |
| 278 | + Elf_Rel const **relp) | |
| 279 | +{ | |
| 280 | + Elf_Shdr *const shdr0 = (Elf_Shdr *)(_w(ehdr->e_shoff) | |
| 281 | + + (void *)ehdr); | |
| 282 | + unsigned const symsec_sh_link = w(relhdr->sh_link); | |
| 283 | + Elf_Shdr const *const symsec = &shdr0[symsec_sh_link]; | |
| 284 | + Elf_Shdr const *const strsec = &shdr0[w(symsec->sh_link)]; | |
| 285 | + Elf_Rel const *const rel0 = (Elf_Rel const *)(_w(relhdr->sh_offset) | |
| 286 | + + (void *)ehdr); | |
| 287 | + | |
| 288 | + *sym0 = (Elf_Sym const *)(_w(symsec->sh_offset) | |
| 289 | + + (void *)ehdr); | |
| 290 | + | |
| 291 | + *str0 = (char const *)(_w(strsec->sh_offset) | |
| 292 | + + (void *)ehdr); | |
| 293 | + | |
| 294 | + *relp = rel0; | |
| 295 | +} | |
| 296 | + | |
| 237 | 297 | /* |
| 238 | 298 | * Look at the relocations in order to find the calls to mcount. |
| 239 | 299 | * Accumulate the section offsets that are found, and their relocation info, |
| @@ -250,47 +310,27 @@ static uint_t *sift_rel_mcount(uint_t *mlocp, · 10 unmodified lines | ||
| 250 | 310 | { |
| 251 | 311 | uint_t *const mloc0 = mlocp; |
| 252 | 312 | Elf_Rel *mrelp = *mrelpp; |
| 253 | − Elf_Shdr *const shdr0 = (Elf_Shdr *)(_w(ehdr->e_shoff) | |
| 254 | − + (void *)ehdr); | |
| 255 | − unsigned const symsec_sh_link = w(relhdr->sh_link); | |
| 256 | − Elf_Shdr const *const symsec = &shdr0[symsec_sh_link]; | |
| 257 | − Elf_Sym const *const sym0 = (Elf_Sym const *)(_w(symsec->sh_offset) | |
| 258 | − + (void *)ehdr); | |
| 259 | − | |
| 260 | − Elf_Shdr const *const strsec = &shdr0[w(symsec->sh_link)]; | |
| 261 | − char const *const str0 = (char const *)(_w(strsec->sh_offset) | |
| 262 | − + (void *)ehdr); | |
| 263 | − | |
| 264 | − Elf_Rel const *const rel0 = (Elf_Rel const *)(_w(relhdr->sh_offset) | |
| 265 | − + (void *)ehdr); | |
| 313 | + Elf_Sym const *sym0; | |
| 314 | + char const *str0; | |
| 315 | + Elf_Rel const *relp; | |
| 266 | 316 | unsigned rel_entsize = _w(relhdr->sh_entsize); |
| 267 | 317 | unsigned const nrel = _w(relhdr->sh_size) / rel_entsize; |
| 268 | − Elf_Rel const *relp = rel0; | |
| 269 | − | |
| 270 | 318 | unsigned mcountsym = 0; |
| 271 | 319 | unsigned t; |
| 272 | 320 | |
| 321 | + get_sym_str_and_relp(relhdr, ehdr, &sym0, &str0, &relp); | |
| 322 | + | |
| 273 | 323 | for (t = nrel; t; --t) { |
| 274 | − if (!mcountsym) { | |
| 275 | − Elf_Sym const *const symp = | |
| 276 | − &sym0[Elf_r_sym(relp)]; | |
| 277 | − char const *symname = &str0[w(symp->st_name)]; | |
| 278 | − char const *mcount = '_' == gpfx ? "_mcount" : "mcount"; | |
| 279 | − | |
| 280 | − if ('.' == symname[0]) | |
| 281 | − ++symname; /* ppc64 hack */ | |
| 282 | − if (0 == strcmp(mcount, symname) || | |
| 283 | − (altmcount && 0 == strcmp(altmcount, symname))) | |
| 284 | − mcountsym = Elf_r_sym(relp); | |
| 285 | − } | |
| 324 | + if (!mcountsym) | |
| 325 | + mcountsym = get_mcountsym(sym0, relp, str0); | |
| 286 | 326 | |
| 287 | 327 | if (mcountsym == Elf_r_sym(relp) && !is_fake_mcount(relp)) { |
| 288 | − uint_t const addend = _w(_w(relp->r_offset) - recval); | |
| 289 | − | |
| 328 | + uint_t const addend = | |
| 329 | + _w(_w(relp->r_offset) - recval + mcount_adjust); | |
| 290 | 330 | mrelp->r_offset = _w(offbase |
| 291 | 331 | + ((void *)mlocp - (void *)mloc0)); |
| 292 | 332 | Elf_r_info(mrelp, recsym, reltype); |
| 293 | − if (sizeof(Elf_Rela) == rel_entsize) { | |
| 333 | + if (rel_entsize == sizeof(Elf_Rela)) { | |
| 294 | 334 | ((Elf_Rela *)mrelp)->r_addend = addend; |
| 295 | 335 | *mlocp++ = 0; |
| 296 | 336 | } else |
| @@ -304,6 +344,63 @@ static uint_t *sift_rel_mcount(uint_t *mlocp, · 7 unmodified lines | ||
| 304 | 344 | return mlocp; |
| 305 | 345 | } |
| 306 | 346 | |
| 347 | +/* | |
| 348 | + * Read the relocation table again, but this time its called on sections | |
| 349 | + * that are not going to be traced. The mcount calls here will be converted | |
| 350 | + * into nops. | |
| 351 | + */ | |
| 352 | +static void nop_mcount(Elf_Shdr const *const relhdr, | |
| 353 | + Elf_Ehdr const *const ehdr, | |
| 354 | + const char *const txtname) | |
| 355 | +{ | |
| 356 | + Elf_Shdr *const shdr0 = (Elf_Shdr *)(_w(ehdr->e_shoff) | |
| 357 | + + (void *)ehdr); | |
| 358 | + Elf_Sym const *sym0; | |
| 359 | + char const *str0; | |
| 360 | + Elf_Rel const *relp; | |
| 361 | + Elf_Shdr const *const shdr = &shdr0[w(relhdr->sh_info)]; | |
| 362 | + unsigned rel_entsize = _w(relhdr->sh_entsize); | |
| 363 | + unsigned const nrel = _w(relhdr->sh_size) / rel_entsize; | |
| 364 | + unsigned mcountsym = 0; | |
| 365 | + unsigned t; | |
| 366 | + int once = 0; | |
| 367 | + | |
| 368 | + get_sym_str_and_relp(relhdr, ehdr, &sym0, &str0, &relp); | |
| 369 | + | |
| 370 | + for (t = nrel; t; --t) { | |
| 371 | + int ret = -1; | |
| 372 | + | |
| 373 | + if (!mcountsym) | |
| 374 | + mcountsym = get_mcountsym(sym0, relp, str0); | |
| 375 | + | |
| 376 | + if (mcountsym == Elf_r_sym(relp) && !is_fake_mcount(relp)) { | |
| 377 | + if (make_nop) | |
| 378 | + ret = make_nop((void *)ehdr, shdr->sh_offset + relp->r_offset); | |
| 379 | + if (warn_on_notrace_sect && !once) { | |
| 380 | + printf("Section %s has mcount callers being ignored\n", | |
| 381 | + txtname); | |
| 382 | + once = 1; | |
| 383 | + /* just warn? */ | |
| 384 | + if (!make_nop) | |
| 385 | + return; | |
| 386 | + } | |
| 387 | + } | |
| 388 | + | |
| 389 | + /* | |
| 390 | + * If we successfully removed the mcount, mark the relocation | |
| 391 | + * as a nop (don't do anything with it). | |
| 392 | + */ | |
| 393 | + if (!ret) { | |
| 394 | + Elf_Rel rel; | |
| 395 | + rel = *(Elf_Rel *)relp; | |
| 396 | + Elf_r_info(&rel, Elf_r_sym(relp), rel_type_nop); | |
| 397 | + ulseek(fd_map, (void *)relp - (void *)ehdr, SEEK_SET); | |
| 398 | + uwrite(fd_map, &rel, sizeof(rel)); | |
| 399 | + } | |
| 400 | + relp = (Elf_Rel const *)(rel_entsize + (void *)relp); | |
| 401 | + } | |
| 402 | +} | |
| 403 | + | |
| 307 | 404 | |
| 308 | 405 | /* |
| 309 | 406 | * Find a symbol in the given section, to be used as the base for relocating |
| @@ -333,6 +430,11 @@ static unsigned find_secsym_ndx(unsigned const txtndx, · 23 unmodified lines | ||
| 333 | 430 | if (txtndx == w2(symp->st_shndx) |
| 334 | 431 | /* avoid STB_WEAK */ |
| 335 | 432 | && (STB_LOCAL == st_bind || STB_GLOBAL == st_bind)) { |
| 433 | + /* function symbols on ARM have quirks, avoid them */ | |
| 434 | + if (w2(ehdr->e_machine) == EM_ARM | |
| 435 | + && ELF_ST_TYPE(symp->st_info) == STT_FUNC) | |
| 436 | + continue; | |
| 437 | + | |
| 336 | 438 | *recvalp = _w(symp->st_value); |
| 337 | 439 | return symp - sym0; |
| 338 | 440 | } |
| @@ -354,13 +456,13 @@ __has_rel_mcount(Elf_Shdr const *const relhdr, /* is SHT_REL or SHT_RELA */ · 15 unmodified lines | ||
| 354 | 456 | Elf_Shdr const *const txthdr = &shdr0[w(relhdr->sh_info)]; |
| 355 | 457 | char const *const txtname = &shstrtab[w(txthdr->sh_name)]; |
| 356 | 458 | |
| 357 | − if (0 == strcmp("__mcount_loc", txtname)) { | |
| 459 | + if (strcmp("__mcount_loc", txtname) == 0) { | |
| 358 | 460 | fprintf(stderr, "warning: __mcount_loc already exists: %s\n", |
| 359 | 461 | fname); |
| 360 | 462 | succeed_file(); |
| 361 | 463 | } |
| 362 | − if (SHT_PROGBITS != w(txthdr->sh_type) || | |
| 363 | − !is_mcounted_section_name(txtname)) | |
| 464 | + if (w(txthdr->sh_type) != SHT_PROGBITS || | |
| 465 | + !(w(txthdr->sh_flags) & SHF_EXECINSTR)) | |
| 364 | 466 | return NULL; |
| 365 | 467 | return txtname; |
| 366 | 468 | } |
| @@ -370,7 +472,7 @@ static char const *has_rel_mcount(Elf_Shdr const *const relhdr, · 3 unmodified lines | ||
| 370 | 472 | char const *const shstrtab, |
| 371 | 473 | char const *const fname) |
| 372 | 474 | { |
| 373 | − if (SHT_REL != w(relhdr->sh_type) && SHT_RELA != w(relhdr->sh_type)) | |
| 475 | + if (w(relhdr->sh_type) != SHT_REL && w(relhdr->sh_type) != SHT_RELA) | |
| 374 | 476 | return NULL; |
| 375 | 477 | return __has_rel_mcount(relhdr, shdr0, shstrtab, fname); |
| 376 | 478 | } |
| @@ -383,9 +485,11 @@ static unsigned tot_relsize(Elf_Shdr const *const shdr0, · 6 unmodified lines | ||
| 383 | 485 | { |
| 384 | 486 | unsigned totrelsz = 0; |
| 385 | 487 | Elf_Shdr const *shdrp = shdr0; |
| 488 | + char const *txtname; | |
| 386 | 489 | |
| 387 | 490 | for (; nhdr; --nhdr, ++shdrp) { |
| 388 | − if (has_rel_mcount(shdrp, shdr0, shstrtab, fname)) | |
| 491 | + txtname = has_rel_mcount(shdrp, shdr0, shstrtab, fname); | |
| 492 | + if (txtname && is_mcounted_section_name(txtname)) | |
| 389 | 493 | totrelsz += _w(shdrp->sh_size); |
| 390 | 494 | } |
| 391 | 495 | return totrelsz; |
| @@ -421,7 +525,7 @@ do_func(Elf_Ehdr *const ehdr, char const *const fname, unsigned const reltype) · 29 unmodified lines | ||
| 421 | 525 | for (relhdr = shdr0, k = nhdr; k; --k, ++relhdr) { |
| 422 | 526 | char const *const txtname = has_rel_mcount(relhdr, shdr0, |
| 423 | 527 | shstrtab, fname); |
| 424 | − if (txtname) { | |
| 528 | + if (txtname && is_mcounted_section_name(txtname)) { | |
| 425 | 529 | uint_t recval = 0; |
| 426 | 530 | unsigned const recsym = find_secsym_ndx( |
| 427 | 531 | w(relhdr->sh_info), txtname, &recval, |
| @@ -432,6 +536,12 @@ do_func(Elf_Ehdr *const ehdr, char const *const fname, unsigned const reltype) · 4 unmodified lines | ||
| 432 | 536 | mlocp = sift_rel_mcount(mlocp, |
| 433 | 537 | (void *)mlocp - (void *)mloc0, &mrelp, |
| 434 | 538 | relhdr, ehdr, recsym, recval, reltype); |
| 539 | + } else if (txtname && (warn_on_notrace_sect || make_nop)) { | |
| 540 | + /* | |
| 541 | + * This section is ignored by ftrace, but still | |
| 542 | + * has mcount calls. Convert them to nops now. | |
| 543 | + */ | |
| 544 | + nop_mcount(relhdr, ehdr, txtname); | |
| 435 | 545 | } |
| 436 | 546 | } |
| 437 | 547 | if (mloc0 != mlocp) { |
| @@ -134,6 +134,7 @@ my %text_sections = ( · 133 unmodified lines | ||
| 134 | 134 | ".sched.text" => 1, |
| 135 | 135 | ".spinlock.text" => 1, |
| 136 | 136 | ".irqentry.text" => 1, |
| 137 | + ".kprobes.text" => 1, | |
| 137 | 138 | ".text.unlikely" => 1, |
| 138 | 139 | ); |
| 139 | 140 | |
| @@ -222,6 +223,7 @@ if ($arch eq "x86_64") { · 82 unmodified lines | ||
| 222 | 223 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount([+-]0x[0-9a-zA-Z]+)?\$"; |
| 223 | 224 | $type = ".quad"; |
| 224 | 225 | $alignment = 8; |
| 226 | + $mcount_adjust = -1; | |
| 225 | 227 | |
| 226 | 228 | # force flags for this arch |
| 227 | 229 | $ld .= " -m elf_x86_64"; |
| @@ -231,6 +233,7 @@ if ($arch eq "x86_64") { · 3 unmodified lines | ||
| 231 | 233 | |
| 232 | 234 | } elsif ($arch eq "i386") { |
| 233 | 235 | $alignment = 4; |
| 236 | + $mcount_adjust = -1; | |
| 234 | 237 | |
| 235 | 238 | # force flags for this arch |
| 236 | 239 | $ld .= " -m elf_i386"; |
| @@ -240,12 +243,14 @@ if ($arch eq "x86_64") { · 3 unmodified lines | ||
| 240 | 243 | |
| 241 | 244 | } elsif ($arch eq "s390" && $bits == 32) { |
| 242 | 245 | $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_32\\s+_mcount\$"; |
| 246 | + $mcount_adjust = -4; | |
| 243 | 247 | $alignment = 4; |
| 244 | 248 | $ld .= " -m elf_s390"; |
| 245 | 249 | $cc .= " -m31"; |
| 246 | 250 | |
| 247 | 251 | } elsif ($arch eq "s390" && $bits == 64) { |
| 248 | 252 | $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$"; |
| 253 | + $mcount_adjust = -8; | |
| 249 | 254 | $alignment = 8; |
| 250 | 255 | $type = ".quad"; |
| 251 | 256 | $ld .= " -m elf64_s390"; |
| @@ -180,7 +180,7 @@ while 1: · 179 unmodified lines | ||
| 180 | 180 | for s in stat: |
| 181 | 181 | s = s.strip() |
| 182 | 182 | if s.startswith(testop[0]): |
| 183 | − # Seperate status value | |
| 183 | + # Separate status value | |
| 184 | 184 | val = s[2:].strip() |
| 185 | 185 | query = analyse(val, testop, dat) |
| 186 | 186 | break |
| @@ -1,2 +1,2 @@ | ||
| 1 | −Please see Documentation/SELinux.txt for information on | |
| 1 | +Please see Documentation/security/SELinux.txt for information on | |
| 2 | 2 | installing a dummy SELinux policy. |
| @@ -132,7 +132,7 @@ exuberant() · 131 unmodified lines | ||
| 132 | 132 | --regex-asm='/^ENTRY\(([^)]*)\).*/\1/' \ |
| 133 | 133 | --regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \ |
| 134 | 134 | --regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1/' \ |
| 135 | − --regex-c++='/^DEFINE_EVENT\(([^,)]*).*/trace_\1/' | |
| 135 | + --regex-c++='/^DEFINE_EVENT\([^,)]*, *([^,)]*).*/trace_\1/' | |
| 136 | 136 | |
| 137 | 137 | all_kconfigs | xargs $1 -a \ |
| 138 | 138 | --langdef=kconfig --language-force=kconfig \ |
| @@ -152,7 +152,9 @@ emacs() · 13 unmodified lines | ||
| 152 | 152 | { |
| 153 | 153 | all_sources | xargs $1 -a \ |
| 154 | 154 | --regex='/^ENTRY(\([^)]*\)).*/\1/' \ |
| 155 | − --regex='/^SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/sys_\1/' | |
| 155 | + --regex='/^SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/sys_\1/' \ | |
| 156 | + --regex='/^TRACE_EVENT(\([^,)]*\).*/trace_\1/' \ | |
| 157 | + --regex='/^DEFINE_EVENT([^,)]*, *\([^,)]*\).*/trace_\1/' | |
| 156 | 158 | |
| 157 | 159 | all_kconfigs | xargs $1 -a \ |
| 158 | 160 | --regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/' |