diff options
author | mrchebas@gmail.com <unknown> | 2006-11-09 07:57:46 +0000 |
---|---|---|
committer | mrchebas@gmail.com <unknown> | 2006-11-09 07:57:46 +0000 |
commit | 2b522adea22f77a1c03230f5c9865c00bedb5a5b (patch) | |
tree | 080f40d42babe0435563f37f35e494ba65e0fdd6 /rts/RtsFlags.c | |
parent | fe07f054d7ae5e10b14d5fed730fe4424dabd587 (diff) | |
download | haskell-2b522adea22f77a1c03230f5c9865c00bedb5a5b.tar.gz |
Selection of PAPI events via RTS command line
Diffstat (limited to 'rts/RtsFlags.c')
-rw-r--r-- | rts/RtsFlags.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index 7b8a4d1d68..b2bb9e79c0 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -301,6 +301,10 @@ void initRtsFlagsDefaults(void) RtsFlags.TraceFlags.timestamp = rtsFalse; RtsFlags.TraceFlags.sched = rtsFalse; + +#ifdef USE_PAPI + RtsFlags.PapiFlags.eventType = PAPI_FLAG_BRANCH; +#endif } static const char * @@ -449,6 +453,16 @@ usage_text[] = { #if defined(GRAN) /* ToDo: fill in decent Docu here */ " -b... All GranSim options start with -b; see GranSim User's Guide for details", #endif +#if defined(USE_PAPI) +" -aX Perform measurements using PAPI, it should be used with the -s<file> option.", +" Where X is one of:", +"", +/* " y - cycles", */ +" 1 - level 1 cache misses", +" 2 - level 2 cache misses", +" b - branch mispredictions", +" s - stalled cycles", +#endif "", "RTS options may also be specified using the GHCRTS environment variable.", "", @@ -647,6 +661,27 @@ error = rtsTrue; } break; +#ifdef USE_PAPI + case 'a': + switch(rts_argv[arg][2]) { + case '1': + RtsFlags.PapiFlags.eventType = PAPI_FLAG_CACHE_L1; + break; + case '2': + RtsFlags.PapiFlags.eventType = PAPI_FLAG_CACHE_L2; + break; + case 'b': + RtsFlags.PapiFlags.eventType = PAPI_FLAG_BRANCH; + break; + case 's': + RtsFlags.PapiFlags.eventType = PAPI_FLAG_STALLS; + break; + default: + bad_option( rts_argv[arg] ); + } + break; +#endif + case 'B': RtsFlags.GcFlags.ringBell = rtsTrue; break; |