diff options
author | Alex Rønne Petersen <alexrp@xamarin.com> | 2016-09-14 22:26:51 +0300 |
---|---|---|
committer | Alex Rønne Petersen <alexrp@xamarin.com> | 2016-10-02 19:56:27 +0300 |
commit | 61d6684f2782f9ceb61e7ee639cd15c3d2cea1ed (patch) | |
tree | 1666a416740a0e43550a4198f0333cbb46985193 | |
parent | cf076ebd1dfc8aa912eb3199ef7c8d9eda0b1876 (diff) |
[profiler] Add a nocounters option.
-rw-r--r-- | man/mprof-report.1 | 9 | ||||
-rw-r--r-- | mono/profiler/mono-profiler-log.c | 16 |
2 files changed, 14 insertions, 11 deletions
diff --git a/man/mprof-report.1 b/man/mprof-report.1 index 168759897a9..f19a02aa14e 100644 --- a/man/mprof-report.1 +++ b/man/mprof-report.1 @@ -209,13 +209,8 @@ The following commands are available: \f[I]heapshot\f[]: perform a heapshot as soon as possible .RE .IP \[bu] 2 -\f[I]counters\f[]: sample counters values every 1 second. This allow -a really lightweight way to have insight in some of the runtime key -metrics. Counters displayed in non verbose mode are : Methods from AOT, -Methods JITted using mono JIT, Methods JITted using LLVM, Total time -spent JITting (sec), User Time, System Time, Total Time, Working Set, -Private Bytes, Virtual Bytes, Page Faults and CPU Load Average (1min, -5min and 15min). +\f[I]nocounters\f[]: disables sampling of runtime and performance +counters, which is normally done every 1 second. .IP \[bu] 2 \f[I]coverage\f[]: collect code coverage data. This implies enabling the \f[I]calls\f[] option. diff --git a/mono/profiler/mono-profiler-log.c b/mono/profiler/mono-profiler-log.c index 5b901e28754..a9b8b342f83 100644 --- a/mono/profiler/mono-profiler-log.c +++ b/mono/profiler/mono-profiler-log.c @@ -66,6 +66,7 @@ static volatile gint32 runtime_inited; static volatile gint32 in_shutdown; +static gboolean no_counters; static int nocalls = 0; static int notraces = 0; static int use_zip = 0; @@ -77,7 +78,6 @@ static int heapshot_requested = 0; static int sample_freq = 0; static int do_mono_sample = 0; static int do_debug = 0; -static int do_counters = 0; static int do_coverage = 0; static gboolean debug_coverage = FALSE; static MonoProfileSamplingMode sampling_mode = MONO_PROFILER_STAT_MODE_PROCESS; @@ -3870,7 +3870,8 @@ log_shutdown (MonoProfiler *prof) { InterlockedWrite (&in_shutdown, 1); - counters_and_perfcounters_sample (prof); + if (!no_counters) + counters_and_perfcounters_sample (prof); dump_coverage (prof); @@ -4093,7 +4094,8 @@ helper_thread (void *arg) exit (1); } - counters_and_perfcounters_sample (prof); + if (!no_counters) + counters_and_perfcounters_sample (prof); buffer_lock_excl (); @@ -4824,7 +4826,12 @@ mono_profiler_startup (const char *desc) events &= ~MONO_PROFILE_GC_MOVES; continue; } + if ((opt = match_option (p, "nocounters", NULL)) != p) { + no_counters = TRUE; + continue; + } if ((opt = match_option (p, "time", &val)) != p) { + // For backwards compatibility. if (strcmp (val, "fast") && strcmp (val, "null")) usage (1); g_free (val); @@ -4901,7 +4908,7 @@ mono_profiler_startup (const char *desc) continue; } if ((opt = match_option (p, "counters", NULL)) != p) { - do_counters = 1; + // For backwards compatibility. continue; } if ((opt = match_option (p, "coverage", NULL)) != p) { @@ -4968,6 +4975,7 @@ mono_profiler_startup (const char *desc) exit (1); } + no_counters = TRUE; events = MONO_PROFILE_GC | MONO_PROFILE_THREADS | MONO_PROFILE_ENTER_LEAVE | MONO_PROFILE_INS_COVERAGE; } |