Patchwork [v3] Minor fixes to profile/impl

login
register
mail settings
Submitter Paolo Carlini
Date June 25, 2010, 11:53 a.m.
Message ID <4C2498CF.4070708@oracle.com>
Download mbox | patch
Permalink /patch/56905/
State New
Headers show

Comments

Paolo Carlini - June 25, 2010, 11:53 a.m.
Hi,

tested x86_64-linux check-profile, committed.

Paolo.

///////////////////
2010-06-25  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/profile/impl/profiler_trace.h: Uglify it to __it, use
	everywhere std::size_t instead of size_t.
2010-06-25  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/profile/impl/profiler_list_to_slist.h: Remove spurious
	semicolon; prefer pre-increment.
	* include/profile/impl/profiler_container_size.h: Use everywhere
	qualified std::size_t.
	* include/profile/impl/profiler_trace.h (__trace_base<>::
	__collect_warnings): Tidy loop.
	* include/profile/impl/profiler_vector_to_list.h: Minor formatting
	changes.

Index: include/profile/impl/profiler_list_to_slist.h
===================================================================
--- include/profile/impl/profiler_list_to_slist.h	(revision 161366)
+++ include/profile/impl/profiler_list_to_slist.h	(working copy)
@@ -77,7 +77,7 @@
     }
     
     void
-    __merge(const __list2slist_info&) { };
+    __merge(const __list2slist_info&) { }
 
     void
     __write(FILE* __f) const
@@ -96,7 +96,7 @@
 
     void
     __record_operation()
-    { _M_operations++; }
+    { ++_M_operations; }
 
     bool
     __has_rewind()
Index: include/profile/impl/profiler_container_size.h
===================================================================
--- include/profile/impl/profiler_container_size.h	(revision 161366)
+++ include/profile/impl/profiler_container_size.h	(working copy)
@@ -179,16 +179,16 @@
 
     // Insert a new node at construct with object, callstack and initial size. 
     void
-    __insert(const __object_t __obj, __stack_t __stack, size_t __num)
+    __insert(const __object_t __obj, __stack_t __stack, std::size_t __num)
     { __add_object(__obj, __container_size_info(__stack, __num)); }
 
     // XXX Undefined?
     void
-    __construct(const void* __obj, size_t __inum);
+    __construct(const void* __obj, std::size_t __inum);
   
     // Call at destruction/clean to set container final size.
     void
-    __destruct(const void* __obj, size_t __num, size_t __inum)
+    __destruct(const void* __obj, std::size_t __num, std::size_t __inum)
     {
       if (!__is_on())
 	return;
Index: include/profile/impl/profiler_trace.h
===================================================================
--- include/profile/impl/profiler_trace.h	(revision 161368)
+++ include/profile/impl/profiler_trace.h	(working copy)
@@ -225,12 +225,11 @@
     __trace_base<__object_info, __stack_info>::
     __collect_warnings(__warning_vector_t& __warnings)
     {
-      typename __stack_table_t::iterator __i = __stack_table.begin();
-      for (; __i != __stack_table.end(); ++__i)
-	__warnings.push_back(__warning_data((*__i).second.__magnitude(), 
-					    (*__i).first, 
-					    __id,
-					    (*__i).second.__advice()));
+      for (typename __stack_table_t::iterator __it
+	     = __stack_table.begin(); __it != __stack_table.end(); ++__it)
+	__warnings.push_back(__warning_data((*__it).second.__magnitude(),
+					    (*__it).first, __id,
+					    (*__it).second.__advice()));
     }
 
   template<typename __object_info, typename __stack_info>
Index: include/profile/impl/profiler_vector_to_list.h
===================================================================
--- include/profile/impl/profiler_vector_to_list.h	(revision 161366)
+++ include/profile/impl/profiler_vector_to_list.h	(working copy)
@@ -98,7 +98,8 @@
     __iterate()
     { return _M_iterate; }
 
-    float __list_cost()
+    float
+    __list_cost()
     { return _M_list_cost; }
 
     std::size_t

Patch

Index: include/profile/impl/profiler_trace.h
===================================================================
--- include/profile/impl/profiler_trace.h	(revision 161366)
+++ include/profile/impl/profiler_trace.h	(working copy)
@@ -462,8 +462,8 @@ 
     std::fclose(__raw_file);
 
     // Sort data by magnitude, keeping just top N.
-    size_t __cutoff = std::min(_GLIBCXX_PROFILE_DATA(_S_max_warn_count),
-			       __warnings.size());
+    std::size_t __cutoff = std::min(_GLIBCXX_PROFILE_DATA(_S_max_warn_count),
+				    __warnings.size());
     __top_n(__warnings, __top_warnings, __cutoff);
 
     FILE* __warn_file = __open_output_file("txt");
@@ -564,10 +564,10 @@ 
       if (!__env_value)
         {
           // Look it up in the config file.
-          __env_t::iterator it 
+          __env_t::iterator __it 
 	    = _GLIBCXX_PROFILE_DATA(__env).find(__factor->__env_var);
-          if (it != _GLIBCXX_PROFILE_DATA(__env).end())
-            __env_value = (*it).second.c_str();
+          if (__it != _GLIBCXX_PROFILE_DATA(__env).end())
+            __env_value = (*__it).second.c_str();
         }
 
       if (__env_value)