Changeset 609 for branches/GNU/src/binutils/gprof/hist.c
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/gprof/hist.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* hist.c - Histogram related operations. 2 2 3 Copyright 2000, 2001 Free Software Foundation, Inc.3 Copyright 2000, 2001, 2002 Free Software Foundation, Inc. 4 4 5 5 This file is part of GNU Binutils. … … 21 21 22 22 23 #include <stdio.h>24 23 #include "libiberty.h" 25 24 #include "gprof.h" 25 #include "search_list.h" 26 #include "source.h" 27 #include "symtab.h" 26 28 #include "corefile.h" 27 29 #include "gmon_io.h" 28 30 #include "gmon_out.h" 29 31 #include "hist.h" 30 #include "symtab.h"31 32 #include "sym_ids.h" 32 33 #include "utils.h" … … 35 36 36 37 static void scale_and_align_entries PARAMS ((void)); 38 static void print_header PARAMS ((int)); 39 static void print_line PARAMS ((Sym *, double)); 40 static int cmp_time PARAMS ((const PTR, const PTR)); 37 41 38 42 /* Declarations of automatically generated functions to output blurbs. */ … … 78 82 79 83 void 80 DEFUN (hist_read_rec, (ifp, filename), FILE * ifp AND const char *filename) 84 hist_read_rec (ifp, filename) 85 FILE * ifp; 86 const char *filename; 81 87 { 82 88 bfd_vma n_lowpc, n_highpc; … … 153 159 154 160 void 155 DEFUN (hist_write_hist, (ofp, filename), FILE * ofp AND const char *filename) 161 hist_write_hist (ofp, filename) 162 FILE * ofp; 163 const char *filename; 156 164 { 157 165 UNIT count; … … 174 182 for (i = 0; i < hist_num_bins; ++i) 175 183 { 176 bfd_put_16 (core_bfd, hist_sample[i], (bfd_byte *) &count[0]);184 bfd_put_16 (core_bfd, (bfd_vma) hist_sample[i], (bfd_byte *) &count[0]); 177 185 178 186 if (fwrite (&count[0], sizeof (count), 1, ofp) != 1) … … 256 264 257 265 void 258 DEFUN_VOID (hist_assign_samples)266 hist_assign_samples () 259 267 { 260 268 bfd_vma bin_low_pc, bin_high_pc; … … 345 353 346 354 static void 347 DEFUN (print_header, (prefix), const char prefix) 355 print_header (prefix) 356 int prefix; 348 357 { 349 358 char unit[64]; … … 384 393 385 394 static void 386 DEFUN (print_line, (sym, scale), Sym * sym AND double scale) 395 print_line (sym, scale) 396 Sym *sym; 397 double scale; 387 398 { 388 399 if (ignore_zeros && sym->ncalls == 0 && sym->hist.time == 0) … … 421 432 422 433 static int 423 DEFUN (cmp_time, (lp, rp), const PTR lp AND const PTR rp) 434 cmp_time (lp, rp) 435 const PTR lp; 436 const PTR rp; 424 437 { 425 438 const Sym *left = *(const Sym **) lp; … … 448 461 449 462 void 450 DEFUN_VOID (hist_print)463 hist_print () 451 464 { 452 465 Sym **time_sorted_syms, *top_dog, *sym; 453 466 unsigned int index; 454 intlog_scale;467 unsigned log_scale; 455 468 double top_time, time; 456 469 bfd_vma addr; … … 517 530 top_time /= hz; 518 531 519 while (SItab[log_scale].scale * top_time < 1000.0 520 && ((size_t) log_scale 521 < sizeof (SItab) / sizeof (SItab[0]) - 1)) 532 for (log_scale = 0; log_scale < ARRAY_SIZE (SItab); log_scale ++) 522 533 { 523 ++log_scale; 534 double scaled_value = SItab[log_scale].scale * top_time; 535 536 if (scaled_value >= 1.0 && scaled_value < 1000.0) 537 break; 524 538 } 525 539 } -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.