[gem5-dev] Change in gem5/gem5[develop]: base: Clean up base/hostinfo

2021-02-19 Thread Daniel Carvalho (Gerrit) via gem5-dev
Daniel Carvalho has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/41393 )


Change subject: base: Clean up base/hostinfo
..

base: Clean up base/hostinfo

General fixes to the style of base/hostinfo.(cc|hh).

Remove unnecessary includes.

Remove signature of private functions from header.

Add documentation.

Remove unnecessary include in sim_events.cc.

Change-Id: I54e1f13231e512d26cf0127cc80256fb5e91bf91
Signed-off-by: Daniel R. Carvalho 
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41393
Reviewed-by: Bobby R. Bruce 
Maintainer: Bobby R. Bruce 
Tested-by: kokoro 
---
M src/base/hostinfo.cc
M src/base/hostinfo.hh
M src/sim/sim_events.cc
3 files changed, 15 insertions(+), 22 deletions(-)

Approvals:
  Bobby R. Bruce: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/base/hostinfo.cc b/src/base/hostinfo.cc
index e835a10..577ab01 100644
--- a/src/base/hostinfo.cc
+++ b/src/base/hostinfo.cc
@@ -26,28 +26,20 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */

+#include "base/hostinfo.hh"
+
 #include 

 #ifdef __APPLE__
 #include 
 #include 
 #include 
-
-#endif
-
-#include "base/hostinfo.hh"
-
-#include 
-#include 
-#include 
+#else
 #include 
-#include 
-#include 
-#include 
+#endif

 #include "base/logging.hh"
 #include "base/str.hh"
-#include "base/types.hh"

 std::string
 __get_hostname()
@@ -65,10 +57,11 @@
 return hostname;
 }

+#ifndef __APPLE__
 uint64_t
 procInfo(const char *filename, const char *target)
 {
-int  done = 0;
+int done = 0;
 char line[80];
 char format[80];
 long usage;
@@ -82,7 +75,7 @@
 sscanf(line, format, );

 fclose(fp);
-return usage ;
+return usage;
 }
 }
 }
@@ -92,6 +85,7 @@

 return 0;
 }
+#endif

 uint64_t
 memUsage()
diff --git a/src/base/hostinfo.hh b/src/base/hostinfo.hh
index 5351cba..3efb6f4 100644
--- a/src/base/hostinfo.hh
+++ b/src/base/hostinfo.hh
@@ -29,20 +29,20 @@
 #ifndef __HOSTINFO_HH__
 #define __HOSTINFO_HH__

+#include 
 #include 

-#include "base/types.hh"
-
-std::string __get_hostname();
-
+/**
+ * Get the host name for the current machine.
+ *
+ * @return The machine's host name.
+ */
 std::string ();

-uint64_t procInfo(const char *filename, const char *target);
-
 /**
  * Determine the simulator process' total virtual memory usage.
  *
- * @return virtual memory usage in kilobytes
+ * @return Virtual memory usage in kilobytes
  */
 uint64_t memUsage();

diff --git a/src/sim/sim_events.cc b/src/sim/sim_events.cc
index af516d3..ba2cda2 100644
--- a/src/sim/sim_events.cc
+++ b/src/sim/sim_events.cc
@@ -45,7 +45,6 @@
 #include 

 #include "base/callback.hh"
-#include "base/hostinfo.hh"
 #include "sim/eventq.hh"
 #include "sim/sim_exit.hh"
 #include "sim/stats.hh"



1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the  
submitted one.

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/41393
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: I54e1f13231e512d26cf0127cc80256fb5e91bf91
Gerrit-Change-Number: 41393
Gerrit-PatchSet: 3
Gerrit-Owner: Daniel Carvalho 
Gerrit-Reviewer: Bobby R. Bruce 
Gerrit-Reviewer: Daniel Carvalho 
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]: base: Clean up base/hostinfo

2021-02-14 Thread Daniel Carvalho (Gerrit) via gem5-dev
Daniel Carvalho has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/41393 )



Change subject: base: Clean up base/hostinfo
..

base: Clean up base/hostinfo

General fixes to the style of base/hostinfo.(cc|hh).

Remove unnecessary includes.

Remove signature of private functions from header.

Add documentation.

Remove unnecessary include in sim_events.cc.

Change-Id: I54e1f13231e512d26cf0127cc80256fb5e91bf91
Signed-off-by: Daniel R. Carvalho 
---
M src/base/hostinfo.cc
M src/base/hostinfo.hh
M src/sim/sim_events.cc
3 files changed, 15 insertions(+), 22 deletions(-)



diff --git a/src/base/hostinfo.cc b/src/base/hostinfo.cc
index e835a10..577ab01 100644
--- a/src/base/hostinfo.cc
+++ b/src/base/hostinfo.cc
@@ -26,28 +26,20 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */

+#include "base/hostinfo.hh"
+
 #include 

 #ifdef __APPLE__
 #include 
 #include 
 #include 
-
-#endif
-
-#include "base/hostinfo.hh"
-
-#include 
-#include 
-#include 
+#else
 #include 
-#include 
-#include 
-#include 
+#endif

 #include "base/logging.hh"
 #include "base/str.hh"
-#include "base/types.hh"

 std::string
 __get_hostname()
@@ -65,10 +57,11 @@
 return hostname;
 }

+#ifndef __APPLE__
 uint64_t
 procInfo(const char *filename, const char *target)
 {
-int  done = 0;
+int done = 0;
 char line[80];
 char format[80];
 long usage;
@@ -82,7 +75,7 @@
 sscanf(line, format, );

 fclose(fp);
-return usage ;
+return usage;
 }
 }
 }
@@ -92,6 +85,7 @@

 return 0;
 }
+#endif

 uint64_t
 memUsage()
diff --git a/src/base/hostinfo.hh b/src/base/hostinfo.hh
index 5351cba..3efb6f4 100644
--- a/src/base/hostinfo.hh
+++ b/src/base/hostinfo.hh
@@ -29,20 +29,20 @@
 #ifndef __HOSTINFO_HH__
 #define __HOSTINFO_HH__

+#include 
 #include 

-#include "base/types.hh"
-
-std::string __get_hostname();
-
+/**
+ * Get the host name for the current machine.
+ *
+ * @return The machine's host name.
+ */
 std::string ();

-uint64_t procInfo(const char *filename, const char *target);
-
 /**
  * Determine the simulator process' total virtual memory usage.
  *
- * @return virtual memory usage in kilobytes
+ * @return Virtual memory usage in kilobytes
  */
 uint64_t memUsage();

diff --git a/src/sim/sim_events.cc b/src/sim/sim_events.cc
index af516d3..ba2cda2 100644
--- a/src/sim/sim_events.cc
+++ b/src/sim/sim_events.cc
@@ -45,7 +45,6 @@
 #include 

 #include "base/callback.hh"
-#include "base/hostinfo.hh"
 #include "sim/eventq.hh"
 #include "sim/sim_exit.hh"
 #include "sim/stats.hh"

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/41393
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: I54e1f13231e512d26cf0127cc80256fb5e91bf91
Gerrit-Change-Number: 41393
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho 
Gerrit-MessageType: newchange
___
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