Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/27226 )

Change subject: util: Remove the "pin" command from the m5 utility.
......................................................................

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
---
M util/m5/src/m5.c
1 file changed, 1 insertion(+), 35 deletions(-)



diff --git a/util/m5/src/m5.c b/util/m5/src/m5.c
index 4d14ed9..d5b27a3 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 <sched.h>
-
-#endif
-
 #include <err.h>
 #include <fcntl.h>
 #include <inttypes.h>
@@ -303,31 +297,6 @@
            (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 @@
     { "loadsymbol",     do_loadsymbol,       "" },
     { "initparam",      do_initparam,        "[key] // key must be shorter"
                                              " than 16 chars" },
-    { "sw99param",      do_sw99param,        "" },
-#ifdef linux
-    { "pin",            do_pin,              "<cpu> <program> [args ...]" }
-#endif
+    { "sw99param",      do_sw99param,        "" }
 };
 int numfuncs = sizeof(mainfuncs) / sizeof(mainfuncs[0]);


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/27226
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ie72b9310f5e6264f6035013f47ebe74a27464abb
Gerrit-Change-Number: 27226
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabebl...@google.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to