import rt-tests-2.1-3.el8

This commit is contained in:
CentOS Sources 2021-11-19 04:25:31 +00:00 committed by Stepan Oksanichenko
parent c895ce1aa1
commit 0f6859306a
2 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,34 @@
From 6a3dd40539c1804db8b1fe1684afa5fa111636fe Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Thu, 11 Nov 2021 08:56:54 -0500
Subject: [PATCH] rt-tests: deadline_tests: Null check to prevent floating
point exception
Fix a floating point exception that can occur if sd->nr_adjust is 0
by checking it before performing a division by zero.
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/sched_deadline/deadline_test.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/sched_deadline/deadline_test.c b/src/sched_deadline/deadline_test.c
index 53abd4d2ca6b..b7e1e045b57c 100644
--- a/src/sched_deadline/deadline_test.c
+++ b/src/sched_deadline/deadline_test.c
@@ -2050,8 +2050,10 @@ int main(int argc, char **argv)
printf("missed deadlines = %d\n", sd->missed_deadlines);
printf("missed periods = %d\n", sd->missed_periods);
printf("Total adjustments = %lld us\n", sd->total_adjust);
- printf("# adjustments = %lld avg: %lld us\n",
- sd->nr_adjust, sd->total_adjust / sd->nr_adjust);
+ if (sd->nr_adjust) {
+ printf("# adjustments = %lld avg: %lld us\n",
+ sd->nr_adjust, sd->total_adjust / sd->nr_adjust);
+ }
printf("deadline : %lld us\n", sd->deadline_us);
printf("runtime : %lld us\n", sd->runtime_us);
printf("nr_periods : %lld\n", sd->nr_periods);
--
2.31.1

View File

@ -6,7 +6,7 @@ Name: rt-tests
# Numa argument to make: NUMA=1
#
Version: 2.1
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2
Group: Development/Tools
URL: git://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git
@ -22,6 +22,7 @@ Requires: bash bc
#Patches
Patch1: rt-tests-Add-missing-option-F-to-optstring.patch
Patch2: rt-tests-deadline_tests-Null-check-to-prevent-exception.patch
%description
rt-tests is a set of programs that test and measure various components of
@ -31,6 +32,7 @@ latency. It also tests the functioning of priority-inheritance mutexes.
%prep
%setup -q -n %{name}-%{version}
%patch1 -p1
%patch2 -p1
%build
%set_build_flags
@ -85,6 +87,10 @@ rm -rf ${build_root}
%{_mandir}/man8/determine_maximum_mpps.8.*
%changelog
* Fri Nov 12 2021 John Kacur <jkacur@redhat.com> - 2.1-3
- Null check to prevent floating point exception in deadline test
Resolves: rhbz#1995005
* Tue Oct 12 2021 Leah Leshchinsky <lleshchi@redhat.com> - 2.1-2
- Add missing option F to optstring
Resolves: rhbz#2000974