소스 검색

qcacmn: Print reference id in debug prints

Print ref_id in all debug prints. It will make sure even if
string value is not added in string_from_dbg, there will be ref
id to debug leak issue.

Change-Id: If35a298239dd09cb4169474da34e30e85a2cde92
CRs-Fixed: 3147857
Jyoti Kumari 3 년 전
부모
커밋
7c3b36f765

+ 2 - 1
umac/cmn_services/obj_mgr/src/wlan_objmgr_debug.c

@@ -1,6 +1,7 @@
 /*
  *
  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -358,7 +359,7 @@ wlan_objmgr_print_ref_func_line(struct wlan_objmgr_trace_func *func_head,
 	uint32_t ref_cnt;
 	struct wlan_objmgr_line_ref_node *tmp_ln_node;
 
-	obj_mgr_debug("ID: %s", string_from_dbgid(id));
+	obj_mgr_debug("ID: %s(%d)", string_from_dbgid(id), id);
 	while (func_head) {
 		obj_mgr_debug("Func: %s", func_head->func);
 		tmp_ln_node = func_head->line_head;

+ 2 - 2
umac/cmn_services/obj_mgr/src/wlan_objmgr_global_obj.c

@@ -843,8 +843,8 @@ void wlan_objmgr_print_ref_ids(qdf_atomic_t *id,
 	for (i = 0; i < WLAN_REF_ID_MAX; i++) {
 		pending_ref = qdf_atomic_read(&id[i]);
 		if (pending_ref)
-			obj_mgr_log_level(log_level, "%s -- %d",
-				string_from_dbgid(i), pending_ref);
+			obj_mgr_log_level(log_level, "%s(%d) -- %d",
+					  string_from_dbgid(i), i, pending_ref);
 	}
 
 	return;

+ 8 - 7
umac/cmn_services/obj_mgr/src/wlan_objmgr_psoc_obj.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -2876,9 +2876,9 @@ uint32_t wlan_objmgr_psoc_check_for_pdev_leaks(struct wlan_objmgr_psoc *psoc)
 		ref_id_dbg = pdev->pdev_objmgr.ref_id_dbg;
 		wlan_objmgr_for_each_refs(ref_id_dbg, ref_id, refs) {
 			leaks++;
-			obj_mgr_alert("%7u   %4u   %s",
+			obj_mgr_alert("%7u   %4u   %s(%d)",
 				      pdev_id, refs,
-				      string_from_dbgid(ref_id));
+				      string_from_dbgid(ref_id), ref_id);
 		}
 		wlan_pdev_obj_unlock(pdev);
 	}
@@ -2921,8 +2921,9 @@ uint32_t wlan_objmgr_psoc_check_for_vdev_leaks(struct wlan_objmgr_psoc *psoc)
 		ref_id_dbg = vdev->vdev_objmgr.ref_id_dbg;
 		wlan_objmgr_for_each_refs(ref_id_dbg, ref_id, refs) {
 			leaks++;
-			obj_mgr_alert("%7u   %4u   %s",
-				      vdev_id, refs, string_from_dbgid(ref_id));
+			obj_mgr_alert("%7u   %4u   %s(%d)",
+				      vdev_id, refs, string_from_dbgid(ref_id),
+				      ref_id);
 		}
 		wlan_vdev_obj_unlock(vdev);
 	}
@@ -2942,11 +2943,11 @@ wlan_objmgr_print_peer_ref_leaks(struct wlan_objmgr_peer *peer, int vdev_id)
 
 	ref_id_dbg = peer->peer_objmgr.ref_id_dbg;
 	wlan_objmgr_for_each_refs(ref_id_dbg, ref_id, refs) {
-		obj_mgr_alert(QDF_MAC_ADDR_FMT " %7u   %4u   %s",
+		obj_mgr_alert(QDF_MAC_ADDR_FMT " %7u   %4u   %s(%d)",
 			      QDF_MAC_ADDR_REF(peer->macaddr),
 			      vdev_id,
 			      refs,
-			      string_from_dbgid(ref_id));
+			      string_from_dbgid(ref_id), ref_id);
 	}
 }
 #else