"Robert P. J. Day" | 63fc1a9 | 2006-07-02 19:47:05 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 2 | /* |
Denys Vlasenko | ebe6d9d | 2017-10-05 14:40:24 +0200 | [diff] [blame] | 3 | * readprofile.c - used to read /proc/profile |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 4 | * |
Denys Vlasenko | ebe6d9d | 2017-10-05 14:40:24 +0200 | [diff] [blame] | 5 | * Copyright (C) 1994,1996 Alessandro Rubini (rubini@ipvvis.unipv.it) |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 6 | * |
Denys Vlasenko | 0ef64bd | 2010-08-16 20:14:46 +0200 | [diff] [blame] | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | /* |
Denis Vlasenko | 1d42665 | 2008-03-17 09:09:09 +0000 | [diff] [blame] | 11 | * 1999-02-22 Arkadiusz Mickiewicz <misiek@pld.ORG.PL> |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 12 | * - added Native Language Support |
| 13 | * 1999-09-01 Stephane Eranian <eranian@cello.hpl.hp.com> |
| 14 | * - 64bit clean patch |
| 15 | * 3Feb2001 Andrew Morton <andrewm@uow.edu.au> |
| 16 | * - -M option to write profile multiplier. |
| 17 | * 2001-11-07 Werner Almesberger <wa@almesberger.net> |
| 18 | * - byte order auto-detection and -n option |
| 19 | * 2001-11-09 Werner Almesberger <wa@almesberger.net> |
| 20 | * - skip step size (index 0) |
| 21 | * 2002-03-09 John Levon <moz@compsoc.man.ac.uk> |
| 22 | * - make maplineno do something |
| 23 | * 2002-11-28 Mads Martin Joergensen + |
| 24 | * - also try /boot/System.map-`uname -r` |
| 25 | * 2003-04-09 Werner Almesberger <wa@almesberger.net> |
| 26 | * - fixed off-by eight error and improved heuristics in byte order detection |
| 27 | * 2003-08-12 Nikita Danilov <Nikita@Namesys.COM> |
| 28 | * - added -s option; example of use: |
| 29 | * "readprofile -s -m /boot/System.map-test | grep __d_lookup | sort -n -k3" |
| 30 | * |
| 31 | * Taken from util-linux and adapted for busybox by |
| 32 | * Paul Mundt <lethal@linux-sh.org>. |
| 33 | */ |
Denys Vlasenko | dd898c9 | 2016-11-23 11:46:32 +0100 | [diff] [blame] | 34 | //config:config READPROFILE |
Denys Vlasenko | b097a84 | 2018-12-28 03:20:17 +0100 | [diff] [blame] | 35 | //config: bool "readprofile (7.1 kb)" |
Denys Vlasenko | dd898c9 | 2016-11-23 11:46:32 +0100 | [diff] [blame] | 36 | //config: default y |
Denys Vlasenko | dd898c9 | 2016-11-23 11:46:32 +0100 | [diff] [blame] | 37 | //config: help |
Denys Vlasenko | 72089cf | 2017-07-21 09:50:55 +0200 | [diff] [blame] | 38 | //config: This allows you to parse /proc/profile for basic profiling. |
Denys Vlasenko | dd898c9 | 2016-11-23 11:46:32 +0100 | [diff] [blame] | 39 | |
| 40 | //applet:IF_READPROFILE(APPLET(readprofile, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
| 41 | |
| 42 | //kbuild:lib-$(CONFIG_READPROFILE) += readprofile.o |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 43 | |
Pere Orga | 5bc8c00 | 2011-04-11 03:29:49 +0200 | [diff] [blame] | 44 | //usage:#define readprofile_trivial_usage |
| 45 | //usage: "[OPTIONS]" |
| 46 | //usage:#define readprofile_full_usage "\n\n" |
Denys Vlasenko | 6f7b10c | 2021-06-13 03:51:55 +0200 | [diff] [blame] | 47 | //usage: " -m MAPFILE (Default: /boot/System.map)" |
| 48 | //usage: "\n -p PROFILE (Default: /proc/profile)" |
Pere Orga | 5bc8c00 | 2011-04-11 03:29:49 +0200 | [diff] [blame] | 49 | //usage: "\n -M NUM Set the profiling multiplier to NUM" |
| 50 | //usage: "\n -i Print only info about the sampling step" |
| 51 | //usage: "\n -v Verbose" |
| 52 | //usage: "\n -a Print all symbols, even if count is 0" |
| 53 | //usage: "\n -b Print individual histogram-bin counts" |
| 54 | //usage: "\n -s Print individual counters within functions" |
| 55 | //usage: "\n -r Reset all the counters (root only)" |
| 56 | //usage: "\n -n Disable byte order auto-detection" |
| 57 | |
Denis Vlasenko | b6adbf1 | 2007-05-26 19:00:18 +0000 | [diff] [blame] | 58 | #include "libbb.h" |
Rob Landley | d921b2e | 2006-08-03 15:41:12 +0000 | [diff] [blame] | 59 | #include <sys/utsname.h> |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 60 | |
| 61 | #define S_LEN 128 |
| 62 | |
Denis Vlasenko | 9b49a5e | 2007-10-11 10:05:36 +0000 | [diff] [blame] | 63 | int readprofile_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
Denis Vlasenko | a60f84e | 2008-07-05 09:18:54 +0000 | [diff] [blame] | 64 | int readprofile_main(int argc UNUSED_PARAM, char **argv) |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 65 | { |
| 66 | FILE *map; |
Denis Vlasenko | 1d42665 | 2008-03-17 09:09:09 +0000 | [diff] [blame] | 67 | const char *mapFile, *proFile; |
Denys Vlasenko | 0e09ded | 2018-03-11 19:35:58 +0100 | [diff] [blame] | 68 | unsigned long indx; |
Denis Vlasenko | ea62077 | 2006-10-14 02:23:43 +0000 | [diff] [blame] | 69 | size_t len; |
Denys Vlasenko | 0e09ded | 2018-03-11 19:35:58 +0100 | [diff] [blame] | 70 | uint64_t add0; |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 71 | unsigned int step; |
| 72 | unsigned int *buf, total, fn_len; |
Denis Vlasenko | cad3668 | 2006-09-22 08:39:49 +0000 | [diff] [blame] | 73 | unsigned long long fn_add, next_add; /* current and next address */ |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 74 | char fn_name[S_LEN], next_name[S_LEN]; /* current and next name */ |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 75 | char mapline[S_LEN]; |
Denis Vlasenko | 9225854 | 2006-11-01 10:25:35 +0000 | [diff] [blame] | 76 | char mode[8]; |
Denys Vlasenko | 0e09ded | 2018-03-11 19:35:58 +0100 | [diff] [blame] | 77 | int maplineno; |
| 78 | int multiplier; |
Denis Vlasenko | 1d42665 | 2008-03-17 09:09:09 +0000 | [diff] [blame] | 79 | unsigned opt; |
| 80 | enum { |
| 81 | OPT_M = (1 << 0), |
| 82 | OPT_m = (1 << 1), |
| 83 | OPT_p = (1 << 2), |
| 84 | OPT_n = (1 << 3), |
| 85 | OPT_a = (1 << 4), |
| 86 | OPT_b = (1 << 5), |
| 87 | OPT_s = (1 << 6), |
| 88 | OPT_i = (1 << 7), |
| 89 | OPT_r = (1 << 8), |
| 90 | OPT_v = (1 << 9), |
| 91 | }; |
| 92 | #define optMult (opt & OPT_M) |
| 93 | #define optNative (opt & OPT_n) |
| 94 | #define optAll (opt & OPT_a) |
| 95 | #define optBins (opt & OPT_b) |
| 96 | #define optSub (opt & OPT_s) |
| 97 | #define optInfo (opt & OPT_i) |
| 98 | #define optReset (opt & OPT_r) |
| 99 | #define optVerbose (opt & OPT_v) |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 100 | |
| 101 | #define next (current^1) |
| 102 | |
Denys Vlasenko | 0e09ded | 2018-03-11 19:35:58 +0100 | [diff] [blame] | 103 | proFile = "/proc/profile"; |
| 104 | mapFile = "/boot/System.map"; |
| 105 | multiplier = 0; |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 106 | |
Denys Vlasenko | 237bedd | 2016-07-06 21:58:02 +0200 | [diff] [blame] | 107 | opt = getopt32(argv, "M:+m:p:nabsirv", &multiplier, &mapFile, &proFile); |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 108 | |
Denis Vlasenko | 1d42665 | 2008-03-17 09:09:09 +0000 | [diff] [blame] | 109 | if (opt & (OPT_M|OPT_r)) { /* mult or reset, or both */ |
| 110 | int fd, to_write; |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 111 | |
| 112 | /* |
| 113 | * When writing the multiplier, if the length of the write is |
| 114 | * not sizeof(int), the multiplier is not changed |
| 115 | */ |
Denis Vlasenko | 1d42665 | 2008-03-17 09:09:09 +0000 | [diff] [blame] | 116 | to_write = sizeof(int); |
| 117 | if (!optMult) |
Denys Vlasenko | e4dcba1 | 2010-10-28 18:57:19 +0200 | [diff] [blame] | 118 | to_write = 1; /* sth different from sizeof(int) */ |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 119 | |
Denys Vlasenko | 0e09ded | 2018-03-11 19:35:58 +0100 | [diff] [blame] | 120 | fd = xopen("/proc/profile", O_WRONLY); |
Denis Vlasenko | a89d50f | 2007-11-13 17:51:40 +0000 | [diff] [blame] | 121 | xwrite(fd, &multiplier, to_write); |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 122 | close(fd); |
| 123 | return EXIT_SUCCESS; |
| 124 | } |
| 125 | |
| 126 | /* |
| 127 | * Use an fd for the profiling buffer, to skip stdio overhead |
| 128 | */ |
Denis Vlasenko | d67cef2 | 2007-06-13 06:47:47 +0000 | [diff] [blame] | 129 | len = MAXINT(ssize_t); |
Denis Vlasenko | f3745ea | 2008-04-19 19:32:08 +0000 | [diff] [blame] | 130 | buf = xmalloc_xopen_read_close(proFile, &len); |
Denys Vlasenko | 0e09ded | 2018-03-11 19:35:58 +0100 | [diff] [blame] | 131 | len /= sizeof(*buf); |
| 132 | |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 133 | if (!optNative) { |
Denys Vlasenko | 0e09ded | 2018-03-11 19:35:58 +0100 | [diff] [blame] | 134 | int big = 0, small = 0; |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 135 | unsigned *p; |
| 136 | |
Denys Vlasenko | 0e09ded | 2018-03-11 19:35:58 +0100 | [diff] [blame] | 137 | for (p = buf+1; p < buf+len; p++) { |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 138 | if (*p & ~0U << (sizeof(*buf)*4)) |
| 139 | big++; |
| 140 | if (*p & ((1 << (sizeof(*buf)*4))-1)) |
| 141 | small++; |
| 142 | } |
| 143 | if (big > small) { |
James Byrne | 6937487 | 2019-07-02 11:35:03 +0200 | [diff] [blame] | 144 | bb_simple_error_msg("assuming reversed byte order, " |
Denis Vlasenko | ea62077 | 2006-10-14 02:23:43 +0000 | [diff] [blame] | 145 | "use -n to force native byte order"); |
Denys Vlasenko | 0e09ded | 2018-03-11 19:35:58 +0100 | [diff] [blame] | 146 | BUILD_BUG_ON(sizeof(*p) > 8); |
| 147 | for (p = buf; p < buf+len; p++) { |
| 148 | if (sizeof(*p) == 2) |
| 149 | *p = bswap_16(*p); |
| 150 | if (sizeof(*p) == 4) |
| 151 | *p = bswap_32(*p); |
| 152 | if (sizeof(*p) == 8) |
| 153 | *p = bb_bswap_64(*p); |
| 154 | } |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 155 | } |
| 156 | } |
| 157 | |
| 158 | step = buf[0]; |
| 159 | if (optInfo) { |
Denys Vlasenko | 327f550 | 2013-11-29 16:45:45 +0100 | [diff] [blame] | 160 | printf("Sampling_step: %u\n", step); |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 161 | return EXIT_SUCCESS; |
| 162 | } |
| 163 | |
Denis Vlasenko | 5415c85 | 2008-07-21 23:05:26 +0000 | [diff] [blame] | 164 | map = xfopen_for_read(mapFile); |
Denys Vlasenko | 0e09ded | 2018-03-11 19:35:58 +0100 | [diff] [blame] | 165 | add0 = 0; |
| 166 | maplineno = 1; |
Denis Vlasenko | 9225854 | 2006-11-01 10:25:35 +0000 | [diff] [blame] | 167 | while (fgets(mapline, S_LEN, map)) { |
| 168 | if (sscanf(mapline, "%llx %s %s", &fn_add, mode, fn_name) != 3) |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 169 | bb_error_msg_and_die("%s(%i): wrong map line", |
Denys Vlasenko | 6967578 | 2013-01-14 01:34:48 +0100 | [diff] [blame] | 170 | mapFile, maplineno); |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 171 | |
Denys Vlasenko | 1d3a04a | 2016-11-28 01:22:57 +0100 | [diff] [blame] | 172 | if (strcmp(fn_name, "_stext") == 0) /* only elf works like this */ { |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 173 | add0 = fn_add; |
| 174 | break; |
| 175 | } |
| 176 | maplineno++; |
| 177 | } |
| 178 | |
| 179 | if (!add0) |
Rob Landley | b728500 | 2005-09-14 15:28:15 +0000 | [diff] [blame] | 180 | bb_error_msg_and_die("can't find \"_stext\" in %s", mapFile); |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 181 | |
| 182 | /* |
| 183 | * Main loop. |
| 184 | */ |
Denys Vlasenko | 0e09ded | 2018-03-11 19:35:58 +0100 | [diff] [blame] | 185 | total = 0; |
| 186 | indx = 1; |
Denis Vlasenko | 9225854 | 2006-11-01 10:25:35 +0000 | [diff] [blame] | 187 | while (fgets(mapline, S_LEN, map)) { |
Denys Vlasenko | 0e09ded | 2018-03-11 19:35:58 +0100 | [diff] [blame] | 188 | bool header_printed; |
| 189 | unsigned int this; |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 190 | |
Denis Vlasenko | 9225854 | 2006-11-01 10:25:35 +0000 | [diff] [blame] | 191 | if (sscanf(mapline, "%llx %s %s", &next_add, mode, next_name) != 3) |
Rob Landley | b728500 | 2005-09-14 15:28:15 +0000 | [diff] [blame] | 192 | bb_error_msg_and_die("%s(%i): wrong map line", |
Denis Vlasenko | 9225854 | 2006-11-01 10:25:35 +0000 | [diff] [blame] | 193 | mapFile, maplineno); |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 194 | |
| 195 | header_printed = 0; |
| 196 | |
| 197 | /* ignore any LEADING (before a '[tT]' symbol is found) |
| 198 | Absolute symbols */ |
Denys Vlasenko | 0e09ded | 2018-03-11 19:35:58 +0100 | [diff] [blame] | 199 | if ((mode[0] == 'A' || mode[0] == '?') && total == 0) |
| 200 | continue; |
| 201 | if ((mode[0]|0x20) != 't' && (mode[0]|0x20) != 'w') { |
Denys Vlasenko | e4dcba1 | 2010-10-28 18:57:19 +0200 | [diff] [blame] | 202 | break; /* only text is profiled */ |
Denys Vlasenko | 6b9f163 | 2010-01-28 02:24:24 +0100 | [diff] [blame] | 203 | } |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 204 | |
Denys Vlasenko | 0e09ded | 2018-03-11 19:35:58 +0100 | [diff] [blame] | 205 | if (indx >= len) |
James Byrne | 6937487 | 2019-07-02 11:35:03 +0200 | [diff] [blame] | 206 | bb_simple_error_msg_and_die("profile address out of range. " |
Denys Vlasenko | 6967578 | 2013-01-14 01:34:48 +0100 | [diff] [blame] | 207 | "Wrong map file?"); |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 208 | |
Denys Vlasenko | 0e09ded | 2018-03-11 19:35:58 +0100 | [diff] [blame] | 209 | this = 0; |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 210 | while (indx < (next_add-add0)/step) { |
| 211 | if (optBins && (buf[indx] || optAll)) { |
| 212 | if (!header_printed) { |
Denis Vlasenko | 9225854 | 2006-11-01 10:25:35 +0000 | [diff] [blame] | 213 | printf("%s:\n", fn_name); |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 214 | header_printed = 1; |
| 215 | } |
Denis Vlasenko | 9225854 | 2006-11-01 10:25:35 +0000 | [diff] [blame] | 216 | printf("\t%"PRIx64"\t%u\n", (indx - 1)*step + add0, buf[indx]); |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 217 | } |
| 218 | this += buf[indx++]; |
| 219 | } |
| 220 | total += this; |
| 221 | |
| 222 | if (optBins) { |
| 223 | if (optVerbose || this > 0) |
Denis Vlasenko | 9225854 | 2006-11-01 10:25:35 +0000 | [diff] [blame] | 224 | printf(" total\t\t\t\t%u\n", this); |
Denys Vlasenko | 1d3a04a | 2016-11-28 01:22:57 +0100 | [diff] [blame] | 225 | } else |
| 226 | if ((this || optAll) |
| 227 | && (fn_len = next_add-fn_add) != 0 |
Denis Vlasenko | 1d42665 | 2008-03-17 09:09:09 +0000 | [diff] [blame] | 228 | ) { |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 229 | if (optVerbose) |
Denys Vlasenko | 327f550 | 2013-11-29 16:45:45 +0100 | [diff] [blame] | 230 | printf("%016llx %-40s %6u %8.4f\n", fn_add, |
Denys Vlasenko | 6967578 | 2013-01-14 01:34:48 +0100 | [diff] [blame] | 231 | fn_name, this, this/(double)fn_len); |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 232 | else |
Denys Vlasenko | 327f550 | 2013-11-29 16:45:45 +0100 | [diff] [blame] | 233 | printf("%6u %-40s %8.4f\n", |
Denys Vlasenko | 6967578 | 2013-01-14 01:34:48 +0100 | [diff] [blame] | 234 | this, fn_name, this/(double)fn_len); |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 235 | if (optSub) { |
| 236 | unsigned long long scan; |
| 237 | |
| 238 | for (scan = (fn_add-add0)/step + 1; |
| 239 | scan < (next_add-add0)/step; scan++) { |
| 240 | unsigned long long addr; |
| 241 | |
| 242 | addr = (scan - 1)*step + add0; |
| 243 | printf("\t%#llx\t%s+%#llx\t%u\n", |
Denys Vlasenko | 6967578 | 2013-01-14 01:34:48 +0100 | [diff] [blame] | 244 | addr, fn_name, addr - fn_add, |
| 245 | buf[scan]); |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 246 | } |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | fn_add = next_add; |
Denis Vlasenko | 9225854 | 2006-11-01 10:25:35 +0000 | [diff] [blame] | 251 | strcpy(fn_name, next_name); |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 252 | |
| 253 | maplineno++; |
| 254 | } |
| 255 | |
| 256 | /* clock ticks, out of kernel text - probably modules */ |
Denys Vlasenko | 0e09ded | 2018-03-11 19:35:58 +0100 | [diff] [blame] | 257 | printf("%6u *unknown*\n", buf[len-1]); |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 258 | |
| 259 | /* trailer */ |
| 260 | if (optVerbose) |
Denys Vlasenko | 327f550 | 2013-11-29 16:45:45 +0100 | [diff] [blame] | 261 | printf("%016x %-40s %6u %8.4f\n", |
Denys Vlasenko | 6967578 | 2013-01-14 01:34:48 +0100 | [diff] [blame] | 262 | 0, "total", total, total/(double)(fn_add-add0)); |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 263 | else |
Denys Vlasenko | 327f550 | 2013-11-29 16:45:45 +0100 | [diff] [blame] | 264 | printf("%6u %-40s %8.4f\n", |
Denys Vlasenko | 6967578 | 2013-01-14 01:34:48 +0100 | [diff] [blame] | 265 | total, "total", total/(double)(fn_add-add0)); |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 266 | |
Denys Vlasenko | 035e715 | 2017-08-06 20:39:27 +0200 | [diff] [blame] | 267 | if (ENABLE_FEATURE_CLEAN_UP) { |
| 268 | fclose(map); |
| 269 | free(buf); |
| 270 | } |
Paul Mundt | 8b2d02e | 2005-05-20 17:22:18 +0000 | [diff] [blame] | 271 | |
| 272 | return EXIT_SUCCESS; |
| 273 | } |