Changeset 409 for trunk/src/core
- Timestamp:
- 06/21/15 02:44:51 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/profiler.cc
r402 r409 20 20 profiler::profiler() 21 21 { 22 m_root = new node( "root" , nullptr );22 m_root = new node( "root"_hls64, nullptr ); 23 23 m_root->start(); 24 24 m_current = m_root; … … 30 30 } 31 31 32 void profiler::start_profile( const string_view& tag )32 void profiler::start_profile( string_type&& tag ) 33 33 { 34 34 if ( tag != m_current->m_tag ) 35 35 { 36 m_current = m_current->request_child( tag);36 m_current = m_current->request_child( ::nv::move( tag ) ); 37 37 } 38 38 m_current->start(); … … 47 47 } 48 48 49 profiler::node::node( const string_view&tag, node* parent )50 : m_tag( tag.to_string() )49 profiler::node::node( string_view tag, node* parent ) 50 : m_tag( ::nv::move( tag ) ) 51 51 , m_parent( parent ) 52 52 , m_recusion( 0 ) … … 58 58 } 59 59 60 profiler::node* profiler::node::request_child( const string_view& tag )60 profiler::node* profiler::node::request_child( string_type&& tag ) 61 61 { 62 std::string stag( tag.to_string() ); 63 auto it = m_children.find( stag ); 62 auto it = m_children.find( tag ); 64 63 if ( it != m_children.end() ) 65 64 return it->second; … … 67 66 { 68 67 node* result = new node( tag, this ); 69 m_children [ stag ] = result;68 m_children.assign( ::nv::move( tag ), result ); 70 69 return result; 71 70 } … … 131 130 if ( indent > 0 ) nvmemset( buffer, '-', indent ); 132 131 snprintf( buffer + indent, 128 - indent, "%*.*s %6.2f %6d %9.2f %6.2f", indent - 23, 23 - indent, 133 c->m_tag. c_str(), pparent, calls, total_ms, avg_ms );132 c->m_tag.data(), pparent, calls, total_ms, avg_ms ); 134 133 NV_LOG_INFO( string_view( buffer, nvstrlen( buffer ) ) ); 135 134 if ( c->m_children.size() > 0 )
Note: See TracChangeset
for help on using the changeset viewer.