xref: /netbsd/external/gpl3/gdb/dist/gprof/cg_arcs.h (revision 1424dfb3)
1*1424dfb3Schristos /* Copyright (C) 2012-2020 Free Software Foundation, Inc.
2*1424dfb3Schristos 
3*1424dfb3Schristos    This file is part of GNU Binutils.
4*1424dfb3Schristos 
5*1424dfb3Schristos    This program is free software; you can redistribute it and/or modify
6*1424dfb3Schristos    it under the terms of the GNU General Public License as published by
7*1424dfb3Schristos    the Free Software Foundation; either version 3 of the License, or
8*1424dfb3Schristos    (at your option) any later version.
9*1424dfb3Schristos 
10*1424dfb3Schristos    This program is distributed in the hope that it will be useful,
11*1424dfb3Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
12*1424dfb3Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13*1424dfb3Schristos    GNU General Public License for more details.
14*1424dfb3Schristos 
15*1424dfb3Schristos    You should have received a copy of the GNU General Public License
16*1424dfb3Schristos    along with this program; if not, write to the Free Software
17*1424dfb3Schristos    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
18*1424dfb3Schristos    MA 02110-1301, USA.  */
19*1424dfb3Schristos 
20*1424dfb3Schristos #ifndef cg_arcs_h
21*1424dfb3Schristos #define cg_arcs_h
22*1424dfb3Schristos 
23*1424dfb3Schristos /*
24*1424dfb3Schristos  * Arc structure for call-graph.
25*1424dfb3Schristos  *
26*1424dfb3Schristos  * With pointers to the symbols of the parent and the child, a count
27*1424dfb3Schristos  * of how many times this arc was traversed, and pointers to the next
28*1424dfb3Schristos  * parent of this child and the next child of this parent.
29*1424dfb3Schristos  */
30*1424dfb3Schristos typedef struct arc
31*1424dfb3Schristos   {
32*1424dfb3Schristos     Sym *parent;		/* source vertice of arc */
33*1424dfb3Schristos     Sym *child;			/* dest vertice of arc */
34*1424dfb3Schristos     unsigned long count;	/* # of calls from parent to child */
35*1424dfb3Schristos     double time;		/* time inherited along arc */
36*1424dfb3Schristos     double child_time;		/* child-time inherited along arc */
37*1424dfb3Schristos     struct arc *next_parent;	/* next parent of CHILD */
38*1424dfb3Schristos     struct arc *next_child;	/* next child of PARENT */
39*1424dfb3Schristos     int has_been_placed;	/* have this arc's functions been placed? */
40*1424dfb3Schristos   }
41*1424dfb3Schristos Arc;
42*1424dfb3Schristos 
43*1424dfb3Schristos extern unsigned int num_cycles;	/* number of cycles discovered */
44*1424dfb3Schristos extern Sym *cycle_header;	/* cycle headers */
45*1424dfb3Schristos 
46*1424dfb3Schristos extern void arc_add (Sym * parent, Sym * child, unsigned long count);
47*1424dfb3Schristos extern Arc *arc_lookup (Sym * parent, Sym * child);
48*1424dfb3Schristos extern Sym **cg_assemble (void);
49*1424dfb3Schristos extern Arc **arcs;
50*1424dfb3Schristos extern unsigned int numarcs;
51*1424dfb3Schristos 
52*1424dfb3Schristos #endif /* cg_arcs_h */
53