1 #ifndef _visualization_h
2 #define _visualization_h
4 * Copyright (c) 1993, 1994 Barton P. Miller, Jeff Hollingsworth,
5 * Bruce Irvin, Jon Cargille, Krishna Kunchithapadam, Karen
6 * Karavanic, Tia Newhall, Mark Callaghan. All rights reserved.
8 * This software is furnished under the condition that it may not be
9 * provided or otherwise made available to, or used by, any other
10 * person, except as provided for by the terms of applicable license
11 * agreements. No title to or ownership of the software is hereby
12 * transferred. The name of the principals may not be used in any
13 * advertising or publicity related to this software without specific,
14 * written prior authorization. Any use of this software must include
15 * the above copyright notice.
19 /* $Log: visualization.h,v $
20 /* Revision 1.5 1994/05/23 20:55:21 newhall
21 /* To visi_GridCellHisto class: added deleted flag, SumValue
22 /* method function, and fixed AggregateValue method function
24 * Revision 1.4 1994/05/11 17:11:10 newhall
25 * changed data values from double to float
27 * Revision 1.3 1994/04/13 21:23:15 newhall
28 * added routines: GetMetsRes, StopMetRes, NamePhase
30 * Revision 1.2 1994/03/17 05:13:41 newhall
31 * change callback type
33 * Revision 1.1 1994/03/14 20:27:33 newhall
34 * changed visi subdirectory structure
36 /////////////////////////////////////////////////////////
37 // This file should be included in all visualizations.
38 // It contains definitions for all the Paradyn visi
39 // interface routines.
40 /////////////////////////////////////////////////////////
44 #include "visiTypes.h"
46 #define FILETABLESIZE 64
47 #define EVENTSIZE FOLD+1
50 // global variables assoc. with histo datagrid
51 // dataGrid: use visi_DataGrid method functions to access current
52 // data values and information about metrics and resources
53 // metricList, resourceList: use visi_MRList method functions to
54 // access current metric and resource lists (changes to this
55 // list do not affect the datagrid) primarly, these are used
56 // to obtain and modify the parameters to GetMetsRes()
58 extern visi_DataGrid dataGrid;
59 extern visi_MRList metricList;
60 extern visi_MRList resourceList;
61 extern int lastBucketSent;
64 // file descriptor array: 1st file desc. is assoc. w/ Paradyn
65 // remaining file descriptors are assigned by user when user
66 // uses main routine provided by Paradyn
68 extern int fileDesc[FILETABLESIZE];
71 // array of callback routines assoc. with file descriptors when
72 // user uses main routine provided by Paradyn
74 extern int (*fileDescCallbacks[FILETABLESIZE])();
77 // array of procedure pointers for callback routines assoc.
78 // with paradyn events (ex. DATAVALUES,INVALIDMETRICSRESOURCES...)
79 // events types are defined in visiTypes.h
81 extern int (*eventCallbacks[EVENTSIZE])(int);
84 // callback associated with paradyn-visualization interface routines
86 extern int visi_callback();
88 /////////////////////////////////////////////////////////////
89 // these functions invoke upcalls to a visi interface client
90 // (call from visualization process to paradyn)
91 /////////////////////////////////////////////////////////////
93 // get a new set of metrics and resources from Paradyn
95 extern void GetMetsRes(char *metrics, // list of current metrics
96 char *resource, // list of current resources
97 int type); // 0-histogram, 1-scalar
100 // stop data collection for a metric/resource pair
101 // arguments are the datagrid indicies associated with the
102 // metric and resource to stop
104 extern void StopMetRes(int metricIndex, // datagrid index of metric
105 int resourceIndex); // datagrid index of resource
108 // define a new phase to paradyn
110 extern void NamePhase(timeType begin, // start of phase in seconds
111 timeType end, // end of phase in seconds
112 char *name); // name of phase
115 ////////////////////////////////////////////////////////////////
116 // initialization routines
117 ////////////////////////////////////////////////////////////////
119 // connects to parent socket and registers the mainLoop routine
120 // as a callback on events on fileDesc[0]
121 // This routine should be called before entering the visualization's
122 // main loop, and before calling any other visi-interface routines
124 extern int VisiInit();
129 // Makes initial call to get Metrics and Resources.
130 // For visualizations that do not provide an event that
131 // invokes the GetMetsRes upcall this routine should be
132 // called by the visualization before entrering the mainloop.
133 // (this will be the only chance to get metrics and resources
134 // for the visualization).
135 // For other visualizaitons, calling this routine before
136 // entering the mainloop is optional.
138 extern int StartVisi(int argc,char *argv[]);
141 // registration callback routine for paradyn events
142 // sets eventCallbacks[event] to callback routine provided by user
144 extern int RegistrationCallback(msgTag event,int (*callBack)(int));
147 // main loop provided by paradyn (not currently supported)
149 extern void ParadynMain();
152 // fd registration and callback routine registration for user
153 // to register callback routines when they use the provided main routine
155 extern int RegFileDescriptors(int *fd, int (*callBack)());