Fab Tillier
2013-02-21 01:32:46 UTC
Some of the reference count tracing logic for user-mode introduces Windows header code, which is not BSD.
This patch removes user-mode IBAL reference count tracking, but preserves kernel mode tracking.
Signed-off-by: Fab Tillier <***@microsoft.com>
diff -dwup3 -x *svn* -x makefile -x sources -r c:\dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\al\al_common.h .\core\al\al_common.h
--- c:\dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\al\al_common.h Wed Aug 01 17:16:51 2012
+++ .\core\al\al_common.h Thu Jul 26 15:31:13 2012
@@ -269,7 +269,7 @@ typedef struct _al_obj
cl_spinlock_t lock;
cl_qlist_t obj_list;
atomic32_t ref_cnt;
-#if DBG
+#if defined(CL_KERNEL) && DBG
obj_ref_trace_t ref_trace;
#endif
cl_list_item_t list_item;
diff -dwup3 -x *svn* -x makefile -x sources -r c:\dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\al\al_ref_trace.c .\core\al\al_ref_trace.c
--- c:\dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\al\al_ref_trace.c Wed Aug 01 17:16:51 2012
+++ .\core\al\al_ref_trace.c Thu May 31 12:54:12 2012
@@ -38,9 +38,66 @@
#ifdef CL_KERNEL
#include <wdm.h>
-#else
-#include "Llist.h"
-#endif
+
+typedef enum {
+ AL_DATA_NODE,
+ AL_DIRTY_CHAIN_NODE
+} al_node_type_t;
+
+
+#define REF_TRACE_MAX_ENTRIES 0x2000
+#define REF_TRACE_DB_ENTRIES 0xF0000
+
+typedef struct _ref_cnt_data
+{
+ char* file_name;
+ LONG prev_ref_val;
+ uint32_t line_num;
+ uint8_t purge_type;
+ uint16_t repeat_cnt;
+ uint8_t ref_change; //al_ref_change_type_t
+ uint8_t ref_ctx; //enum e_ref_type
+
+} ref_cnt_data_t;
+
+typedef struct _ref_cnt_dirty_list
+{
+ void* p_al_obj;
+ uint32_t type;
+ long obj_list_size;
+ LIST_ENTRY dirty_list;
+} ref_cnt_dirty_list_t;
+
+
+typedef union _ref_db_entry
+{
+ ref_cnt_data_t ref_cnt_data;
+ ref_cnt_dirty_list_t ref_dirty_list;
+
+} ref_db_entry_t;
+
+typedef struct _ref_db_node
+{
+ uint8_t type; //al_node_type_t
+ ref_db_entry_t entry;
+ LIST_ENTRY list_entry;
+} ref_db_node_t;
+
+typedef struct _ref_cnt_dbg_db
+{
+ LIST_ENTRY free_chain;
+ cl_spinlock_t free_chain_lock;
+
+ LIST_ENTRY dirty_chain;
+ cl_spinlock_t dirty_chain_lock;
+
+ ULONG policy;
+ LONG max_chain_size;
+ uint32_t max_chain_obj_type;
+ int32_t needed_size;
+ volatile long objects_num;
+ ref_db_node_t ref_cnt_db[REF_TRACE_DB_ENTRIES];
+} ref_cnt_dbg_db_t;
ref_cnt_dbg_db_t g_ref_cnt_dbg_db;
@@ -49,9 +106,12 @@ ref_cnt_dbg_db_t g_ref_cnt_dbg_db;
((ULONG_PTR)address < (ULONG_PTR)(g_ref_cnt_dbg_db.ref_cnt_db)+REF_TRACE_DB_ENTRIES*sizeof(ref_db_node_t)))
+#endif // CL_KERNEL
+
void
ref_trace_db_init(ULONG policy)
{
+#ifdef CL_KERNEL
int i = 0;
cl_memclr(&g_ref_cnt_dbg_db, sizeof(g_ref_cnt_dbg_db));
@@ -72,13 +132,16 @@ ref_trace_db_init(ULONG policy)
g_ref_cnt_dbg_db.policy = policy;
g_ref_cnt_dbg_db.needed_size = REF_TRACE_DB_ENTRIES;
-
+#else // CL_KERNEL
+ UNREFERENCED_PARAMETER(policy);
+#endif // CL_KERNEL
}
void
ref_trace_init(
IN void * const p_obj)
{
+#ifdef CL_KERNEL
al_obj_t* p_al_obj = (al_obj_t*)p_obj;
InitializeListHead(&p_al_obj->ref_trace.ref_chain);
@@ -87,6 +150,9 @@ ref_trace_init(
cl_spinlock_init( &p_al_obj->ref_trace.lock );
p_al_obj->ref_trace.list_size = 0;
+#else // CL_KERNEL
+ UNREFERENCED_PARAMETER(p_obj);
+#endif // CL_KERNEL
}
// Inserts the dest_list into the beginning of the src_list
@@ -96,7 +162,7 @@ ref_trace_insert_head_list(
PLIST_ENTRY src_list,
PLIST_ENTRY dest_list)
{
-
+#ifdef CL_KERNEL
PLIST_ENTRY src_first = src_list->Flink;
PLIST_ENTRY src_last = src_list->Blink;
PLIST_ENTRY dest_first = dest_list->Flink;
@@ -106,10 +172,15 @@ ref_trace_insert_head_list(
src_last->Flink = dest_first;
dest_first->Blink = src_last;
+#else // CL_KERNEL
+ UNREFERENCED_PARAMETER(src_list);
+ UNREFERENCED_PARAMETER(dest_list);
+#endif // CL_KERNEL
}
-PLIST_ENTRY
+#ifdef CL_KERNEL
+static PLIST_ENTRY
ref_trace_alloc_entry()
{
PLIST_ENTRY free_entry;
@@ -152,7 +223,7 @@ ref_trace_alloc_entry()
}
-PLIST_ENTRY
+static PLIST_ENTRY
ref_trace_alloc_dirty_list(
IN al_obj_t * const p_obj,
OUT ref_db_node_t** ref_node)
@@ -178,19 +249,21 @@ ref_trace_alloc_dirty_list(
return &ref_entry->dirty_list;
}
-boolean_t
+
+static boolean_t
ref_trace_is_logged_obj(
IN al_obj_t * const p_obj )
{
return (p_obj->type == AL_OBJ_TYPE_H_AL);
}
-
+#endif // CL_KERNEL
// Destroys the object's ref trace chain
void
ref_trace_destroy(
IN void * const p_obj )
{
+#ifdef CL_KERNEL
al_obj_t* p_al_obj = (al_obj_t*)p_obj;
cl_spinlock_acquire(&p_al_obj->ref_trace.lock);
@@ -231,9 +304,14 @@ ref_trace_destroy(
cl_spinlock_destroy(&p_al_obj->ref_trace.lock);
InterlockedDecrement(&g_ref_cnt_dbg_db.objects_num);
+#else // CL_KERNEL
+ UNREFERENCED_PARAMETER(p_obj);
+#endif // CL_KERNEL
}
-ref_cnt_data_t*
+
+#ifdef CL_KERNEL
+static ref_cnt_data_t*
ref_trace_get_trace_data(
IN PLIST_ENTRY list_entry)
{
@@ -247,7 +325,8 @@ ref_trace_get_trace_data(
return &ref_node->entry.ref_cnt_data;
}
-boolean_t
+
+static boolean_t
ref_trace_is_equal_entry(
IN PLIST_ENTRY first_entry,
IN PLIST_ENTRY second_entry )
@@ -261,7 +340,8 @@ ref_trace_is_equal_entry(
first_ref_data->file_name == second_ref_data->file_name);
}
-boolean_t
+
+static boolean_t
ref_trace_is_same_action_entry(
IN PLIST_ENTRY first_entry,
IN PLIST_ENTRY second_entry )
@@ -276,7 +356,7 @@ ref_trace_is_same_action_entry(
// Should be called with a lock on the purged list
-boolean_t
+static boolean_t
ref_trace_purge_ref_deref_pairs(
IN PLIST_ENTRY last_deref_entry,
IN PLIST_ENTRY list_head)
@@ -320,8 +400,9 @@ ref_trace_purge_ref_deref_pairs(
return FALSE;
}
+
// Should be called with a lock on the purged list
-boolean_t
+static boolean_t
ref_trace_purge_same_entry(
IN PLIST_ENTRY last_entry,
IN PLIST_ENTRY list_head)
@@ -355,7 +436,7 @@ ref_trace_purge_same_entry(
}
-void
+static void
ref_trace_purge(
IN PLIST_ENTRY last_entry,
IN al_obj_t * p_obj)
@@ -380,6 +461,8 @@ ref_trace_purge(
cl_spinlock_release(&p_obj->ref_trace.lock);
}
+#endif // CL_KERNEL
+
int32_t
ref_trace_insert(
@@ -390,6 +473,7 @@ ref_trace_insert(
IN uint8_t ref_ctx
)
{
+#ifdef CL_KERNEL
al_obj_t* p_al_obj = (al_obj_t*)p_obj;
PLIST_ENTRY free_entry;
ref_cnt_data_t* ref_entry;
@@ -446,6 +530,14 @@ ref_trace_insert(
}
return ((change_type == AL_REF) ? ref_al_obj_inner(p_al_obj) : deref_al_obj_inner(p_al_obj));
+#else // CL_KERNEL
+ UNREFERENCED_PARAMETER(file);
+ UNREFERENCED_PARAMETER(line);
+ UNREFERENCED_PARAMETER(p_obj);
+ UNREFERENCED_PARAMETER(change_type);
+ UNREFERENCED_PARAMETER(ref_ctx);
+ return 0;
+#endif // CL_KERNEL
}
void
@@ -453,6 +545,7 @@ ref_trace_print(
IN void * const p_obj
)
{
+#ifdef CL_KERNEL
al_obj_t* p_al_obj = (al_obj_t*)p_obj;
ref_cnt_data_t* ref_entry;
PLIST_ENTRY p_entry;
@@ -480,6 +573,9 @@ ref_trace_print(
}
cl_spinlock_release(&p_al_obj->ref_trace.lock);
+#else // CL_KERNEL
+ UNREFERENCED_PARAMETER(p_obj);
+#endif // CL_KERNEL
}
void
@@ -487,6 +583,7 @@ ref_trace_dirty_print(
IN void * const p_obj
)
{
+#ifdef CL_KERNEL
al_obj_t* p_al_obj = (al_obj_t*)p_obj;
ref_db_node_t* ref_node;
ref_cnt_dirty_list_t* ref_dirty;
@@ -529,6 +626,9 @@ ref_trace_dirty_print(
}
cl_spinlock_release( &g_ref_cnt_dbg_db.dirty_chain_lock );
+#else // CL_KERNEL
+ UNREFERENCED_PARAMETER(p_obj);
+#endif // CL_KERNEL
}
#endif
diff -dwup3 -x *svn* -x makefile -x sources -r c:\dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\al\al_ref_trace.h .\core\al\al_ref_trace.h
--- c:\dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\al\al_ref_trace.h Thu May 31 11:22:16 2012
+++ .\core\al\al_ref_trace.h Thu May 31 12:57:10 2012
@@ -47,6 +47,7 @@ typedef enum {
AL_DEREF
} al_ref_change_type_t;
+
enum e_ref_origin {
E_REF_INIT = 1,
E_REF_CA_ADD_REMOVE,
@@ -56,10 +57,6 @@ enum e_ref_origin {
E_REF_CONSTRUCT_CHILD
};
-typedef enum {
- AL_DATA_NODE,
- AL_DIRTY_CHAIN_NODE
-} al_node_type_t;
typedef enum {
EQUAL_REF_DEREF_PAIRS = 1 << 0,
@@ -67,68 +64,14 @@ typedef enum {
} purge_policy_flags_t;
-#define REF_TRACE_MAX_ENTRIES 0x2000
-#define REF_TRACE_DB_ENTRIES 0xF0000
-
-typedef struct _ref_cnt_data
-{
- LONG prev_ref_val;
- uint32_t line_num;
- uint8_t purge_type;
- uint16_t repeat_cnt;
- uint8_t ref_change; //al_ref_change_type_t
- uint8_t ref_ctx; //enum e_ref_type
- char* file_name;
-
-} ref_cnt_data_t;
-
-typedef struct _ref_cnt_dirty_list
-{
- void* p_al_obj;
- uint32_t type;
- long obj_list_size;
- LIST_ENTRY dirty_list;
-} ref_cnt_dirty_list_t;
-
-
-typedef union _ref_db_entry
-{
- ref_cnt_data_t ref_cnt_data;
- ref_cnt_dirty_list_t ref_dirty_list;
-
-} ref_db_entry_t;
-
-typedef struct _ref_db_node
-{
- uint8_t type; //al_node_type_t
- ref_db_entry_t entry;
- LIST_ENTRY list_entry;
-} ref_db_node_t;
-
-typedef struct _ref_cnt_dbg_db
-{
- LIST_ENTRY free_chain;
- cl_spinlock_t free_chain_lock;
-
- LIST_ENTRY dirty_chain;
- cl_spinlock_t dirty_chain_lock;
-
- ULONG policy;
- LONG max_chain_size;
- uint32_t max_chain_obj_type;
- int32_t needed_size;
- volatile long objects_num;
- ref_db_node_t ref_cnt_db[REF_TRACE_DB_ENTRIES];
-} ref_cnt_dbg_db_t;
-
-
+#ifdef CL_KERNEL
typedef struct _obj_ref_trace
{
LIST_ENTRY ref_chain;
cl_spinlock_t lock;
volatile long list_size;
} obj_ref_trace_t;
-
+#endif
void
ref_trace_db_init(ULONG policy);
Index: inc/user/LLIST.H
===================================================================
--- inc/user/LLIST.H (revision 3427)
+++ inc/user/LLIST.H (working copy)
@@ -1,474 +0,0 @@
-/*++
-
- This source code may incorporate intellectual property owned by
- Microsoft Corporation. Our provision of this source code does not
- include any licenses or any other rights to you under any Microsoft
- intellectual property. If you would like a license from Microsoft
- (e.g., to rebrand, redistribute), you need to contact Microsoft
- directly.
-
-Module Name:
-
- llist.h
-
-Abstract:
-
- This module is a standalone collection of linked-list definition and
- manipulation macros originally defined within the Windows NT
- development.
-
---*/
-
-#ifndef _LLIST_
-#define _LLIST_
-#include <winsock2.h>
-
-
-
-#if !defined( _WINNT_ )
-//
This patch removes user-mode IBAL reference count tracking, but preserves kernel mode tracking.
Signed-off-by: Fab Tillier <***@microsoft.com>
diff -dwup3 -x *svn* -x makefile -x sources -r c:\dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\al\al_common.h .\core\al\al_common.h
--- c:\dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\al\al_common.h Wed Aug 01 17:16:51 2012
+++ .\core\al\al_common.h Thu Jul 26 15:31:13 2012
@@ -269,7 +269,7 @@ typedef struct _al_obj
cl_spinlock_t lock;
cl_qlist_t obj_list;
atomic32_t ref_cnt;
-#if DBG
+#if defined(CL_KERNEL) && DBG
obj_ref_trace_t ref_trace;
#endif
cl_list_item_t list_item;
diff -dwup3 -x *svn* -x makefile -x sources -r c:\dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\al\al_ref_trace.c .\core\al\al_ref_trace.c
--- c:\dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\al\al_ref_trace.c Wed Aug 01 17:16:51 2012
+++ .\core\al\al_ref_trace.c Thu May 31 12:54:12 2012
@@ -38,9 +38,66 @@
#ifdef CL_KERNEL
#include <wdm.h>
-#else
-#include "Llist.h"
-#endif
+
+typedef enum {
+ AL_DATA_NODE,
+ AL_DIRTY_CHAIN_NODE
+} al_node_type_t;
+
+
+#define REF_TRACE_MAX_ENTRIES 0x2000
+#define REF_TRACE_DB_ENTRIES 0xF0000
+
+typedef struct _ref_cnt_data
+{
+ char* file_name;
+ LONG prev_ref_val;
+ uint32_t line_num;
+ uint8_t purge_type;
+ uint16_t repeat_cnt;
+ uint8_t ref_change; //al_ref_change_type_t
+ uint8_t ref_ctx; //enum e_ref_type
+
+} ref_cnt_data_t;
+
+typedef struct _ref_cnt_dirty_list
+{
+ void* p_al_obj;
+ uint32_t type;
+ long obj_list_size;
+ LIST_ENTRY dirty_list;
+} ref_cnt_dirty_list_t;
+
+
+typedef union _ref_db_entry
+{
+ ref_cnt_data_t ref_cnt_data;
+ ref_cnt_dirty_list_t ref_dirty_list;
+
+} ref_db_entry_t;
+
+typedef struct _ref_db_node
+{
+ uint8_t type; //al_node_type_t
+ ref_db_entry_t entry;
+ LIST_ENTRY list_entry;
+} ref_db_node_t;
+
+typedef struct _ref_cnt_dbg_db
+{
+ LIST_ENTRY free_chain;
+ cl_spinlock_t free_chain_lock;
+
+ LIST_ENTRY dirty_chain;
+ cl_spinlock_t dirty_chain_lock;
+
+ ULONG policy;
+ LONG max_chain_size;
+ uint32_t max_chain_obj_type;
+ int32_t needed_size;
+ volatile long objects_num;
+ ref_db_node_t ref_cnt_db[REF_TRACE_DB_ENTRIES];
+} ref_cnt_dbg_db_t;
ref_cnt_dbg_db_t g_ref_cnt_dbg_db;
@@ -49,9 +106,12 @@ ref_cnt_dbg_db_t g_ref_cnt_dbg_db;
((ULONG_PTR)address < (ULONG_PTR)(g_ref_cnt_dbg_db.ref_cnt_db)+REF_TRACE_DB_ENTRIES*sizeof(ref_db_node_t)))
+#endif // CL_KERNEL
+
void
ref_trace_db_init(ULONG policy)
{
+#ifdef CL_KERNEL
int i = 0;
cl_memclr(&g_ref_cnt_dbg_db, sizeof(g_ref_cnt_dbg_db));
@@ -72,13 +132,16 @@ ref_trace_db_init(ULONG policy)
g_ref_cnt_dbg_db.policy = policy;
g_ref_cnt_dbg_db.needed_size = REF_TRACE_DB_ENTRIES;
-
+#else // CL_KERNEL
+ UNREFERENCED_PARAMETER(policy);
+#endif // CL_KERNEL
}
void
ref_trace_init(
IN void * const p_obj)
{
+#ifdef CL_KERNEL
al_obj_t* p_al_obj = (al_obj_t*)p_obj;
InitializeListHead(&p_al_obj->ref_trace.ref_chain);
@@ -87,6 +150,9 @@ ref_trace_init(
cl_spinlock_init( &p_al_obj->ref_trace.lock );
p_al_obj->ref_trace.list_size = 0;
+#else // CL_KERNEL
+ UNREFERENCED_PARAMETER(p_obj);
+#endif // CL_KERNEL
}
// Inserts the dest_list into the beginning of the src_list
@@ -96,7 +162,7 @@ ref_trace_insert_head_list(
PLIST_ENTRY src_list,
PLIST_ENTRY dest_list)
{
-
+#ifdef CL_KERNEL
PLIST_ENTRY src_first = src_list->Flink;
PLIST_ENTRY src_last = src_list->Blink;
PLIST_ENTRY dest_first = dest_list->Flink;
@@ -106,10 +172,15 @@ ref_trace_insert_head_list(
src_last->Flink = dest_first;
dest_first->Blink = src_last;
+#else // CL_KERNEL
+ UNREFERENCED_PARAMETER(src_list);
+ UNREFERENCED_PARAMETER(dest_list);
+#endif // CL_KERNEL
}
-PLIST_ENTRY
+#ifdef CL_KERNEL
+static PLIST_ENTRY
ref_trace_alloc_entry()
{
PLIST_ENTRY free_entry;
@@ -152,7 +223,7 @@ ref_trace_alloc_entry()
}
-PLIST_ENTRY
+static PLIST_ENTRY
ref_trace_alloc_dirty_list(
IN al_obj_t * const p_obj,
OUT ref_db_node_t** ref_node)
@@ -178,19 +249,21 @@ ref_trace_alloc_dirty_list(
return &ref_entry->dirty_list;
}
-boolean_t
+
+static boolean_t
ref_trace_is_logged_obj(
IN al_obj_t * const p_obj )
{
return (p_obj->type == AL_OBJ_TYPE_H_AL);
}
-
+#endif // CL_KERNEL
// Destroys the object's ref trace chain
void
ref_trace_destroy(
IN void * const p_obj )
{
+#ifdef CL_KERNEL
al_obj_t* p_al_obj = (al_obj_t*)p_obj;
cl_spinlock_acquire(&p_al_obj->ref_trace.lock);
@@ -231,9 +304,14 @@ ref_trace_destroy(
cl_spinlock_destroy(&p_al_obj->ref_trace.lock);
InterlockedDecrement(&g_ref_cnt_dbg_db.objects_num);
+#else // CL_KERNEL
+ UNREFERENCED_PARAMETER(p_obj);
+#endif // CL_KERNEL
}
-ref_cnt_data_t*
+
+#ifdef CL_KERNEL
+static ref_cnt_data_t*
ref_trace_get_trace_data(
IN PLIST_ENTRY list_entry)
{
@@ -247,7 +325,8 @@ ref_trace_get_trace_data(
return &ref_node->entry.ref_cnt_data;
}
-boolean_t
+
+static boolean_t
ref_trace_is_equal_entry(
IN PLIST_ENTRY first_entry,
IN PLIST_ENTRY second_entry )
@@ -261,7 +340,8 @@ ref_trace_is_equal_entry(
first_ref_data->file_name == second_ref_data->file_name);
}
-boolean_t
+
+static boolean_t
ref_trace_is_same_action_entry(
IN PLIST_ENTRY first_entry,
IN PLIST_ENTRY second_entry )
@@ -276,7 +356,7 @@ ref_trace_is_same_action_entry(
// Should be called with a lock on the purged list
-boolean_t
+static boolean_t
ref_trace_purge_ref_deref_pairs(
IN PLIST_ENTRY last_deref_entry,
IN PLIST_ENTRY list_head)
@@ -320,8 +400,9 @@ ref_trace_purge_ref_deref_pairs(
return FALSE;
}
+
// Should be called with a lock on the purged list
-boolean_t
+static boolean_t
ref_trace_purge_same_entry(
IN PLIST_ENTRY last_entry,
IN PLIST_ENTRY list_head)
@@ -355,7 +436,7 @@ ref_trace_purge_same_entry(
}
-void
+static void
ref_trace_purge(
IN PLIST_ENTRY last_entry,
IN al_obj_t * p_obj)
@@ -380,6 +461,8 @@ ref_trace_purge(
cl_spinlock_release(&p_obj->ref_trace.lock);
}
+#endif // CL_KERNEL
+
int32_t
ref_trace_insert(
@@ -390,6 +473,7 @@ ref_trace_insert(
IN uint8_t ref_ctx
)
{
+#ifdef CL_KERNEL
al_obj_t* p_al_obj = (al_obj_t*)p_obj;
PLIST_ENTRY free_entry;
ref_cnt_data_t* ref_entry;
@@ -446,6 +530,14 @@ ref_trace_insert(
}
return ((change_type == AL_REF) ? ref_al_obj_inner(p_al_obj) : deref_al_obj_inner(p_al_obj));
+#else // CL_KERNEL
+ UNREFERENCED_PARAMETER(file);
+ UNREFERENCED_PARAMETER(line);
+ UNREFERENCED_PARAMETER(p_obj);
+ UNREFERENCED_PARAMETER(change_type);
+ UNREFERENCED_PARAMETER(ref_ctx);
+ return 0;
+#endif // CL_KERNEL
}
void
@@ -453,6 +545,7 @@ ref_trace_print(
IN void * const p_obj
)
{
+#ifdef CL_KERNEL
al_obj_t* p_al_obj = (al_obj_t*)p_obj;
ref_cnt_data_t* ref_entry;
PLIST_ENTRY p_entry;
@@ -480,6 +573,9 @@ ref_trace_print(
}
cl_spinlock_release(&p_al_obj->ref_trace.lock);
+#else // CL_KERNEL
+ UNREFERENCED_PARAMETER(p_obj);
+#endif // CL_KERNEL
}
void
@@ -487,6 +583,7 @@ ref_trace_dirty_print(
IN void * const p_obj
)
{
+#ifdef CL_KERNEL
al_obj_t* p_al_obj = (al_obj_t*)p_obj;
ref_db_node_t* ref_node;
ref_cnt_dirty_list_t* ref_dirty;
@@ -529,6 +626,9 @@ ref_trace_dirty_print(
}
cl_spinlock_release( &g_ref_cnt_dbg_db.dirty_chain_lock );
+#else // CL_KERNEL
+ UNREFERENCED_PARAMETER(p_obj);
+#endif // CL_KERNEL
}
#endif
diff -dwup3 -x *svn* -x makefile -x sources -r c:\dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\al\al_ref_trace.h .\core\al\al_ref_trace.h
--- c:\dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\al\al_ref_trace.h Thu May 31 11:22:16 2012
+++ .\core\al\al_ref_trace.h Thu May 31 12:57:10 2012
@@ -47,6 +47,7 @@ typedef enum {
AL_DEREF
} al_ref_change_type_t;
+
enum e_ref_origin {
E_REF_INIT = 1,
E_REF_CA_ADD_REMOVE,
@@ -56,10 +57,6 @@ enum e_ref_origin {
E_REF_CONSTRUCT_CHILD
};
-typedef enum {
- AL_DATA_NODE,
- AL_DIRTY_CHAIN_NODE
-} al_node_type_t;
typedef enum {
EQUAL_REF_DEREF_PAIRS = 1 << 0,
@@ -67,68 +64,14 @@ typedef enum {
} purge_policy_flags_t;
-#define REF_TRACE_MAX_ENTRIES 0x2000
-#define REF_TRACE_DB_ENTRIES 0xF0000
-
-typedef struct _ref_cnt_data
-{
- LONG prev_ref_val;
- uint32_t line_num;
- uint8_t purge_type;
- uint16_t repeat_cnt;
- uint8_t ref_change; //al_ref_change_type_t
- uint8_t ref_ctx; //enum e_ref_type
- char* file_name;
-
-} ref_cnt_data_t;
-
-typedef struct _ref_cnt_dirty_list
-{
- void* p_al_obj;
- uint32_t type;
- long obj_list_size;
- LIST_ENTRY dirty_list;
-} ref_cnt_dirty_list_t;
-
-
-typedef union _ref_db_entry
-{
- ref_cnt_data_t ref_cnt_data;
- ref_cnt_dirty_list_t ref_dirty_list;
-
-} ref_db_entry_t;
-
-typedef struct _ref_db_node
-{
- uint8_t type; //al_node_type_t
- ref_db_entry_t entry;
- LIST_ENTRY list_entry;
-} ref_db_node_t;
-
-typedef struct _ref_cnt_dbg_db
-{
- LIST_ENTRY free_chain;
- cl_spinlock_t free_chain_lock;
-
- LIST_ENTRY dirty_chain;
- cl_spinlock_t dirty_chain_lock;
-
- ULONG policy;
- LONG max_chain_size;
- uint32_t max_chain_obj_type;
- int32_t needed_size;
- volatile long objects_num;
- ref_db_node_t ref_cnt_db[REF_TRACE_DB_ENTRIES];
-} ref_cnt_dbg_db_t;
-
-
+#ifdef CL_KERNEL
typedef struct _obj_ref_trace
{
LIST_ENTRY ref_chain;
cl_spinlock_t lock;
volatile long list_size;
} obj_ref_trace_t;
-
+#endif
void
ref_trace_db_init(ULONG policy);
Index: inc/user/LLIST.H
===================================================================
--- inc/user/LLIST.H (revision 3427)
+++ inc/user/LLIST.H (working copy)
@@ -1,474 +0,0 @@
-/*++
-
- This source code may incorporate intellectual property owned by
- Microsoft Corporation. Our provision of this source code does not
- include any licenses or any other rights to you under any Microsoft
- intellectual property. If you would like a license from Microsoft
- (e.g., to rebrand, redistribute), you need to contact Microsoft
- directly.
-
-Module Name:
-
- llist.h
-
-Abstract:
-
- This module is a standalone collection of linked-list definition and
- manipulation macros originally defined within the Windows NT
- development.
-
---*/
-
-#ifndef _LLIST_
-#define _LLIST_
-#include <winsock2.h>
-
-
-
-#if !defined( _WINNT_ )
-//