summaryrefslogtreecommitdiff
path: root/powerapi.spec
blob: 267f9b06020cb97e14b746d2df1240d40feab3dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
Name:           powerapi
Version:        1.2.0
Release:        1
Summary:        The ability to support openEuler power consumption control.

License:        MulanPSL-2.0
URL:            https://gitee.com/openeuler/powerapi/
Source0:        %{name}-%{version}.tar.gz

BuildRequires:  gcc,cmake,zip,unzip
Requires:       tar,ipmitool,psmisc,systemd,perf

%description
Including a power API SO and the Power API Service.

%package -n powerapi-devel
Summary:        The ability to support openEuler power consumption control.
BuildRequires:  gcc,cmake,zip,unzip
Requires:       tar,ipmitool,psmisc,systemd,perf,powerapi

%description -n powerapi-devel
Contains the client and server components and API header files for powerapi integration development.

%prep
%autosetup -p1

%build
sh build.sh release

%install
install -d %{buildroot}/%{_sysconfdir}/sysconfig/pwrapis
cp release/pwrapis/conf/pwrapis_config.ini %{buildroot}/%{_sysconfdir}/sysconfig/pwrapis
install -d %{buildroot}/%{_sbindir}
cp release/pwrapis/pwrapis %{buildroot}/%{_sbindir}
install -d %{buildroot}/%{_sysconfdir}/systemd/system
cp pwrapis/pwrapis.service %{buildroot}/%{_sysconfdir}/systemd/system
install -d %{buildroot}/%{_libdir}
cp release/pwrapic/lib/libpwrapi.so %{buildroot}/%{_libdir}
install -d %{buildroot}/%{_includedir}/pwrapic
cp -r release/pwrapic/inc/* %{buildroot}/%{_includedir}/pwrapic

%post
systemctl start pwrapis

%preun
systemctl stop pwrapis

%files
%{_sbindir}/pwrapis
%{_libdir}/libpwrapi.so
%dir %{_sysconfdir}/sysconfig/pwrapis
%{_sysconfdir}/sysconfig/pwrapis/*
%{_sysconfdir}/systemd/system/pwrapis.service

%files -n powerapi-devel
%{_sbindir}/pwrapis
%{_libdir}/libpwrapi.so
%dir %{_sysconfdir}/sysconfig/pwrapis
%{_sysconfdir}/sysconfig/pwrapis/*
%dir %{_includedir}/pwrapic
%{_includedir}/pwrapic/*

%changelog
* Mon Aug 18 2025 wangyi <wangyi395@huawei.com> - 1.2.0-1
- update hbm interface

* Tue Nov 26 2024 heppen <hepeng68@huawei.com> - 1.1.0-11
- Bug fix: wrong log print.

* Mon Nov 18 2024 jinye <jinye10@huawei.com> - 1.1.0-10
- Bug fix: Stop eagle cause process block.
- Add some gtest code.

* Mon Jul 15 2024 heppen <hepeng68@huawei.com> - 1.1.0-9
- Bug fix: powerapi-devel start/stop service without pwrapis.service.

* Thu Jun 20 2024 heppen <hepeng68@huawei.com> - 1.1.0-8
- Bug fix: Delete the unnecessary comma in the configuration file

* Thu Jun 18 2024 heppen <hepeng68@huawei.com> - 1.1.0-7
- Bug fix: expand msg buffer, wrong code of check if buffer full.

* Wed Jun 12 2024 Zihao Xue <xuezihao@huawei.com> - 1.1.0-6
- Bug fix: heap buffer overflow caused by sending incomplete strings.
- Bug fix: too long strings into QueryProcs causes services broke down. 

* Thu Jun 6 2024 heppen <hepeng68@huawei.com> - 1.1.0-5
- Bug fix: SIGPIPE cause powerapi server exit.
- Bug fix: pstree command is too slow to get all pid.
- Bug fix: set smart grid state failed.
- Bug fix: get watt attr and task list is not correct.

* Mon Jun 3 2024 heppen <hepeng68@huawei.com> - 1.1.0-4
- Bug fix: memcpy null pointer, array out of bounds, struct align.
- Bug fix: get watt state will failed at the first time.
- Bug fix: use process name to query pid but return all pids.
- Bug fix: mismatch fopen/pclose and popen/fclose, useless if statement.

* Wed May 29 2024 heppen <hepeng68@huawei.com> - 1.1.0-3
- Bug fix: fix build warning.
- Bug fix: export PWR_SYS_GetRtPowerInfo.
- Bug fix: data collection task intercept invalid task type.

* Sat May 25 2024 heppen <hepeng68@huawei.com> - 1.1.0-2
- Bug fix: Incorrect passing of memory address for process list.

* Fri May 17 2024 heppen <hepeng68@huawei.com> - 1.1.0-1
- Add some new APIs about proc/hbm/cpu.

* Wed Apr 3 2024 heppen <hepeng68@huawei.com> - 1.0.1-4
- Add the dependency on ipmitool.
- Fix bug: Coredump when CPU cores number exceed 248 or numa nodes exceed 16.
- Fix some memory bug.

* Sat Mar  9 2024 queyanwen <queyanwen@huawei.com> - 1.0.1-3
- Add the dependency on tar that is omitted in the earlier version.

* Wed Dec  27 2023 xuchongyu <xuchongyu@huawei.com> - 1.0.1-2
- Solve the problem that the client is actively disconnected and the server is incorrect in clearing resources

* Sat Dec  23 2023 queyanwen <queyanwen@huawei.com> - 1.0.1-1
- Change the version number for the first releasing

* Fri Dec  22 2023 queyanwen <queyanwen@huawei.com> - 1.0.0-9
- Solve the problem that the client will coredump if the user is not in the white list

* Fri Dec  22 2023 xuchongyu <xuchongyu@huawei.com> - 1.0.0-8
- Solve the problem that the automatic generation permission of the sockfile path on the server is insufficient
- And ordinary users cannot connect

* Thu Dec  21 2023 xuchongyu <xuchongyu@huawei.com> - 1.0.0-7
- Solve the problem that the illegal frequency range of the PWR_CPU_SetFreq interface is inconsistent with the illegal governor error code
- And the error code returned by the interface with the set frequency range is inappropriate

* Tue Dec  19 2023 xuchongyu <xuchongyu@huawei.com> - 1.0.0-6
- Automatically create the sockfile directory if it does not exist

* Mon Dec  18 2023 queyanwen <queyanwen@huawei.com> - 1.0.0-5
- Solve the coredump problem during CI compilation
- Solve the garbled characters caused by uninitialized string variables

* Mon Dec  18 2023 queyanwen <queyanwen@huawei.com> - 1.0.0-4
- Modify powerapi.spec to support the debug package

* Mon Dec  18 2023 xuchongyu <xuchongyu@huawei.com> - 1.0.0-3
- update souce code:retain debug compilation mode

* Fri Dec  15 2023 xuchongyu <xuchongyu@huawei.com> - 1.0.0-2
- add pwrapis.service

* Tue Dec  5 2023 xuchongyu <xuchongyu@huawei.com> - 1.0.0-1
- init powerapi