[gem5-dev] Change in gem5/gem5[develop]: util: Remove the "pin" command from the m5 utility.

2020-04-27 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has submitted this change. (  
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
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 
---
M util/m5/src/m5.c
1 file changed, 1 insertion(+), 35 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  Ciro Santilli: Looks good to me, but someone else must approve
  kokoro: Regressions pass



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 
-
-#endif
-
 #include 
 #include 
 #include 
@@ -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();
-
-const char *sep = ",";
-char *target = strtok(argv[0], sep);
-while (target) {
-CPU_SET(atoi(target), );
-target = strtok(NULL, sep);
-}
-
-if (sched_setaffinity(0, sizeof(cpu_set_t), ) < 0)
-err(1, "setaffinity");
-
-execvp(argv[1], [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,  "  [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: 10
Gerrit-Owner: Gabe Black 
Gerrit-Reviewer: Bobby R. Bruce 
Gerrit-Reviewer: Ciro Santilli 
Gerrit-Reviewer: Earl Ou 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Giacomo Travaglini 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Yu-hsin Wang 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s


[gem5-dev] Change in gem5/gem5[develop]: util: Remove the "pin" command from the m5 utility.

2020-03-27 Thread Gabe Black (Gerrit)
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 
-
-#endif
-
 #include 
 #include 
 #include 
@@ -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();
-
-const char *sep = ",";
-char *target = strtok(argv[0], sep);
-while (target) {
-CPU_SET(atoi(target), );
-target = strtok(NULL, sep);
-}
-
-if (sched_setaffinity(0, sizeof(cpu_set_t), ) < 0)
-err(1, "setaffinity");
-
-execvp(argv[1], [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,  "  [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 
Gerrit-MessageType: newchange
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev