Răsfoiți Sursa

qcacmn: Fix incorrect verbose level debug print

If QDF_TRACE is called with wrong verbose level then
the actual print is supressed and a error log will be
printed indicating wrong verbose level

This change is introduced because of an issue wherein
the prints flooded with wrong verbose level and could
not identify the incorrect caller

Add change to concatenate the actual print along with
failure message to help identify such incorrect callers

CRs-Fixed: 2716564
Change-Id: I19c4e80958c1ab5d621eea3a6d32308ce4c51558
phadiman 5 ani în urmă
părinte
comite
c90e1dc372
1 a modificat fișierele cu 6 adăugiri și 2 ștergeri
  1. 6 2
      qdf/linux/src/qdf_trace.c

+ 6 - 2
qdf/linux/src/qdf_trace.c

@@ -3274,13 +3274,17 @@ void qdf_trace_msg_cmn(unsigned int idx,
 
 	/* Check if category passed is valid */
 	if (category < 0 || category >= MAX_SUPPORTED_CATEGORY) {
-		pr_info("%s: Invalid category: %d\n", __func__, category);
+		vscnprintf(str_buffer, QDF_TRACE_BUFFER_SIZE, str_format, val);
+		pr_info("%s: Invalid category: %d, log: %s\n",
+			__func__, category, str_buffer);
 		return;
 	}
 
 	/* Check if verbose mask is valid */
 	if (verbose < 0 || verbose >= QDF_TRACE_LEVEL_MAX) {
-		pr_info("%s: Invalid verbose level %d\n", __func__, verbose);
+		vscnprintf(str_buffer, QDF_TRACE_BUFFER_SIZE, str_format, val);
+		pr_info("%s: Invalid verbose level %d, log: %s\n",
+			__func__, verbose, str_buffer);
 		return;
 	}