Pull misc updates from Andrew Morton: "Updates to various subsystems which I help look after. lib, ocfs2, fatfs, autofs, squashfs, procfs, etc. A relatively small amount of material this time" * tag 'mm-nonmm-stable-2022-08-06-2' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (72 commits) scripts/gdb: ensure the absolute path is generated on initial source MAINTAINERS: kunit: add David Gow as a maintainer of KUnit mailmap: add linux.dev alias for Brendan Higgins mailmap: update Kirill's email profile: setup_profiling_timer() is moslty not implemented ocfs2: fix a typo in a comment ocfs2: use the bitmap API to simplify code ocfs2: remove some useless functions lib/mpi: fix typo 'the the' in comment proc: add some (hopefully) insightful comments bdi: remove enum wb_congested_state kernel/hung_task: fix address space of proc_dohung_task_timeout_secs lib/lzo/lzo1x_compress.c: replace ternary operator with min() and min_t() squashfs: support reading fragments in readahead call squashfs: implement readahead squashfs: always build "file direct" version of page actor Revert "squashfs: provide backing_dev_info in order to disable read-ahead" fs/ocfs2: Fix spelling typo in comment ia64: old_rr4 added under CONFIG_HUGETLB_PAGE proc: fix test for "vsyscall=xonly" boot option ...
Showing the changes to scripts (3 of 102 files). Show all
Unified · Split
| @@ -7,24 +7,31 @@ · 6 unmodified lines | ||
| 7 | 7 | # This software may be used and distributed according to the terms |
| 8 | 8 | # of the GNU General Public License, incorporated herein by reference. |
| 9 | 9 | |
| 10 | −import sys, os, re | |
| 10 | +import sys, os, re, argparse | |
| 11 | 11 | from signal import signal, SIGPIPE, SIG_DFL |
| 12 | 12 | |
| 13 | 13 | signal(SIGPIPE, SIG_DFL) |
| 14 | 14 | |
| 15 | −if len(sys.argv) < 3: | |
| 16 | − sys.stderr.write("usage: %s [option] file1 file2\n" % sys.argv[0]) | |
| 17 | − sys.stderr.write("The options are:\n") | |
| 18 | − sys.stderr.write("-c categorize output based on symbol type\n") | |
| 19 | − sys.stderr.write("-d Show delta of Data Section\n") | |
| 20 | − sys.stderr.write("-t Show delta of text Section\n") | |
| 21 | − sys.exit(-1) | |
| 15 | +parser = argparse.ArgumentParser(description="Simple script used to compare the symbol sizes of 2 object files") | |
| 16 | +group = parser.add_mutually_exclusive_group() | |
| 17 | +group.add_argument('-c', help='categorize output based on symbol type', action='store_true') | |
| 18 | +group.add_argument('-d', help='Show delta of Data Section', action='store_true') | |
| 19 | +group.add_argument('-t', help='Show delta of text Section', action='store_true') | |
| 20 | +parser.add_argument('-p', dest='prefix', help='Arch prefix for the tool being used. Useful in cross build scenarios') | |
| 21 | +parser.add_argument('file1', help='First file to compare') | |
| 22 | +parser.add_argument('file2', help='Second file to compare') | |
| 23 | + | |
| 24 | +args = parser.parse_args() | |
| 22 | 25 | |
| 23 | 26 | re_NUMBER = re.compile(r'\.[0-9]+') |
| 24 | 27 | |
| 25 | 28 | def getsizes(file, format): |
| 26 | 29 | sym = {} |
| 27 | − with os.popen("nm --size-sort " + file) as f: | |
| 30 | + nm = "nm" | |
| 31 | + if args.prefix: | |
| 32 | + nm = "{}nm".format(args.prefix) | |
| 33 | + | |
| 34 | + with os.popen("{} --size-sort {}".format(nm, file)) as f: | |
| 28 | 35 | for line in f: |
| 29 | 36 | if line.startswith("\n") or ":" in line: |
| 30 | 37 | continue |
| @@ -77,9 +84,9 @@ def calc(oldfile, newfile, format): · 46 unmodified lines | ||
| 77 | 84 | delta.reverse() |
| 78 | 85 | return grow, shrink, add, remove, up, down, delta, old, new, otot, ntot |
| 79 | 86 | |
| 80 | −def print_result(symboltype, symbolformat, argc): | |
| 87 | +def print_result(symboltype, symbolformat): | |
| 81 | 88 | grow, shrink, add, remove, up, down, delta, old, new, otot, ntot = \ |
| 82 | − calc(sys.argv[argc - 1], sys.argv[argc], symbolformat) | |
| 89 | + calc(args.file1, args.file2, symbolformat) | |
| 83 | 90 | |
| 84 | 91 | print("add/remove: %s/%s grow/shrink: %s/%s up/down: %s/%s (%s)" % \ |
| 85 | 92 | (add, remove, grow, shrink, up, -down, up-down)) |
| @@ -93,13 +100,13 @@ def print_result(symboltype, symbolformat, argc): · 7 unmodified lines | ||
| 93 | 100 | percent = 0 |
| 94 | 101 | print("Total: Before=%d, After=%d, chg %+.2f%%" % (otot, ntot, percent)) |
| 95 | 102 | |
| 96 | −if sys.argv[1] == "-c": | |
| 97 | − print_result("Function", "tT", 3) | |
| 98 | − print_result("Data", "dDbB", 3) | |
| 99 | − print_result("RO Data", "rR", 3) | |
| 100 | −elif sys.argv[1] == "-d": | |
| 101 | − print_result("Data", "dDbBrR", 3) | |
| 102 | −elif sys.argv[1] == "-t": | |
| 103 | − print_result("Function", "tT", 3) | |
| 103 | +if args.c: | |
| 104 | + print_result("Function", "tT") | |
| 105 | + print_result("Data", "dDbB") | |
| 106 | + print_result("RO Data", "rR") | |
| 107 | +elif args.d: | |
| 108 | + print_result("Data", "dDbBrR") | |
| 109 | +elif args.t: | |
| 110 | + print_result("Function", "tT") | |
| 104 | 111 | else: |
| 105 | − print_result("Function", "tTdDbBrR", 2) | |
| 112 | + print_result("Function", "tTdDbBrR") | |
| @@ -1042,7 +1042,8 @@ our $FuncArg = qr{$Typecast{0,1}($LvalOrFunc|$Constant|$String)}; · 1041 unmodified lines | ||
| 1042 | 1042 | our $declaration_macros = qr{(?x: |
| 1043 | 1043 | (?:$Storage\s+)?(?:[A-Z_][A-Z0-9]*_){0,2}(?:DEFINE|DECLARE)(?:_[A-Z0-9]+){1,6}\s*\(| |
| 1044 | 1044 | (?:$Storage\s+)?[HLP]?LIST_HEAD\s*\(| |
| 1045 | − (?:SKCIPHER_REQUEST|SHASH_DESC|AHASH_REQUEST)_ON_STACK\s*\( | |
| 1045 | + (?:SKCIPHER_REQUEST|SHASH_DESC|AHASH_REQUEST)_ON_STACK\s*\(| | |
| 1046 | + (?:$Storage\s+)?(?:XA_STATE|XA_STATE_ORDER)\s*\( | |
| 1046 | 1047 | )}; |
| 1047 | 1048 | |
| 1048 | 1049 | our %allow_repeated_words = ( |
| @@ -5720,7 +5721,7 @@ sub process { · 4671 unmodified lines | ||
| 5720 | 5721 | $var !~ /^(?:[a-z0-9_]*|[A-Z0-9_]*)?_?[a-z][A-Z](?:_[a-z0-9_]+|_[A-Z0-9_]+)?$/ && |
| 5721 | 5722 | #Ignore some three character SI units explicitly, like MiB and KHz |
| 5722 | 5723 | $var !~ /^(?:[a-z_]*?)_?(?:[KMGT]iB|[KMGT]?Hz)(?:_[a-z_]+)?$/) { |
| 5723 | − while ($var =~ m{($Ident)}g) { | |
| 5724 | + while ($var =~ m{\b($Ident)}g) { | |
| 5724 | 5725 | my $word = $1; |
| 5725 | 5726 | next if ($word !~ /[A-Z][a-z]|[a-z][A-Z]/); |
| 5726 | 5727 | if ($check) { |
| @@ -13,7 +13,7 @@ · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | import os |
| 15 | 15 | |
| 16 | −sys.path.insert(0, os.path.dirname(__file__) + "/scripts/gdb") | |
| 16 | +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)) + "/scripts/gdb") | |
| 17 | 17 | |
| 18 | 18 | try: |
| 19 | 19 | gdb.parse_and_eval("0") |