projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1949 from lewurm/fixtype
[mono.git]
/
mono
/
metadata
/
lock-tracer.c
diff --git
a/mono/metadata/lock-tracer.c
b/mono/metadata/lock-tracer.c
index 0f04817ced9d077f54b828f963f7947fd2da0a96..e0e6ac96a61053d69735feb81d1cbb5e378e5041 100644
(file)
--- a/
mono/metadata/lock-tracer.c
+++ b/
mono/metadata/lock-tracer.c
@@
-31,8
+31,8
@@
*
* To log more kind of locks just do the following:
* - add an entry into the RuntimeLocks enum
*
* To log more kind of locks just do the following:
* - add an entry into the RuntimeLocks enum
- * - change
EnterCriticalSection
(mutex) to mono_locks_acquire (mutex, LockName)
- * - change
LeaveCriticalSection
to mono_locks_release (mutex, LockName)
+ * - change
mono_mutex_lock
(mutex) to mono_locks_acquire (mutex, LockName)
+ * - change
mono_mutex_unlock
to mono_locks_release (mutex, LockName)
* - change the decoder to understand the new lock kind.
*
* TODO:
* - change the decoder to understand the new lock kind.
*
* TODO:
@@
-54,7
+54,7
@@
#endif
static FILE *trace_file;
#endif
static FILE *trace_file;
-static
CRITICAL_SECTION
tracer_lock;
+static
mono_mutex_t
tracer_lock;
static size_t base_address;
typedef enum {
static size_t base_address;
typedef enum {
@@
-71,7
+71,7
@@
mono_locks_tracer_init (void)
Dl_info info;
int res;
char *name;
Dl_info info;
int res;
char *name;
-
InitializeCriticalSection
(&tracer_lock);
+
mono_mutex_init_recursive
(&tracer_lock);
if (!g_getenv ("MONO_ENABLE_LOCK_TRACER"))
return;
name = g_strdup_printf ("locks.%d", getpid ());
if (!g_getenv ("MONO_ENABLE_LOCK_TRACER"))
return;
name = g_strdup_printf ("locks.%d", getpid ());
@@
-109,14
+109,16
@@
static void
add_record (RecordType record_kind, RuntimeLocks kind, gpointer lock)
{
int i = 0;
add_record (RecordType record_kind, RuntimeLocks kind, gpointer lock)
{
int i = 0;
- gpointer frames[10];
+ const int no_frames = 6;
+ gpointer frames[no_frames];
+
char *msg;
if (!trace_file)
return;
char *msg;
if (!trace_file)
return;
- memset (frames, 0, sizeof (gpointer));
- mono_backtrace (frames,
6
);
- for (i = 0; i <
6
; ++i)
+ memset (frames, 0, sizeof (gpointer)
* no_frames
);
+ mono_backtrace (frames,
no_frames
);
+ for (i = 0; i <
no_frames
; ++i)
frames [i] = (gpointer)((size_t)frames[i] - base_address);
/*We only dump 5 frames, which should be more than enough to most analysis.*/
frames [i] = (gpointer)((size_t)frames[i] - base_address);
/*We only dump 5 frames, which should be more than enough to most analysis.*/