|
|
030205 |
commit 97a9ceb2a294ee3218987daf84a5ab3d9d361e27
|
|
|
030205 |
Author: Martin Cermak <mcermak@redhat.com>
|
|
|
030205 |
Date: Thu Jun 14 14:35:26 2018 +0200
|
|
|
030205 |
|
|
|
030205 |
Improve the foreach_limit(2).exp test results.
|
|
|
030205 |
|
|
|
030205 |
Without this update, one can observe following issue with rhel7
|
|
|
030205 |
powerpc kernels:
|
|
|
030205 |
|
|
|
030205 |
=======
|
|
|
030205 |
# stap -p4 testsuite/systemtap.maps/foreach_limit.stp
|
|
|
030205 |
...
|
|
|
030205 |
/usr/local/share/systemtap/runtime/map.c:275:26: error: ‘a’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
|
|
|
030205 |
struct mlist_head *c, *a, *last, *tmp;
|
|
|
030205 |
^
|
|
|
030205 |
/usr/local/share/systemtap/runtime/map.c:275:26: error: ‘a’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
|
|
|
030205 |
cc1: all warnings being treated as errors
|
|
|
030205 |
=======
|
|
|
030205 |
|
|
|
030205 |
This problem turns out to start happening after the powerpc kernel
|
|
|
030205 |
build system started using -O3 instead of -O2 as one can see in
|
|
|
030205 |
http://vault.centos.org/7.5.1804/os/Source/SPackages/kernel-3.10.0-862.el7.src.rpm
|
|
|
030205 |
|
|
|
030205 |
=======
|
|
|
030205 |
# powerpc is compiled with -O3, via specfile rpmbuild -- see rhbz1051067.
|
|
|
030205 |
# we need to keep consistency here, however, for out of tree kmod builds --
|
|
|
030205 |
# see rhbz1431029 for reference
|
|
|
030205 |
ifeq ($(SRCARCH), powerpc)
|
|
|
030205 |
KBUILD_CFLAGS += -O3
|
|
|
030205 |
else
|
|
|
030205 |
KBUILD_CFLAGS += -O2
|
|
|
030205 |
endif
|
|
|
030205 |
=======
|
|
|
030205 |
|
|
|
030205 |
Reverting this change (using -O2 instead of -O3) works the problem around
|
|
|
030205 |
as well as this systemtap-side update. For more details, see rhbz1591267.
|
|
|
030205 |
|
|
|
030205 |
diff --git a/runtime/map.c b/runtime/map.c
|
|
|
030205 |
index 5caf739..ef91456 100644
|
|
|
030205 |
--- a/runtime/map.c
|
|
|
030205 |
+++ b/runtime/map.c
|
|
|
030205 |
@@ -272,7 +272,7 @@ static void _stp_map_sortn(MAP map, int n, int keynum, int dir,
|
|
|
030205 |
_stp_map_sort(map, keynum, dir, get_key);
|
|
|
030205 |
} else {
|
|
|
030205 |
struct mlist_head *head = &map->head;
|
|
|
030205 |
- struct mlist_head *c, *a, *last, *tmp;
|
|
|
030205 |
+ struct mlist_head *c, *a = 0, *last, *tmp;
|
|
|
030205 |
int num, swaps = 1;
|
|
|
030205 |
|
|
|
030205 |
if (mlist_empty(head))
|