From f64c8ce5bb1e72a2c47db79792df79ea4ac5a3c5 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 25 Mar 2020 16:06:39 -0700 Subject: [PATCH] util: Remove the "pin" command from the m5 utility. This command did not use any m5 ops, does the same thing as the "taskset" command under Linux: https://linux.die.net/man/1/taskset and might even have introduced a build error if compiled for any other OS since that would have left a trailing comma in the mainfuncs array. While the last problem would be easy to correct, this is not related to the purpose of this utility (giving access to m5 ops), and is redundant with an existing standard utility provided with Linux. Change-Id: Ie72b9310f5e6264f6035013f47ebe74a27464abb Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27226 Reviewed-by: Ciro Santilli Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- util/m5/src/m5.c | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/util/m5/src/m5.c b/util/m5/src/m5.c index 4d14ed907..d5b27a320 100644 --- a/util/m5/src/m5.c +++ b/util/m5/src/m5.c @@ -38,12 +38,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef linux -#define _GNU_SOURCE -#include - -#endif - #include #include #include @@ -303,31 +297,6 @@ do_sw99param(int argc, char *argv[]) (param >> 12) & 0xfff, (param >> 0) & 0xfff); } -#ifdef linux -void -do_pin(int argc, char *argv[]) -{ - if (argc < 2) - usage(); - - cpu_set_t mask; - CPU_ZERO(&mask); - - const char *sep = ","; - char *target = strtok(argv[0], sep); - while (target) { - CPU_SET(atoi(target), &mask); - target = strtok(NULL, sep); - } - - if (sched_setaffinity(0, sizeof(cpu_set_t), &mask) < 0) - err(1, "setaffinity"); - - execvp(argv[1], &argv[1]); - err(1, "execvp failed!"); -} -#endif - struct MainFunc { char *name; @@ -349,10 +318,7 @@ struct MainFunc mainfuncs[] = { { "loadsymbol", do_loadsymbol, "" }, { "initparam", do_initparam, "[key] // key must be shorter" " than 16 chars" }, - { "sw99param", do_sw99param, "" }, -#ifdef linux - { "pin", do_pin, " [args ...]" } -#endif + { "sw99param", do_sw99param, "" } }; int numfuncs = sizeof(mainfuncs) / sizeof(mainfuncs[0]); -- 2.30.2