The patch titled Subject: scripts/bloat-o-meter: add -p argument has been added to the -mm mm-nonmm-unstable branch. Its filename is scripts-bloat-o-meter-add-p-argument.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/scripts-bloat-o-meter-add-p-argument.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Nikolay Borisov <nborisov@xxxxxxxx> Subject: scripts/bloat-o-meter: add -p argument Date: Fri, 1 Jul 2022 14:35:13 +0300 When doing cross platform development on a machine sometimes it might be useful to invoke bloat-o-meter for files which haven't been build with the native toolchain. In cases when the host nm doesn't support the target one then a toolchain-specific nm could be used. Add this ability by adding the -p allowing invocations as: ./scripts/bloat-o-meter -p riscv64-unknown-linux-gnu- file1.o file2.o Link: https://lkml.kernel.org/r/20220701113513.1938008-2-nborisov@xxxxxxxx Signed-off-by: Nikolay Borisov <nborisov@xxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- scripts/bloat-o-meter | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/scripts/bloat-o-meter~scripts-bloat-o-meter-add-p-argument +++ a/scripts/bloat-o-meter @@ -17,6 +17,7 @@ group = parser.add_mutually_exclusive_gr group.add_argument('-c', help='categorize output based on symbol type', action='store_true') group.add_argument('-d', help='Show delta of Data Section', action='store_true') group.add_argument('-t', help='Show delta of text Section', action='store_true') +parser.add_argument('-p', dest='prefix', help='Arch prefix for the tool being used. Useful in cross build scenarios') parser.add_argument('file1', help='First file to compare') parser.add_argument('file2', help='Second file to compare') @@ -26,7 +27,11 @@ re_NUMBER = re.compile(r'\.[0-9]+') def getsizes(file, format): sym = {} - with os.popen("nm --size-sort " + file) as f: + nm = "nm" + if args.prefix: + nm = "{}nm".format(args.prefix) + + with os.popen("{} --size-sort {}".format(nm, file)) as f: for line in f: if line.startswith("\n") or ":" in line: continue _ Patches currently in -mm which might be from nborisov@xxxxxxxx are scripts-bloat-o-meter-switch-argument-parsing-to-using-argparse.patch scripts-bloat-o-meter-add-p-argument.patch