Make the wired-in packages code handle ndp mapping to ndp-seq or ndp-par
[ghc-hetmet.git] / utils / prof / cgprof / cgprof.h
1 /* ------------------------------------------------------------------------
2  * $Id: cgprof.h,v 1.2 2003/08/01 14:50:50 panne Exp $
3  *                                                                      
4  *      Copyright (C) 1995-2000 University of Oxford
5  *                                                                      
6  * Permission to use, copy, modify, and distribute this software,
7  * and to incorporate it, in whole or in part, into other software,
8  * is hereby granted without fee, provided that
9  *   (1) the above copyright notice and this permission notice appear in
10  *       all copies of the source code, and the above copyright notice
11  *       appear in clearly visible form on all supporting documentation
12  *       and distribution media;
13  *   (2) modified versions of this software be accompanied by a complete
14  *       change history describing author, date, and modifications made;
15  *       and
16  *   (3) any redistribution of the software, in original or modified
17  *       form, be without fee and subject to these same conditions.
18  * --------------------------------------------------------------------- */
19
20 #include <stdlib.h>
21 #include <stdio.h>
22 #include <limits.h>
23 #include "symbol.h"
24 #include "matrix.h"
25
26 /* -----------------------------------------------------------------------------
27  * Data structures associated with parsed data
28  * -------------------------------------------------------------------------- */
29
30 /* -----------------------------------------------------------------------------
31  * Cost attributes
32  * -------------------------------------------------------------------------- */
33
34 #ifndef _CGPROF_H_
35 #define _CGPROF_H_
36
37 typedef struct {
38   double   proc_comp;
39   double   proc_comm;
40   double   proc_comp_idle;
41   long int proc_hrel_in;
42   long int proc_hrel_out;
43 } object_cost_proc;
44
45 typedef struct {
46   double   comp_max,      comp_avg,      comp_min;
47   double   comm_max,      comm_avg,      comm_min;
48   double   comp_idle_max, comp_idle_avg, comp_idle_min;
49   long int hrel_max,      hrel_avg,      hrel_min;
50   object_cost_proc *proc;
51   int    syncs;
52 } object_cost;
53
54 /* -----------------------------------------------------------------------------
55  * Sequence of cost centres
56  * -------------------------------------------------------------------------- */
57
58 typedef struct {
59   object_cost  cost;
60   name_id     *stack;
61   int          stack_size;
62   int          active;
63 } parsed_cost_object;
64
65 #define RAW_PROFILE_INIT_SIZE 100
66 extern int                 raw_profile_next;
67 extern int                 raw_profile_size;
68 extern parsed_cost_object *raw_profile;
69
70 /* -----------------------------------------------------------------------------
71  * Misc.
72  * -------------------------------------------------------------------------- */
73
74 extern int   Verbose;
75 extern char *Pgm;
76 extern void readRawProfile(FILE *,int*,int);
77 extern void printRawProfile();
78 extern void add_costs(object_cost *,object_cost);
79 extern void createConnectivityMatrix(int,Matrix *,Matrix *,int *,int);
80 extern void printConnectivityMatrix(Matrix,Matrix,int);
81 extern FILE* logFile;
82 #endif