From 6ffd0dd5df343a5a2584f5434fade7233712c04f Mon Sep 17 00:00:00 2001 From: hollings Date: Mon, 21 Mar 1994 20:32:41 +0000 Subject: [PATCH] Changed the mid to mi mapping to be per paradyn daemon. This is required because mids are asigned by the paradynd's, and are not globally unique. --- paradyn/h/dyninstRPC.I | 15 +++++++++------ paradyn/src/DMthread/DMinternals.h | 18 +++++++++++++++--- paradyn/src/DMthread/DMmain.C | 26 +++++++++++++++++++------- 3 files changed, 43 insertions(+), 16 deletions(-) diff --git a/paradyn/h/dyninstRPC.I b/paradyn/h/dyninstRPC.I index 16d3b88..b1e817d 100644 --- a/paradyn/h/dyninstRPC.I +++ b/paradyn/h/dyninstRPC.I @@ -75,11 +75,11 @@ $remote dynRPC { // endTimeStamp - ending time of the interval covered by this sample. // value - the value of this sample // - $upcall $async void sampleDataCallbackFunc(int program, - int mi, - double startTimeStamp, - double endTimeStamp, - double value); + $virtual $upcall $async void sampleDataCallbackFunc(int program, + int mi, + double startTimeStamp, + double endTimeStamp, + double value); // // Handler that gets called when a new resource is defined. @@ -141,6 +141,9 @@ $remote dynRPC { // // For paradynd's that may get started, but not by paradyn // This allows them to report system information - $virtual $upcall $async void reportSelf(String machine, String program, int pid); + $virtual $upcall $async void reportSelf(String machine, + String program, + int pid); + $cmember int my_pid; }; diff --git a/paradyn/src/DMthread/DMinternals.h b/paradyn/src/DMthread/DMinternals.h index 6ce8d21..f49a143 100644 --- a/paradyn/src/DMthread/DMinternals.h +++ b/paradyn/src/DMthread/DMinternals.h @@ -3,7 +3,11 @@ * Define the classes used in the implementation of the data manager. * * $Log: DMinternals.h,v $ - * Revision 1.6 1994/03/20 01:49:47 markc + * Revision 1.7 1994/03/21 20:32:47 hollings + * Changed the mid to mi mapping to be per paradyn daemon. This is required + * because mids are asigned by the paradynd's, and are not globally unique. + * + * Revision 1.6 1994/03/20 01:49:47 markc * Gave process structure a buffer to allow multiple writers. Added support * to register name of paradyn daemon. Changed addProcess to return type int. * @@ -62,6 +66,15 @@ class paradynDaemon: public dynRPCUser { // "well known" socket for new paradynd's static char **args; static List allDaemons; + + void paradynDaemon::sampleDataCallbackFunc(int program, + int mid, + double startTimeStamp, + double endTimeStamp, + double value); + + // all active metrics ids for this daemon. + HTable activeMids; }; @@ -168,12 +181,11 @@ class component { component(paradynDaemon *d, int i, metricInstance *mi) { daemon = d; id = i; - allComponents.add(mi, (void *) id); + d->activeMids.add(mi, (void *) id); } ~component() { daemon->disableDataCollection(id); } - static HTable allComponents; private: paradynDaemon *daemon; int id; diff --git a/paradyn/src/DMthread/DMmain.C b/paradyn/src/DMthread/DMmain.C index 58fcb37..9c12c7c 100644 --- a/paradyn/src/DMthread/DMmain.C +++ b/paradyn/src/DMthread/DMmain.C @@ -2,7 +2,11 @@ * DMmain.C: main loop of the Data Manager thread. * * $Log: DMmain.C,v $ - * Revision 1.8 1994/03/20 01:49:48 markc + * Revision 1.9 1994/03/21 20:32:48 hollings + * Changed the mid to mi mapping to be per paradyn daemon. This is required + * because mids are asigned by the paradynd's, and are not globally unique. + * + * Revision 1.8 1994/03/20 01:49:48 markc * Gave process structure a buffer to allow multiple writers. Added support * to register name of paradyn daemon. Changed addProcess to return type int. * @@ -49,7 +53,6 @@ double quiet_nan(int unused); static dataManager *dm; stringPool metric::names; HTable metric::allMetrics; -HTable component::allComponents; List paradynDaemon::allDaemons; metricInstance *performanceStream::enableDataCollection(resourceList *rl, @@ -195,14 +198,23 @@ void dynRPCUser::newMetricCallback(metricInfo info) } void dynRPCUser::sampleDataCallbackFunc(int program, - int mid, - double startTimeStamp, - double endTimeStamp, - double value) + int mid, + double startTimeStamp, + double endTimeStamp, + double value) +{ + assert(0 && "Invalid virtual function"); +} + +void paradynDaemon::sampleDataCallbackFunc(int program, + int mid, + double startTimeStamp, + double endTimeStamp, + double value) { metricInstance *mi; - mi = component::allComponents.find((void*) mid); + mi = activeMids.find((void*) mid); if (!mi) { printf("ERROR: data for unknown mid: %d\n", mid); exit(-1); -- 1.8.3.1