hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/tools/testing/selftests/powerpc/benchmarks/context_switch.c
....@@ -1,12 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Context switch microbenchmark.
34 *
45 * Copyright (C) 2015 Anton Blanchard <anton@au.ibm.com>, IBM
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License
8
- * as published by the Free Software Foundation; either version
9
- * 2 of the License, or (at your option) any later version.
106 */
117
128 #define _GNU_SOURCE
....@@ -485,6 +481,12 @@
485481 else
486482 printf("futex");
487483
484
+ if (!have_hwcap(PPC_FEATURE_HAS_ALTIVEC))
485
+ touch_altivec = 0;
486
+
487
+ if (!have_hwcap(PPC_FEATURE_HAS_VSX))
488
+ touch_vector = 0;
489
+
488490 printf(" on cpus %d/%d touching FP:%s altivec:%s vector:%s vdso:%s\n",
489491 cpu1, cpu2, touch_fp ? "yes" : "no", touch_altivec ? "yes" : "no",
490492 touch_vector ? "yes" : "no", touch_vdso ? "yes" : "no");