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.14 1995/12/20 18:35:02 newhall
21 /* including matherr.h so that it does not need to be included by visis
23 * Revision 1.13 1995/12/18 17:22:02 naim
24 * Adding function showErrorVisiCallback to display error messages from
27 * Revision 1.12 1995/12/15 20:15:12 naim
28 * Adding call back function to display error messages from visis - naim
30 * Revision 1.11 1995/09/18 18:26:00 newhall
31 * updated test subdirectory, added visilib routine GetMetRes()
33 * Revision 1.10 1995/08/01 01:58:46 newhall
34 * changes relating to phase interface stuff
36 * Revision 1.9 1995/02/26 01:59:31 newhall
37 * added phase interface functions
39 * Revision 1.8 1994/10/13 15:38:52 newhall
42 * Revision 1.7 1994/09/25 01:58:16 newhall
43 * changed interface definitions to work for new version of igen
44 * changed AddMetricsResources def. to take array of metric/focus pairs
46 * Revision 1.6 1994/08/13 20:34:07 newhall
47 * removed all code associated with class visi_MRList
49 * Revision 1.5 1994/05/23 20:55:21 newhall
50 * To visi_GridCellHisto class: added deleted flag, SumValue
51 * method function, and fixed AggregateValue method function
53 * Revision 1.4 1994/05/11 17:11:10 newhall
54 * changed data values from double to float
56 * Revision 1.3 1994/04/13 21:23:15 newhall
57 * added routines: GetMetsRes, StopMetRes, NamePhase
59 * Revision 1.2 1994/03/17 05:13:41 newhall
60 * change callback type
62 * Revision 1.1 1994/03/14 20:27:33 newhall
63 * changed visi subdirectory structure
65 /////////////////////////////////////////////////////////
66 // This file should be included in all visualizations.
67 // It contains definitions for all the Paradyn visi
68 // interface routines.
69 /////////////////////////////////////////////////////////
72 #include "visiTypes.h"
73 #include "util/h/matherr.h"
75 #define FILETABLESIZE 64
76 #define EVENTSIZE FOLD+1
77 #define MAXSTRINGSIZE 16*1024
80 // global variables assoc. with histo datagrid
81 // dataGrid: use visi_DataGrid method functions to access current
82 // data values and information about metrics and resources
83 // metricList, resourceList: use visi_MRList method functions to
84 // access current metric and resource lists (changes to this
85 // list do not affect the datagrid) primarly, these are used
86 // to obtain and modify the parameters to GetMetsRes()
88 extern visi_DataGrid dataGrid;
89 extern int lastBucketSent;
92 // file descriptor array: 1st file desc. is assoc. w/ Paradyn
93 // remaining file descriptors are assigned by user when user
94 // uses main routine provided by Paradyn
96 extern int fileDesc[FILETABLESIZE];
99 // array of callback routines assoc. with file descriptors when
100 // user uses main routine provided by Paradyn
102 extern int (*fileDescCallbacks[FILETABLESIZE])();
105 // array of procedure pointers for callback routines assoc.
106 // with paradyn events (ex. DATAVALUES,INVALIDMETRICSRESOURCES...)
107 // events types are defined in visiTypes.h
109 extern int (*eventCallbacks[EVENTSIZE])(int);
112 // callback associated with paradyn-visualization interface routines
114 extern int visi_callback();
116 /////////////////////////////////////////////////////////////
117 // these functions invoke upcalls to a visi interface client
118 // (call from visualization process to paradyn)
119 /////////////////////////////////////////////////////////////
121 // get a new set of metrics and resources from Paradyn
123 extern void GetMetsRes(char *metres, // predefined list met-res pairs
125 int type); // 0-histogram, 1-scalar
128 // equivalent to a call to GetMetRes(0,0,0)
130 extern void GetMetsRes();
133 // stop data collection for a metric/resource pair
134 // arguments are the datagrid indicies associated with the
135 // metric and resource to stop
137 extern void StopMetRes(int metricIndex, // datagrid index of metric
138 int resourceIndex); // datagrid index of resource
141 // define a new phase to paradyn, can specify some time in the future
142 // for the phase to begin or a begin value of -1 means now
144 extern void DefinePhase(timeType begin, // in seconds
145 char *name); // name of phase
147 ////////////////////////////////////////////////////////////////
148 // initialization routines
149 ////////////////////////////////////////////////////////////////
151 // connects to parent socket and registers the mainLoop routine
152 // as a callback on events on fileDesc[0]
153 // This routine should be called before entering the visualization's
154 // main loop, and before calling any other visi-interface routines
156 extern int VisiInit();
161 // Makes initial call to get Metrics and Resources.
162 // For visualizations that do not provide an event that
163 // invokes the GetMetsRes upcall this routine should be
164 // called by the visualization before entrering the mainloop.
165 // (this will be the only chance to get metrics and resources
166 // for the visualization).
167 // For other visualizaitons, calling this routine before
168 // entering the mainloop is optional.
170 extern int StartVisi(int argc,char *argv[]);
173 // cleans up visi interface data structs
174 // Visualizations should call this routine before exiting
175 extern void QuitVisi();
179 // registration callback routine for paradyn events
180 // sets eventCallbacks[event] to callback routine provided by user
182 extern int RegistrationCallback(msgTag event,int (*callBack)(int));
185 // request to Paradyn to display error message
187 extern void showErrorVisiCallback(string msg);
190 // main loop provided by paradyn (not currently supported)
192 extern void ParadynMain();
195 // fd registration and callback routine registration for user
196 // to register callback routines when they use the provided main routine
198 extern int RegFileDescriptors(int *fd, int (*callBack)());