Commit 7bc1134d authored by Michal Berger's avatar Michal Berger Committed by Konrad Sztyber
Browse files

test/scheduler: Read PID's status file only once



There's some peculiar issue where reading this file line by line can
be tainted by sudden updates to the file resulting in given fields
being unrecognized by the get_proc_cpu_affinity(). To avoid that,
make sure this file is read once in full before parsing.

Change-Id: Ied4f03ada3b354b666df71f4d5f5d2467a874d98
Signed-off-by: default avatarMichal Berger <michal.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/25407


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Community CI Samsung <spdk.community.ci.samsung@gmail.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
parent 0b65bb47
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -232,12 +232,13 @@ get_proc_cpu_affinity() {
		return 1
	fi

	# shellcheck disable=SC2188
	while IFS=":"$'\t' read -r status val; do
		if [[ $status == Cpus_allowed_list ]]; then
			parse_cpu_list <(echo "$val")
			return 0
		fi
	done < "$status_file"
	done < <(< "$status_file")

	xtrace_restore
}