Unverified Commit 160f3264 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!15166 tracing: Have process_string() also allow arrays

parents 56e0de56 98633495
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -360,6 +360,18 @@ static bool process_string(const char *fmt, int len, struct trace_event_call *ca
		s = r + 1;
	} while (s < e);

	/*
	 * Check for arrays. If the argument has: foo[REC->val]
	 * then it is very likely that foo is an array of strings
	 * that are safe to use.
	 */
	r = strstr(s, "[");
	if (r && r < e) {
		r = strstr(r, "REC->");
		if (r && r < e)
			return true;
	}

	/*
	 * If there's any strings in the argument consider this arg OK as it
	 * could be: REC->field ? "foo" : "bar" and we don't want to get into