"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "stress-affinity.c" between
stress-ng-0.12.09.tar.xz and stress-ng-0.12.10.tar.xz

About: stress-ng will stress test a computer system in various selectable ways. It was designed to exercise various physical subsystems of a computer as well as the various operating system kernel interfaces.

stress-affinity.c  (stress-ng-0.12.09.tar.xz):stress-affinity.c  (stress-ng-0.12.10.tar.xz)
skipping to change at line 205 skipping to change at line 205
stress_affinity_reap(pids); stress_affinity_reap(pids);
} }
static int stress_affinity(const stress_args_t *args) static int stress_affinity(const stress_args_t *args)
{ {
const uint32_t cpus = (uint32_t)stress_get_processors_configured(); const uint32_t cpus = (uint32_t)stress_get_processors_configured();
bool affinity_rand = false; bool affinity_rand = false;
pid_t pids[STRESS_AFFINITY_PROCS]; pid_t pids[STRESS_AFFINITY_PROCS];
size_t i; size_t i;
size_t counters_sz = ((sizeof(uint64_t) * (STRESS_AFFINITY_PROCS)) + args
->page_size)
& ~(args->page_size - 1);
uint64_t *counters; uint64_t *counters;
size_t counters_sz = ((sizeof(*counters) * (STRESS_AFFINITY_PROCS)) + arg
s->page_size)
& ~(args->page_size - 1);
(void)stress_get_setting("affinity-rand", &affinity_rand); (void)stress_get_setting("affinity-rand", &affinity_rand);
counters = (uint64_t *)mmap(NULL, counters_sz, PROT_READ | PROT_WRITE, counters = (uint64_t *)mmap(NULL, counters_sz, PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_ANONYMOUS, -1, 0); MAP_SHARED | MAP_ANONYMOUS, -1, 0);
if (!counters) { if (!counters) {
pr_inf("%s: cannot mmap %zd bytes for shared counters, skipping s tressor\n", pr_inf("%s: cannot mmap %zd bytes for shared counters, skipping s tressor\n",
args->name, counters_sz); args->name, counters_sz);
return EXIT_NO_RESOURCE; return EXIT_NO_RESOURCE;
} }
 End of changes. 2 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)