!1 初始化 genwqe-tools

Merge pull request !1 from tushenmei/master
This commit is contained in:
openeuler-ci-bot 2020-09-01 11:30:05 +08:00 committed by Gitee
commit a75930efd9
5 changed files with 257 additions and 0 deletions

121
genwqe-tools.spec Normal file
View File

@ -0,0 +1,121 @@
Summary: GenWQE userspace tools
Name: genwqe-tools
Version: 4.0.20
Release: 1
License: ASL 2.0
URL: https://github.com/ibm-genwqe/genwqe-user/
BuildRequires: gcc zlib-devel >= 1.2.7 help2man
%ifarch %{power64}
BuildRequires: libcxl-devel
%endif
Source0: https://github.com/ibm-genwqe/genwqe-user/archive/v%{version}.tar.gz#/genwqe-user-%{version}.tar.gz
Patch0: genwqe-user-4.0.18-install-gzFile_test.patch
Patch1: genwqe-user-4.0.18-modifyFuntionName.patch
Requires: genwqe-zlib = %{version}-%{release}
%description
Provide a suite of utilities to manage and configure the IBM GenWQE card.
%package -n genwqe-zlib
Summary: GenWQE hardware accelerated libz
%description -n genwqe-zlib
GenWQE hardware accelerated libz and test-utilities.
%package -n genwqe-vpd
Summary: GenWQE adapter VPD tools
%description -n genwqe-vpd
The genwqe-vpd package contains GenWQE adapter VPD tools.
%package -n genwqe-zlib-devel
Summary: Development files for %{name}
Requires: genwqe-zlib%{?_isa} = %{version}-%{release}
%description -n genwqe-zlib-devel
The genwqe-zlib-devel package contains libraries and header files for
developing applications that use %{name}.
%package -n genwqe-zlib-static
Summary: Static library files for %{name}
Requires: genwqe-zlib-devel%{?_isa} = %{version}-%{release}
%description -n genwqe-zlib-static
The genwqe-zlib-static package contains static libraries for
developing applications that use %{name}.
%prep
%autosetup -p1 -n genwqe-user-%{version}
%build
LDFLAGS="%{__global_ldflags}" CFLAGS="%{optflags}" make %{?_smp_mflags} tools lib \
VERSION=%{version} CONFIG_ZLIB_PATH=%{_libdir}/libz.so V=2
%install
make %{?_smp_mflags} install DESTDIR=%{buildroot}/%{_prefix} \
SYSTEMD_UNIT_DIR=%{buildroot}/%{_unitdir} \
LIB_INSTALL_PATH=%{buildroot}/%{_libdir}/genwqe \
INCLUDE_INSTALL_PATH=%{buildroot}/%{_includedir}/genwqe
mkdir -p %{buildroot}/%{_sysconfdir}/
install -m 0644 tools/genwqe_vpd.csv %{buildroot}/etc/
rm %{buildroot}%{_libdir}/genwqe/libz.*
mv %{buildroot}%{_libdir}/genwqe/* %{buildroot}%{_libdir}/
rmdir %{buildroot}%{_libdir}/genwqe/
%ldconfig_scriptlets -n genwqe-zlib
%files -n genwqe-tools
%license LICENSE
%{_bindir}/genwqe_echo
%{_bindir}/genwqe_ffdc
%{_bindir}/genwqe_cksum
%{_bindir}/genwqe_memcopy
%{_bindir}/genwqe_peek
%{_bindir}/genwqe_poke
%{_bindir}/genwqe_update
%{_bindir}/genwqe_gunzip
%{_bindir}/genwqe_gzip
%{_bindir}/genwqe_test_gz
%{_bindir}/genwqe_mt_perf
%{_bindir}/zlib_mt_perf
%{_bindir}/gzFile_test
%{_mandir}/man1/genwqe_echo.1*
%{_mandir}/man1/genwqe_ffdc.1*
%{_mandir}/man1/genwqe_gunzip.1*
%{_mandir}/man1/genwqe_gzip.1*
%{_mandir}/man1/genwqe_cksum.1*
%{_mandir}/man1/genwqe_memcopy.1*
%{_mandir}/man1/genwqe_peek.1*
%{_mandir}/man1/genwqe_poke.1*
%{_mandir}/man1/genwqe_update.1*
%{_mandir}/man1/zlib_mt_perf.1*
%{_mandir}/man1/genwqe_test_gz.1*
%{_mandir}/man1/genwqe_mt_perf.1*
%{_mandir}/man1/gzFile_test.1*
%ifarch %{power64}
%{_bindir}/genwqe_maint
%{_bindir}/genwqe_loadtree
/%{_unitdir}/genwqe_maint.service
%{_mandir}/man1/genwqe_maint.1*
%{_mandir}/man1/genwqe_loadtree.1*
%endif
%files -n genwqe-zlib
%license LICENSE
%{_libdir}/*.so.*
%files -n genwqe-vpd
%license LICENSE
%config(noreplace) %{_sysconfdir}/genwqe_vpd.csv
%{_bindir}/genwqe_csv2vpd
%{_bindir}/genwqe_vpdconv
%{_bindir}/genwqe_vpdupdate
%{_mandir}/man1/genwqe_csv2vpd.1*
%{_mandir}/man1/genwqe_vpdconv.1*
%{_mandir}/man1/genwqe_vpdupdate.1*
%files -n genwqe-zlib-devel
%dir %{_includedir}/genwqe
%{_includedir}/genwqe/*
%{_libdir}/*.so
%files -n genwqe-zlib-static
%{_libdir}/*.a
%changelog
* Thu Aug 13 2020 tuShenmei <tushenmei@huawei.com> - 4.0.20-1
- package init

5
genwqe-tools.yaml Normal file
View File

@ -0,0 +1,5 @@
---
version_control: github
src_repo: ibm-genwqe/genwqe-user
tag_prefix: "genwqe-user-"
separator: "."

View File

@ -0,0 +1,11 @@
diff -up genwqe-user-4.0.18/tools/Makefile.than genwqe-user-4.0.18/tools/Makefile
--- genwqe-user-4.0.18/tools/Makefile.than 2017-02-13 15:26:30.887046956 +0100
+++ genwqe-user-4.0.18/tools/Makefile 2017-02-13 15:27:01.084890726 +0100
@@ -110,6 +110,7 @@ install_gzip_tools: all
install -D -m 755 zlib_mt_perf -T $(DESTDIR)/bin/zlib_mt_perf
install -D -m 755 genwqe_mt_perf -T $(DESTDIR)/bin/genwqe_mt_perf
install -D -m 755 genwqe_test_gz -T $(DESTDIR)/bin/genwqe_test_gz
+ install -D -m 755 gzFile_test -T $(DESTDIR)/bin/gzFile_test
uninstall_gzip_tools:
$(RM) $(DESTDIR)/bin/genwqe_gzip \

View File

@ -0,0 +1,120 @@
diff -Nur genwqe-user-4.0.20.old/lib/card_defs.h genwqe-user-4.0.20/lib/card_defs.h
--- genwqe-user-4.0.20.old/lib/card_defs.h 2020-08-10 15:16:15.910249128 +0800
+++ genwqe-user-4.0.20/lib/card_defs.h 2020-08-10 15:39:51.694537978 +0800
@@ -32,19 +32,19 @@
#include <unistd.h>
#include <sys/syscall.h> /* For SYS_xxx definitions */
-static inline pid_t gettid(void)
+static inline pid_t defs_gettid(void)
{
return (pid_t)syscall(SYS_gettid);
}
#define pr_err(fmt, ...) \
fprintf(stderr, "%08x.%08x %s:%u: Error: " fmt, \
- getpid(), gettid(), __FILE__, __LINE__, ## __VA_ARGS__)
+ getpid(), defs_gettid(), __FILE__, __LINE__, ## __VA_ARGS__)
#define pr_warn(fmt, ...) do { \
if (_dbg_flag) \
fprintf(stderr, "%08x.%08x %s:%u: Warn: " fmt, \
- getpid(), gettid(), __FILE__, __LINE__, \
+ getpid(), defs_gettid(), __FILE__, __LINE__, \
## __VA_ARGS__); \
} while (0)
@@ -56,7 +56,7 @@
#define pr_info(fmt, ...) do { \
if (_dbg_flag) \
fprintf(stderr, "%08x.%08x %s:%u: Info: " fmt, \
- getpid(), gettid(), __FILE__, __LINE__, \
+ getpid(), defs_gettid(), __FILE__, __LINE__, \
## __VA_ARGS__); \
} while (0)
diff -Nur genwqe-user-4.0.20.old/lib/hw_defs.h genwqe-user-4.0.20/lib/hw_defs.h
--- genwqe-user-4.0.20.old/lib/hw_defs.h 2020-08-10 15:16:15.910249128 +0800
+++ genwqe-user-4.0.20/lib/hw_defs.h 2020-08-10 15:27:57.120603187 +0800
@@ -33,7 +33,7 @@
# define ABS(a) (((a) < 0) ? -(a) : (a))
#endif
-static inline pid_t gettid(void)
+static inline pid_t defs_gettid(void)
{
return (pid_t)syscall(SYS_gettid);
}
@@ -44,14 +44,14 @@
#define pr_err(fmt, ...) do { \
if (zedc_log) \
fprintf(zedc_log, "%08x.%08x %s:%u: Error: " fmt, \
- getpid(), gettid(), __FILE__, __LINE__, \
+ getpid(), defs_gettid(), __FILE__, __LINE__, \
## __VA_ARGS__); \
} while (0)
#define pr_warn(fmt, ...) do { \
if (zedc_log) \
fprintf(zedc_log, "%08x.%08x %s:%u: Warn: " fmt, \
- getpid(), gettid(), __FILE__, __LINE__, \
+ getpid(), defs_gettid(), __FILE__, __LINE__, \
## __VA_ARGS__); \
} while (0)
@@ -63,14 +63,14 @@
#define pr_info(fmt, ...) do { \
if (zedc_log && zedc_dbg) \
fprintf(zedc_log, "%08x.%08x %s:%u: Info: " fmt, \
- getpid(), gettid(), __FILE__, __LINE__, \
+ getpid(), defs_gettid(), __FILE__, __LINE__, \
## __VA_ARGS__); \
} while (0)
#define pr_log(dbg, fmt, ...) do { \
if (zedc_log && (dbg)) \
fprintf(zedc_log, "%08x.%08x %s:%u: Info: " fmt, \
- getpid(), gettid(), __FILE__, __LINE__, \
+ getpid(), defs_gettid(), __FILE__, __LINE__, \
## __VA_ARGS__); \
} while (0)
diff -Nur genwqe-user-4.0.20.old/tools/zlib_mt_perf.c genwqe-user-4.0.20/tools/zlib_mt_perf.c
--- genwqe-user-4.0.20.old/tools/zlib_mt_perf.c 2020-08-10 15:16:15.914249188 +0800
+++ genwqe-user-4.0.20/tools/zlib_mt_perf.c 2020-08-10 15:43:40.897769361 +0800
@@ -162,7 +162,7 @@
return run_cpu;
}
-static pid_t gettid(void)
+static pid_t perf_gettid(void)
{
return (pid_t)syscall(SYS_gettid);
}
@@ -492,7 +492,7 @@
d->defl_total=0;
d->defl_time=0;
d->comp_calls=0;
- d->tid = gettid();
+ d->tid = perf_gettid();
d->cpu = sched_getcpu();
d->first_run = true;
d->checksum = 0;
@@ -533,7 +533,7 @@
d->infl_total = 0;
d->infl_time = 0;
d->decomp_calls = 0;
- d->tid = gettid();
+ d->tid = perf_gettid();
d->cpu = sched_getcpu();
d->first_run = true;
d->checksum = 0;
@@ -550,7 +550,7 @@
rc = infl(d, c_fp);
if (rc != Z_OK) {
fprintf(stderr, "%08x.%08x err/inf: rc=%d %s\n",
- getpid(), gettid(), rc, c_fname);
+ getpid(), perf_gettid(), rc, c_fname);
zerr(rc);
goto exit_failure;
}

BIN
genwqe-user-4.0.20.tar.gz Normal file

Binary file not shown.