hikptool/hikptool.spec
zhangyuyang a1e8d45430 hikptool: Add HCCS and SDMA modules along with log collection
The HCCS and SDMA modules and the log collection function are added.

Signed-off-by: zhangyuyang <zhangyuyang31@huawei.com>
(cherry picked from commit 73fe961568c3b5e4406a65a46e926f2f0623d585)
2025-03-18 17:06:56 +08:00

219 lines
11 KiB
RPMSpec

%global debug_package %{nil}
Name: hikptool
Summary: A userspace tool for Linux providing problem location on Kunpeng chips
Version: 1.0.0
Release: 17
License: MulanPSL2
Source: %{name}-%{version}.tar.gz
ExclusiveOS: linux
URL: https://gitee.com/openeuler/hikptool
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Prefix: /usr/lib64
Conflicts: %{name} < %{version}-%{release}
Provides: %{name} = %{version}-%{release}
BuildRequires: gcc make cmake
Requires: glibc
ExclusiveArch: aarch64
Patch0001: 0001-socip-Return-EINVAL-when-the-parameter-check-fails.patch
Patch0002: 0002-fix-compiler-security-option-problem.patch
Patch0003: 0003-fix-the-security-compilation-PIE-issue.patch
Patch0004: 0004-hikptool-fix-print-sas_dev-info-error-problem.patch
Patch0005: 0005-fix-hikptool-rciep-rsp-filed-error-problem.patch
Patch0006: 0006-fix-pcie_info-cmd-print-display-problem.patch
Patch0007: 0007-fix-signal-proc-func-api-modified-to-be-open-to-the-.patch
Patch0008: 0008-delete-pcie-AP_INT-module-for-dump-reg.patch
Patch0009: 0009-fix-serdes-module-dump-reg-num-is-not-enough-problem.patch
Patch0010: 0010-fix-the-number-of-PCS-lane-registers-in-the-PCIe-dum.patch
Patch0011: 0011-optimize-the-nic_mac-dump-register.patch
Patch0012: 0012-Fix-a-resource-release-bug-in-hikp_roh_get_cam_reg_n.patch
Patch0013: 0013-fix-missing-white-space-issue.patch
Patch0014: 0014-hikptool-fix-maininfo-detail-info-print-error.patch
Patch0015: 0015-hikptool-fix-print-sas_dqe-info-error-problem.patch
Patch0016: 0016-hikptool-fix-compiling-specifications-check-problem.patch
Patch0017: 0017-Complete-the-developing-of-hikptool-ub_dfx-function.patch
Patch0018: 0018-Complete-the-developing-of-hikptool-ub_link-function.patch
Patch0019: 0019-Complete-the-developing-of-hikptool-ub_bp-function.patch
Patch0020: 0020-Complete-the-developing-of-hikptool-ub_crd-function.patch
Patch0021: 0021-Complete-the-developing-of-hikptool-ub_info-function.patch
Patch0022: 0022-add-support-query-ip-guid-entries.patch
Patch0023: 0023-hikptool-delete-redundant-copyright-notices.patch
Patch0024: 0024-hikptool-add-pm-trace.patch
Patch0025: 0025-hikptool-add-The-security-compilation-options.patch
Patch0026: 0026-hikptool-nic_port-cmd-add-print-arb-info-and-phy-inf.patch
Patch0027: 0027-hikptool-add-pcie-new-dump.patch
Patch0028: 0028-hikptool-add-show-CDR-DFX-info-in-nic_port-cmd.patch
Patch0029: 0029-hikptool-add-new-cmd-support-query-ncsi-dfx-info.patch
Patch0030: 0030-hikptool-Don-t-show-gen5.patch
Patch0031: 0031-hikptool-RDMA-Fix-the-missing-bank-ID-in-roce_trp-GE.patch
Patch0032: 0032-hikptool-fix-the-memory-leak-risk-problem.patch
Patch0033: 0033-hikptool-add-new-cmd-support-query-fault-notify-pkt-.patch
Patch0034: 0034-hikptool-add-new-cmd-to-support-query-port-fault-inf.patch
Patch0035: 0035-hikptool-support-to-query-pfc-storm-parameters.patch
Patch0036: 0036-hikptool-add-sub-cmd-nic_torus-support.patch
Patch0037: 0037-hikptool-optimized-display-the-hot-plug-card-info-in.patch
Patch0038: 0038-hikptool-Update-the-tool-version-number-to-1.1.0.patch
Patch0039: 0039-hikptool-roce-Add-a-common-frame-for-hikptool-roce-r.patch
Patch0040: 0040-hikptool-roce-Add-roce_rst-cmd-for-reset-signal-regi.patch
Patch0041: 0041-hikptool-roce-Add-roce_global_cfg-cmd-for-global-con.patch
Patch0042: 0042-hikptool-roce-Add-roce_bond-cmd-for-bond-registers-q.patch
Patch0043: 0043-hikptool-roce-Add-ext-query-for-roce_caep-cmd.patch
Patch0044: 0044-hikptool-roce-Add-ext-query-for-roce_mdb-cmd.patch
Patch0045: 0045-hikptool-roce-Add-ext-query-for-roce_qmm-cmd.patch
Patch0046: 0046-hikptool-Querying-the-SerDes-Relationship-of-the-PCI.patch
Patch0047: 0047-hikptool-Remove-the-function-of-querying-SAS-device-.patch
Patch0048: 0048-hikptool-roce-Use-calloc-to-alloc-memory-for-array-i.patch
Patch0049: 0049-hikptool-roce-Fix-missing-check-of-reg-num-responsed.patch
Patch0050: 0050-hikptool-Change-the-unic_ppp-directory-to-ub_ppp.patch
Patch0051: 0051-hikptool-roce-Fix-the-wrong-maximum-of-gmv-index.patch
Patch0052: 0052-hikptool-Resolved-some-centralized-code-review-comme.patch
Patch0053: 0053-hikptool-roce-Fix-the-infinite-loop-due-to-compatibi.patch
Patch0054: 0054-hikptool-roh-fix-the-display-information-for-roh-mac.patch
Patch0055: 0055-hikptool-augument-serdes-relationship-of-the-PCIe.patch
Patch0056: 0056-hikptool-Supported-parsing-the-optical-module-that-u.patch
Patch0057: 0057-hikptool-Fixed-an-issue-where-the-MAC-type-is-incorr.patch
Patch0058: 0058-hikptool-The-nic_port-command-is-adapted-to-display-.patch
Patch0059: 0059-hikptool-fix-cleancode-codecheck-alarm.patch
Patch0060: 0060-hikptool-Delete-meaningless-printing.patch
Patch0061: 0061-hikptool-Update-the-tool-version-number-to-1.1.1.patch
Patch0062: 0062-hikptool-The-ecam-register-is-added-to-the-PCIe-dump.patch
Patch0063: 0063-hikptool-roce-Print-names-of-registers-for-gmv-mdb-p.patch
Patch0064: 0064-hikptool-roce-Support-exposing-names-of-extend-regis.patch
Patch0065: 0065-hikptool-roce-Fix-the-validation-check-of-cur_block_.patch
Patch0066: 0066-hikptool-roce-Fix-redundant-update-of-total_block_nu.patch
Patch0067: 0067-hikptool-roce-Add-check-for-total_block_num-from-FW.patch
Patch0068: 0068-hikptool-Resolve-the-review-problems-found-in-the-R-.patch
Patch0069: 0069-hikptool-Support-static-compilation-for-hikptool.patch
Patch0070: 0070-hikptool-nic-Fix-the-Code-review-comments.patch
Patch0071: 0071-hikptool-nic-add-check-for-the-value-from-FW.patch
Patch0072: 0072-hikptool-nic-Fix-the-Code-review-comments-in-NIC-mod.patch
Patch0073: 0073-hikptool-nic-return-real-errno-if-realpath-failed-in.patch
Patch0074: 0074-hikptool-nic-return-real-cmd-status-if-alloc-failed-.patch
Patch0075: 0075-hikptool-nic-check-path-before-used-it-in-function-h.patch
Patch0076: 0076-hikptool-nic-check-strtol-if-it-failed-in-get_numvfs.patch
Patch0077: 0077-hikptool-nic-adding-NUL-at-the-end-of-the-buffer-len.patch
Patch0078: 0078-hikptool-nic-avoid-array-boundary-exceeded-in-hikp_n.patch
Patch0079: 0079-hikptool-nic-Fix-bad-usage-of-format-string.patch
Patch0080: 0080-hikptool-nic-Fix-potential-dead-loop.patch
Patch0081: 0081-hikptool-Rectify-the-cleancode-issue.patch
Patch0082: 0082-hikptool-Modify-the-macro-definition-of-the-header-f.patch
Patch0083: 0083-hikptool-The-memory-release-interface-is-added.patch
Patch0084: 0084-hikptool-nic-Dump-register-names-for-SSU-and-PPP-mod.patch
Patch0085: 0085-hikptool-Added-the-dfx-register-for-PCIe-dump.patch
Patch0086: 0086-hikptool-The-macro_num-error-is-rectified-and-the-of.patch
Patch0087: 0087-Fix-the-logic-of-obtaining-statistics-on-flow-contro.patch
Patch0088: 0088-hikptool-Rectify-the-compilation-alarm.patch
Patch0089: 0089-hikptool-Update-the-tool-version-number-to-1.1.3.patch
Patch0090: 0090-hikptool-Support-for-info-collect.patch
Patch0091: 0091-hikptool-Added-compilation-options.patch
Patch0092: 0092-hikptool-pcie-The-query-result-of-pcie_dumpreg-does-.patch
Patch0093: 0093-hikptool-hccs-support-dump-hccs-info.patch
Patch0094: 0094-hikptool-pcie-The-PCS-layer-register-print-command-i.patch
Patch0095: 0095-hikptool-pcie-Resolved-the-problem-that-it-takes-a-l.patch
Patch0096: 0096-Hikptool-add-support-dump-SDMA-register-information-.patch
Patch0097: 0097-Add-support-collect-sdma-hikptool-dump-reg-info.patch
Patch0098: 0098-hikptool-Update-the-tool-version-number-to-1.1.4.patch
%description
This package contains the hikptool
%prep
%autosetup -n %{name} -p1
mkdir -p build
%build
cd build
cmake ../
make
%install
mkdir -p ${RPM_BUILD_ROOT}/usr/bin
mkdir -p ${RPM_BUILD_ROOT}/usr/lib64
install -b -m755 ./build/hikptool ${RPM_BUILD_ROOT}/usr/bin
install -b -m755 ./build/libhikptdev/src/rciep/libhikptdev.so.1 ${RPM_BUILD_ROOT}/usr/lib64
install -b -m755 ./build/libhikptdev/src/rciep/libhikptdev.so ${RPM_BUILD_ROOT}/usr/lib64
install -b -m755 ./build/libhikptdev/src/rciep/libhikptdev.so.1.0.0 ${RPM_BUILD_ROOT}/usr/lib64
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
/usr/lib64/libhikptdev.so.1
/usr/lib64/libhikptdev.so
%attr(0500,root,root) /usr/lib64/libhikptdev.so.1.0.0
%attr(0500,root,root) /usr/bin/hikptool
%pre
if [ "$1" = "2" ] ; then #2: update
rm -rf $RPM_INSTALL_PREFIX/libhikptdev.so > /dev/null 2>&1 || true
rm -rf $RPM_INSTALL_PREFIX/libhikptdev.so.1 > /dev/null 2>&1 || true
fi
%post
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
ln -sf $RPM_INSTALL_PREFIX/libhikptdev.so.%{version} $RPM_INSTALL_PREFIX/libhikptdev.so
ln -sf $RPM_INSTALL_PREFIX/libhikptdev.so.%{version} $RPM_INSTALL_PREFIX/libhikptdev.so.1
fi
/sbin/ldconfig
%preun
if [ "$1" = "0" ] ; then #0: uninstall
rm -rf /var/log/hikp/ > /dev/null 2>&1 || true
fi
%postun
/sbin/ldconfig
%changelog
* Tue Mar 18 2025 veega2022 <zhuweijia@huawei.com> 1.0.0-17
- The HCCS and SDMA modules and the log collection function are added
* Thu Nov 21 2024 veega2022 <zhuweijia@huawei.com> 1.0.0-16
- Synchronize code, Modify the review comments to increase the reliability of the code
* Thu May 23 2024 veega2022 <zhuweijia@huawei.com> 1.0.0-15
- Synchronize code, the DFX register of the ECAM is added when the PCIe dumps registers
* Wed Apr 24 2024 veega2022 <zhuweijia@huawei.com> 1.0.0-14
- Synchronize code, fix some issues with ROH, PCIE and NIC modules
* Thu Nov 16 2023 veega2022 <zhuweijia@huawei.com> 1.0.0-13
- Synchronize the code and add the DFX of the roce module to resolve some review comments
* Fri Oct 20 2023 veega2022 <zhuweijia@huawei.com> 1.0.0-12
- Added DFX for UB, NIC, MAC modules, fixed some bugs
* Sat Jun 03 2023 veega2022 <zhuweijia@huawei.com> 1.0.0-11
- fix compiling specifications check problem
* Tue May 30 2023 veega2022 <zhuweijia@huawei.com> 1.0.0-10
- sync code: fix PCIe and serdes, roh module problem
* Thu Apr 06 2023 veega2022 <zhuweijia@huawei.com> 1.0.0-9
- fix sas device info print error bug
* Wed Mar 15 2023 veega2022 <zhuweijia@huawei.com> 1.0.0-8
- fix security compilation PIE issue
* Tue Dec 13 2022 veega2022 <zhuweijia@huawei.com> 1.0.0-7
- fix compiler security option problem
* Mon Dec 12 2022 veega2022 <zhuweijia@huawei.com> 1.0.0-6
- Add socip patch for fix return -EINVAL when the parameter check fails
* Thu Nov 24 2022 veega2022 <zhuweijia@huawei.com> 1.0.0-5
- Add nic_ppp dump mac and vlan function and change the hikptool permission to 0500
* Wed Nov 16 2022 veega2022 <zhuweijia@huawei.com> 1.0.0-4
- change the hikptool permission to 4550
* Fri Oct 28 2022 veega2022 <zhuweijia@huawei.com> 1.0.0-3
- Add sas/sata features source code
* Wed Oct 26 2022 veega2022 <zhuweijia@huawei.com> 1.0.0-2
- Add roce/roh/cxl/serdes/socip/pcie features source code
* Wed Oct 12 2022 veega2022 <zhuweijia@huawei.com> 1.0.0-1
- First Spec Version Include hikptool Code