projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[profiler] log profiler: limit method instrumentation to selected methods (#5517)
[mono.git]
/
mono
/
profiler
/
log.c
diff --git
a/mono/profiler/log.c
b/mono/profiler/log.c
index 274e1a50fa6fa8a32fd6a2e186d3722e3295574d..8a677c2720d48bba530592351a5f6283d87f970b 100644
(file)
--- a/
mono/profiler/log.c
+++ b/
mono/profiler/log.c
@@
-1142,7
+1142,7
@@
sync_point_mark (MonoProfilerSyncPointType type)
ENTER_LOG (&sync_points_ctr, logbuffer,
EVENT_SIZE /* event */ +
ENTER_LOG (&sync_points_ctr, logbuffer,
EVENT_SIZE /* event */ +
-
LEB128
_SIZE /* type */
+
BYTE
_SIZE /* type */
);
emit_event (logbuffer, TYPE_META | TYPE_SYNC_POINT);
);
emit_event (logbuffer, TYPE_META | TYPE_SYNC_POINT);
@@
-1816,6
+1816,10
@@
method_exc_leave (MonoProfiler *prof, MonoMethod *method, MonoObject *exc)
static MonoProfilerCallInstrumentationFlags
method_filter (MonoProfiler *prof, MonoMethod *method)
{
static MonoProfilerCallInstrumentationFlags
method_filter (MonoProfiler *prof, MonoMethod *method)
{
+ if (log_config.callspec.len > 0 &&
+ !mono_callspec_eval (method, &log_config.callspec))
+ return MONO_PROFILER_CALL_INSTRUMENTATION_NONE;
+
return MONO_PROFILER_CALL_INSTRUMENTATION_ENTER |
MONO_PROFILER_CALL_INSTRUMENTATION_LEAVE |
MONO_PROFILER_CALL_INSTRUMENTATION_TAIL_CALL |
return MONO_PROFILER_CALL_INSTRUMENTATION_ENTER |
MONO_PROFILER_CALL_INSTRUMENTATION_LEAVE |
MONO_PROFILER_CALL_INSTRUMENTATION_TAIL_CALL |
@@
-1905,7
+1909,8
@@
clause_exc (MonoProfiler *prof, MonoMethod *method, uint32_t clause_num, MonoExc
EVENT_SIZE /* event */ +
BYTE_SIZE /* clause type */ +
LEB128_SIZE /* clause num */ +
EVENT_SIZE /* event */ +
BYTE_SIZE /* clause type */ +
LEB128_SIZE /* clause num */ +
- LEB128_SIZE /* method */
+ LEB128_SIZE /* method */ +
+ LEB128_SIZE /* exc */
);
emit_event (logbuffer, TYPE_EXCEPTION | TYPE_CLAUSE);
);
emit_event (logbuffer, TYPE_EXCEPTION | TYPE_CLAUSE);
@@
-2268,7
+2273,7
@@
dump_ubin (const char *filename, uintptr_t load_addr, uint64_t offset, uintptr_t
LEB128_SIZE /* load address */ +
LEB128_SIZE /* offset */ +
LEB128_SIZE /* size */ +
LEB128_SIZE /* load address */ +
LEB128_SIZE /* offset */ +
LEB128_SIZE /* size */ +
-
n
len /* file name */
+ len /* file name */
);
emit_event (logbuffer, TYPE_SAMPLE | TYPE_SAMPLE_UBIN);
);
emit_event (logbuffer, TYPE_SAMPLE | TYPE_SAMPLE_UBIN);
@@
-2671,6
+2676,12
@@
counters_sample (uint64_t timestamp)
;
for (agent = log_profiler.counters; agent; agent = agent->next) {
;
for (agent = log_profiler.counters; agent; agent = agent->next) {
+ /*
+ * FIXME: This calculation is incorrect for string counters since
+ * mono_counter_get_size () just returns 0 in that case. We should
+ * address this if we ever actually add any string counters to Mono.
+ */
+
size +=
LEB128_SIZE /* index */ +
BYTE_SIZE /* type */ +
size +=
LEB128_SIZE /* index */ +
BYTE_SIZE /* type */ +