1303 files changed, 32187 insertions, 57138 deletions
diff --git a/util-linux/readprofile.c b/util-linux/readprofile.c index a645404..31abb6b 100644 --- a/util-linux/readprofile.c +++ b/util-linux/readprofile.c @@ -31,6 +31,16 @@ * Taken from util-linux and adapted for busybox by * Paul Mundt <lethal@linux-sh.org>. */ +//config:config READPROFILE +//config: bool "readprofile" +//config: default y +//config: #select PLATFORM_LINUX +//config: help +//config: This allows you to parse /proc/profile for basic profiling. + +//applet:IF_READPROFILE(APPLET(readprofile, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_READPROFILE) += readprofile.o //usage:#define readprofile_trivial_usage //usage: "[OPTIONS]" @@ -99,8 +109,7 @@ int readprofile_main(int argc UNUSED_PARAM, char **argv) proFile = defaultpro; mapFile = defaultmap; - opt_complementary = "M+"; /* -M N */ - opt = getopt32(argv, "M:m:p:nabsirv", &multiplier, &mapFile, &proFile); + opt = getopt32(argv, "M:+m:p:nabsirv", &multiplier, &mapFile, &proFile); if (opt & (OPT_M|OPT_r)) { /* mult or reset, or both */ int fd, to_write; @@ -165,7 +174,7 @@ int readprofile_main(int argc UNUSED_PARAM, char **argv) bb_error_msg_and_die("%s(%i): wrong map line", mapFile, maplineno); - if (!strcmp(fn_name, "_stext")) /* only elf works like this */ { + if (strcmp(fn_name, "_stext") == 0) /* only elf works like this */ { add0 = fn_add; break; } @@ -215,8 +224,9 @@ int readprofile_main(int argc UNUSED_PARAM, char **argv) if (optBins) { if (optVerbose || this > 0) printf(" total\t\t\t\t%u\n", this); - } else if ((this || optAll) - && (fn_len = next_add-fn_add) != 0 + } else + if ((this || optAll) + && (fn_len = next_add-fn_add) != 0 ) { if (optVerbose) printf("%016llx %-40s %6u %8.4f\n", fn_add, |