MCPcopy Create free account
hub / github.com/F-Stack/f-stack / check_power_get_freq

Function check_power_get_freq

dpdk/app/test/test_power_cpufreq.c:185–212  ·  view source on GitHub ↗

Check rte_power_get_freq() */

Source from the content-addressed store, hash-verified

183
184/* Check rte_power_get_freq() */
185static int
186check_power_get_freq(void)
187{
188 int ret;
189 uint32_t count;
190
191 /* test with an invalid lcore id */
192 count = rte_power_get_freq(TEST_POWER_LCORE_INVALID);
193 if (count < TEST_POWER_FREQS_NUM_MAX) {
194 printf("Unexpectedly get freq index successfully on "
195 "lcore %u\n", TEST_POWER_LCORE_INVALID);
196 return -1;
197 }
198
199 count = rte_power_get_freq(TEST_POWER_LCORE_ID);
200 if (count >= TEST_POWER_FREQS_NUM_MAX) {
201 printf("Fail to get the freq index on lcore %u\n",
202 TEST_POWER_LCORE_ID);
203 return -1;
204 }
205
206 /* Check the current frequency */
207 ret = check_cur_freq(TEST_POWER_LCORE_ID, count, false);
208 if (ret < 0)
209 return -1;
210
211 return 0;
212}
213
214/* Check rte_power_set_freq() */
215static int

Callers 1

test_power_cpufreqFunction · 0.85

Calls 2

check_cur_freqFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected