提交 f828cadd 编写于 作者: M mircea 提交者: Massi

lock tracing

git-svn-id: svn://svn.hq.unity3d.com/home/svn/unity-extra/Mono/consoles@52581 16e7374d-a1f6-0310-9a7a-f1d2bd8b5927
上级 e6a2dc72
......@@ -61,9 +61,13 @@ mono_locks_tracer_init (void)
{
char *name;
InitializeCriticalSection (&tracer_lock);
#ifdef SN_TARGET_PS3
name = g_strdup_printf ("/app_home/locks.%d", getpid ());
#else
name = g_strdup_printf ("locks.%d", getpid ());
if (!getenv ("MONO_ENABLE_LOCK_TRACER"))
return;
name = g_strdup_printf ("locks.%d", getpid ());
#endif
trace_file = fopen (name, "w+");
g_free (name);
}
......@@ -92,8 +96,13 @@ add_record (RecordType record_kind, RuntimeLocks kind, gpointer lock)
{
gpointer frames[10];
char *msg;
if (!trace_file)
if (!trace_file) {
#ifdef SN_TARGET_PS3
return mono_locks_tracer_init();
#else
return;
#endif
}
memset (frames, 0, sizeof (gpointer));
mono_backtrace (frames, 6);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册