summaryrefslogtreecommitdiff
path: root/includes/rts/Flags.h
diff options
context:
space:
mode:
authordmp@rice.edu <unknown>2010-06-22 19:59:53 +0000
committerdmp@rice.edu <unknown>2010-06-22 19:59:53 +0000
commitd4942f78fc3cce355d340b7bba0b42e4123103fa (patch)
tree2913764572587c71822d04d74bead2aec3c86a9b /includes/rts/Flags.h
parentcec00a4113d5b3079308b11f5e257c25908f9b37 (diff)
downloadhaskell-d4942f78fc3cce355d340b7bba0b42e4123103fa.tar.gz
Add support for collecting PAPI native events
This patch extends the PAPI support in the RTS to allow collection of native events. PAPI can collect data for native events that are exposed by the hardware beyond the PAPI present events. The native events supported on your hardware can found by using the papi_native_avail tool. The RTS already allows users to specify PAPI preset events from the command line. This patch extends that support to allow users to specify native events. The changes needed are: 1) New option (#) for the RTS PAPI flag for native events. For example, to collect the native event 0x40000000, use ./a.out +RTS -a#0x40000000 -sstderr 2) Update the PAPI_FLAGS struct to store whether the user specified event is a papi preset or a native event 3) Update init_countable_events function to add the native events after parsing the event code and decoding the name using PAPI_event_code_to_name
Diffstat (limited to 'includes/rts/Flags.h')
-rw-r--r--includes/rts/Flags.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/includes/rts/Flags.h b/includes/rts/Flags.h
index b86146148b..8bfadaa0cd 100644
--- a/includes/rts/Flags.h
+++ b/includes/rts/Flags.h
@@ -173,6 +173,8 @@ struct PAPI_FLAGS {
nat eventType; /* The type of events to count */
nat numUserEvents;
char * userEvents[MAX_PAPI_USER_EVENTS];
+ /* Allow user to enter either PAPI preset or native events */
+ nat userEventsKind[MAX_PAPI_USER_EVENTS];
};
#define PAPI_FLAG_CACHE_L1 1
@@ -181,6 +183,8 @@ struct PAPI_FLAGS {
#define PAPI_FLAG_STALLS 4
#define PAPI_FLAG_CB_EVENTS 5
#define PAPI_USER_EVENTS 6
+#define PAPI_PRESET_EVENT_KIND 0
+#define PAPI_NATIVE_EVENT_KIND 1
#endif