summaryrefslogtreecommitdiff
path: root/gprof/call_graph.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2000-07-24 20:59:04 +0000
committerNick Clifton <nickc@redhat.com>2000-07-24 20:59:04 +0000
commit82e785d4cf4b189a632d9db8850cf820ffcd52a5 (patch)
treed92645153501a5ccf0c78483092641fa3dd9347b /gprof/call_graph.c
parentff67525fbf3ffb90f10f10d3065348b0b7e526fc (diff)
downloadbinutils-redhat-82e785d4cf4b189a632d9db8850cf820ffcd52a5.tar.gz
Add GPL copyright notices to uncopyrighted files.
Add copy of GPL.
Diffstat (limited to 'gprof/call_graph.c')
-rw-r--r--gprof/call_graph.c49
1 files changed, 32 insertions, 17 deletions
diff --git a/gprof/call_graph.c b/gprof/call_graph.c
index 6eee251ff0..ac442cbb56 100644
--- a/gprof/call_graph.c
+++ b/gprof/call_graph.c
@@ -1,3 +1,24 @@
+/* call_graph.c - Create call graphs.
+
+ Copyright (C) 2000 Free Software Foundation, Inc.
+
+ This file is part of GNU Binutils.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
#include "cg_arcs.h"
#include "call_graph.h"
#include "corefile.h"
@@ -28,17 +49,14 @@ DEFUN (cg_tally, (from_pc, self_pc, count),
For normal profiling, is_func will be set on all symbols, so this
code will do nothing. */
-
while (child >= symtab.base && ! child->is_func)
--child;
if (child < symtab.base)
return;
- /*
- * Keep arc if it is on INCL_ARCS table or if the INCL_ARCS table
- * is empty and it is not in the EXCL_ARCS table.
- */
+ /* Keep arc if it is on INCL_ARCS table or if the INCL_ARCS table
+ is empty and it is not in the EXCL_ARCS table. */
if (sym_id_arc_is_present (&syms[INCL_ARCS], parent, child)
|| (syms[INCL_ARCS].len == 0
&& !sym_id_arc_is_present (&syms[EXCL_ARCS], parent, child)))
@@ -51,13 +69,11 @@ DEFUN (cg_tally, (from_pc, self_pc, count),
}
}
+/* Read a record from file IFP describing an arc in the function
+ call-graph and the count of how many times the arc has been
+ traversed. FILENAME is the name of file IFP and is provided
+ for formatting error-messages only. */
-/*
- * Read a record from file IFP describing an arc in the function
- * call-graph and the count of how many times the arc has been
- * traversed. FILENAME is the name of file IFP and is provided
- * for formatting error-messages only.
- */
void
DEFUN (cg_read_rec, (ifp, filename), FILE * ifp AND CONST char *filename)
{
@@ -71,22 +87,21 @@ DEFUN (cg_read_rec, (ifp, filename), FILE * ifp AND CONST char *filename)
whoami, filename);
done (1);
}
+
from_pc = get_vma (core_bfd, (bfd_byte *) arc.from_pc);
self_pc = get_vma (core_bfd, (bfd_byte *) arc.self_pc);
count = bfd_get_32 (core_bfd, (bfd_byte *) arc.count);
DBG (SAMPLEDEBUG,
printf ("[cg_read_rec] frompc 0x%lx selfpc 0x%lx count %lu\n",
(unsigned long) from_pc, (unsigned long) self_pc, count));
- /* add this arc: */
+ /* Add this arc: */
cg_tally (from_pc, self_pc, count);
}
+/* Write all the arcs in the call-graph to file OFP. FILENAME is
+ the name of OFP and is provided for formatting error-messages
+ only. */
-/*
- * Write all the arcs in the call-graph to file OFP. FILENAME is
- * the name of OFP and is provided for formatting error-messages
- * only.
- */
void
DEFUN (cg_write_arcs, (ofp, filename), FILE * ofp AND const char *filename)
{