Files for tracing machine Events as well and a common header file for all projector...
authorSayantan Chakravorty <sayantan_chak@yahoo.com>
Sun, 22 Dec 2002 14:05:05 +0000 (14:05 +0000)
committerSayantan Chakravorty <sayantan_chak@yahoo.com>
Sun, 22 Dec 2002 14:05:05 +0000 (14:05 +0000)
src/conv-perf/allEvents.h [new file with mode: 0644]
src/conv-perf/machineEvents.h [new file with mode: 0644]
src/conv-perf/machineProjections.C [new file with mode: 0644]
src/conv-perf/machineProjections.h [new file with mode: 0644]

diff --git a/src/conv-perf/allEvents.h b/src/conv-perf/allEvents.h
new file mode 100644 (file)
index 0000000..e06d64c
--- /dev/null
@@ -0,0 +1,20 @@
+/**** Header that contains the event headers of different laguages .
+ * Used in trace-projector.h in ck-perf
+ * *****/
+#ifndef _ALL_EVENTS_H
+#define _ALL_EVENTS_H
+
+#include "charmEvents.h"
+#include "converseEvents.h"
+#include "machineEvents.h"
+#include "charmProjections.h"
+#include "converseProjections.h"
+#include "machineProjections.h"
+#include "traceCoreAPI.h"     
+#include "traceCore.h"
+#include "charmEvents.h"
+#include "converseEvents.h"
+#include "machineEvents.h"
+#include "threadEvents.h"
+#include "traceCoreCommon.h"
+#endif
diff --git a/src/conv-perf/machineEvents.h b/src/conv-perf/machineEvents.h
new file mode 100644 (file)
index 0000000..6075d86
--- /dev/null
@@ -0,0 +1,34 @@
+/**
+       Defines events for the basic machine language .....
+       proc idle and busy type of events
+
+**/
+
+#ifndef __MACHINE_EVENTS_H__
+#define __MACHINE_EVENTS_H__
+
+#include "machineProjections.h"
+#include "traceCoreAPI.h"
+
+
+
+#define _MACHINE_LANG_ID       3       // language ID for machine
+
+
+#define _E_PROC_IDLE           6       // Processor goes idle
+#define _E_PROC_BUSY           7       // Processor goes busy
+
+
+#define REGISTER_MACHINE \
+       { RegisterLanguage(_MACHINE_LANG_ID, "machine\0"); \
+               RegisterEvent(_MACHINE_LANG_ID, _E_PROC_IDLE    ); \
+               RegisterEvent(_MACHINE_LANG_ID, _E_PROC_BUSY    ); \
+               \
+       }
+
+#define _LOG_E_PROC_IDLE() \
+       { machine_procIdle(); }
+#define _LOG_E_PROC_BUSY() \
+       { machine_procBusy(); }
+#endif
+
diff --git a/src/conv-perf/machineProjections.C b/src/conv-perf/machineProjections.C
new file mode 100644 (file)
index 0000000..00ba816
--- /dev/null
@@ -0,0 +1,22 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "converse.h"
+#include "machineEvents.h"
+#include "traceCoreCommon.h"
+#include "machineProjections.h"
+
+
+extern "C" void machine_procIdle()
+{
+       int* iData = (int*)malloc(sizeof(int));
+       iData[0] = CmiMyPe();
+       LogEvent1(_MACHINE_LANG_ID, _E_PROC_IDLE, 1, iData);
+}
+
+extern "C" void machine_procBusy()
+{
+       int* iData = (int*)malloc(sizeof(int));
+       iData[0] = CmiMyPe();
+       LogEvent1(_MACHINE_LANG_ID, _E_PROC_BUSY, 1, iData);
+}
+
diff --git a/src/conv-perf/machineProjections.h b/src/conv-perf/machineProjections.h
new file mode 100644 (file)
index 0000000..0b88380
--- /dev/null
@@ -0,0 +1,17 @@
+
+#ifndef __MACHINE_PROJECTIONS_H__
+#define __MACHINE_PROJECTIONS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+void machine_procIdle();
+void machine_procBusy();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif