Commit d627c537 authored by Marco Elver's avatar Marco Elver Committed by Paul E. McKenney
Browse files

kcsan: Support reporting scoped read-write access type



Support generating the string representation of scoped read-write
accesses for completeness. They will become required in planned changes.

Signed-off-by: default avatarMarco Elver <elver@google.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent 6c65eb75
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -210,10 +210,12 @@ static bool report_matches(const struct expect_report *r)
							"read-write" :
							"write") :
					       "read");
		const bool is_atomic = (ty & KCSAN_ACCESS_ATOMIC);
		const bool is_scoped = (ty & KCSAN_ACCESS_SCOPED);
		const char *const access_type_aux =
			(ty & KCSAN_ACCESS_ATOMIC) ?
				      " (marked)" :
				      ((ty & KCSAN_ACCESS_SCOPED) ? " (scoped)" : "");
				(is_atomic && is_scoped)	? " (marked, scoped)"
				: (is_atomic			? " (marked)"
				   : (is_scoped			? " (scoped)" : ""));

		if (i == 1) {
			/* Access 2 */
+4 −0
Original line number Diff line number Diff line
@@ -247,6 +247,10 @@ static const char *get_access_type(int type)
		return "write (scoped)";
	case KCSAN_ACCESS_SCOPED | KCSAN_ACCESS_WRITE | KCSAN_ACCESS_ATOMIC:
		return "write (marked, scoped)";
	case KCSAN_ACCESS_SCOPED | KCSAN_ACCESS_COMPOUND | KCSAN_ACCESS_WRITE:
		return "read-write (scoped)";
	case KCSAN_ACCESS_SCOPED | KCSAN_ACCESS_COMPOUND | KCSAN_ACCESS_WRITE | KCSAN_ACCESS_ATOMIC:
		return "read-write (marked, scoped)";
	default:
		BUG();
	}