Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/util-linux/readprofile.c
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/util-linux/readprofile.c
r2725 r3232 32 32 * Paul Mundt <lethal@linux-sh.org>. 33 33 */ 34 35 //usage:#define readprofile_trivial_usage 36 //usage: "[OPTIONS]" 37 //usage:#define readprofile_full_usage "\n\n" 38 //usage: " -m mapfile (Default: /boot/System.map)" 39 //usage: "\n -p profile (Default: /proc/profile)" 40 //usage: "\n -M NUM Set the profiling multiplier to NUM" 41 //usage: "\n -i Print only info about the sampling step" 42 //usage: "\n -v Verbose" 43 //usage: "\n -a Print all symbols, even if count is 0" 44 //usage: "\n -b Print individual histogram-bin counts" 45 //usage: "\n -s Print individual counters within functions" 46 //usage: "\n -r Reset all the counters (root only)" 47 //usage: "\n -n Disable byte order auto-detection" 34 48 35 49 #include "libbb.h" … … 150 164 if (sscanf(mapline, "%llx %s %s", &fn_add, mode, fn_name) != 3) 151 165 bb_error_msg_and_die("%s(%i): wrong map line", 152 166 mapFile, maplineno); 153 167 154 168 if (!strcmp(fn_name, "_stext")) /* only elf works like this */ { … … 185 199 if (indx >= len / sizeof(*buf)) 186 200 bb_error_msg_and_die("profile address out of range. " 187 201 "Wrong map file?"); 188 202 189 203 while (indx < (next_add-add0)/step) { … … 207 221 if (optVerbose) 208 222 printf("%016llx %-40s %6i %8.4f\n", fn_add, 209 223 fn_name, this, this/(double)fn_len); 210 224 else 211 225 printf("%6i %-40s %8.4f\n", 212 226 this, fn_name, this/(double)fn_len); 213 227 if (optSub) { 214 228 unsigned long long scan; … … 220 234 addr = (scan - 1)*step + add0; 221 235 printf("\t%#llx\t%s+%#llx\t%u\n", 222 223 236 addr, fn_name, addr - fn_add, 237 buf[scan]); 224 238 } 225 239 } … … 238 252 if (optVerbose) 239 253 printf("%016x %-40s %6i %8.4f\n", 240 254 0, "total", total, total/(double)(fn_add-add0)); 241 255 else 242 256 printf("%6i %-40s %8.4f\n", 243 257 total, "total", total/(double)(fn_add-add0)); 244 258 245 259 fclose(map);
Note:
See TracChangeset
for help on using the changeset viewer.