From c23eab3879ca44a0ff2c0d80355c03878d354890 Mon Sep 17 00:00:00 2001 From: John Kacur Date: Wed, 20 Dec 2023 13:21:37 -0500 Subject: [PATCH] Update to rtla in linux-6.6.0 Add patch to use SYS_gettid and add -lpthread to the Makefile Resolves: RHEL-10081 Signed-off-by: John Kacur --- rtla-Use-SYS_gettid-for-gettid.patch | 50 ++++++++++++++++++++++++++++ rtla.spec | 3 ++ 2 files changed, 53 insertions(+) create mode 100644 rtla-Use-SYS_gettid-for-gettid.patch diff --git a/rtla-Use-SYS_gettid-for-gettid.patch b/rtla-Use-SYS_gettid-for-gettid.patch new file mode 100644 index 0000000..5d8b43c --- /dev/null +++ b/rtla-Use-SYS_gettid-for-gettid.patch @@ -0,0 +1,50 @@ +From 07ad224f2416e7c9411fd095fef148c67011eb49 Mon Sep 17 00:00:00 2001 +From: root +Date: Wed, 20 Dec 2023 13:08:28 -0500 +Subject: [PATCH] rtla: Use SYS_gettid for gettid + +Use SYS_gettid for gettid since gittid is not available in the version +of glibc in rhel8.x + +Also add the -lpthread to the flags in the Makefile for +pthread_setname_np + +Signed-off-by: root +--- + Makefile | 2 +- + src/timerlat_u.c | 6 ++++++ + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 2456a399eb9a..db85545e9ec1 100644 +--- a/Makefile ++++ b/Makefile +@@ -32,7 +32,7 @@ TRACEFS_HEADERS := $$($(PKG_CONFIG) --cflags libtracefs) + + CFLAGS := -O -g -DVERSION=\"$(VERSION)\" $(FOPTS) $(MOPTS) $(WOPTS) $(TRACEFS_HEADERS) $(EXTRA_CFLAGS) + LDFLAGS := -ggdb $(EXTRA_LDFLAGS) +-LIBS := $$($(PKG_CONFIG) --libs libtracefs) ++LIBS := $$($(PKG_CONFIG) --libs libtracefs) -lpthread + + SRC := $(wildcard src/*.c) + HDR := $(wildcard src/*.h) +diff --git a/src/timerlat_u.c b/src/timerlat_u.c +index 01dbf9a6b5a5..e8d0ec92c8d2 100644 +--- a/src/timerlat_u.c ++++ b/src/timerlat_u.c +@@ -16,6 +16,12 @@ + #include + #include + ++#include ++#ifndef SYS_gettid ++#error "SYS_gettid unavailable" ++#endif ++#define gettid() ((pid_t)syscall(SYS_gettid)) ++ + #include "utils.h" + #include "timerlat_u.h" + +-- +2.43.0 + diff --git a/rtla.spec b/rtla.spec index 67bb737..7cb0e61 100644 --- a/rtla.spec +++ b/rtla.spec @@ -19,6 +19,7 @@ Requires: libtracefs >= 1.3.1 # Patches Patch01: rtla-Fix-uninitialized-variable-found.patch +Patch02: rtla-Use-SYS_gettid-for-gettid.patch %description The rtla meta-tool includes a set of commands that aims to analyze @@ -30,6 +31,7 @@ about the properties and root causes of unexpected results. %prep %setup -q -n %{name}-%{version} %patch1 -p1 +%patch2 -p1 %build @@ -68,6 +70,7 @@ make DESTDIR=%{buildroot} -C Documentation install %changelog * Mon Dec 18 2023 John Kacur - 6.6.0-1 Update to rtla in linux-6.6.0 +- Add patch to use SYS_gettid and add -lpthread to the Makefile Resolves: RHEL-10081 * Fri Jul 14 2023 John Kacur - 5.14.0-8