mirror of
https://github.com/yse/easy_profiler.git
synced 2024-12-27 08:41:02 +08:00
Fix typo in SerializedBlock class name
This commit is contained in:
parent
cae3ab989e
commit
98a3dd7114
@ -28,7 +28,7 @@ include_directories(
|
|||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic -O3" )
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -Wno-reorder -pedantic -O3" )
|
||||||
else()
|
else()
|
||||||
add_definitions(
|
add_definitions(
|
||||||
-D_CRT_SECURE_NO_WARNINGS
|
-D_CRT_SECURE_NO_WARNINGS
|
||||||
|
@ -300,16 +300,16 @@ namespace profiler
|
|||||||
inline const char* getName() const { return name; }
|
inline const char* getName() const { return name; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class PROFILER_API SerilizedBlock
|
class PROFILER_API SerializedBlock
|
||||||
{
|
{
|
||||||
uint16_t m_size;
|
uint16_t m_size;
|
||||||
char* m_data;
|
char* m_data;
|
||||||
public:
|
public:
|
||||||
SerilizedBlock(profiler::Block* block);
|
SerializedBlock(profiler::Block* block);
|
||||||
SerilizedBlock(uint16_t _size, char* _data);
|
SerializedBlock(uint16_t _size, char* _data);
|
||||||
SerilizedBlock(SerilizedBlock&& that);
|
SerializedBlock(SerializedBlock&& that);
|
||||||
SerilizedBlock(const SerilizedBlock& other);
|
SerializedBlock(const SerializedBlock& other);
|
||||||
~SerilizedBlock();
|
~SerializedBlock();
|
||||||
|
|
||||||
const char* const data() const { return m_data; }
|
const char* const data() const { return m_data; }
|
||||||
uint16_t size() const { return m_size; }
|
uint16_t size() const { return m_size; }
|
||||||
|
@ -95,7 +95,7 @@ namespace profiler {
|
|||||||
typedef ::std::list<BlocksTree> children_t;
|
typedef ::std::list<BlocksTree> children_t;
|
||||||
|
|
||||||
children_t children; ///< List of children blocks. May be empty.
|
children_t children; ///< List of children blocks. May be empty.
|
||||||
::profiler::SerilizedBlock* node; ///< Pointer to serilized data (type, name, begin, end etc.)
|
::profiler::SerializedBlock* node; ///< Pointer to serilized data (type, name, begin, end etc.)
|
||||||
::profiler::BlockStatistics* per_parent_stats; ///< Pointer to statistics for this block within the parent (may be nullptr for top-level blocks)
|
::profiler::BlockStatistics* per_parent_stats; ///< Pointer to statistics for this block within the parent (may be nullptr for top-level blocks)
|
||||||
::profiler::BlockStatistics* per_frame_stats; ///< Pointer to statistics for this block within the frame (may be nullptr for top-level blocks)
|
::profiler::BlockStatistics* per_frame_stats; ///< Pointer to statistics for this block within the frame (may be nullptr for top-level blocks)
|
||||||
::profiler::BlockStatistics* per_thread_stats; ///< Pointer to statistics for this block within the bounds of all frames per current thread
|
::profiler::BlockStatistics* per_thread_stats; ///< Pointer to statistics for this block within the bounds of all frames per current thread
|
||||||
|
@ -114,7 +114,7 @@ void TreeModel::setupModelData(const QByteArray &lines, TreeItem *parent)
|
|||||||
|
|
||||||
indentations << 0;
|
indentations << 0;
|
||||||
|
|
||||||
typedef std::map<profiler::timestamp_t, profiler::SerilizedBlock> blocks_map_t;
|
typedef std::map<profiler::timestamp_t, profiler::SerializedBlock> blocks_map_t;
|
||||||
typedef std::map<size_t, blocks_map_t> thread_map_t;
|
typedef std::map<size_t, blocks_map_t> thread_map_t;
|
||||||
thread_map_t blocksList;
|
thread_map_t blocksList;
|
||||||
QByteArray array(lines);
|
QByteArray array(lines);
|
||||||
@ -131,7 +131,7 @@ void TreeModel::setupModelData(const QByteArray &lines, TreeItem *parent)
|
|||||||
profiler::BaseBlockData* baseData = (profiler::BaseBlockData*)data;
|
profiler::BaseBlockData* baseData = (profiler::BaseBlockData*)data;
|
||||||
blocksList[baseData->getThreadId()].emplace(
|
blocksList[baseData->getThreadId()].emplace(
|
||||||
baseData->getBegin(),
|
baseData->getBegin(),
|
||||||
/*std::move(*/profiler::SerilizedBlock(sz, data))/*)*/;
|
/*std::move(*/profiler::SerializedBlock(sz, data))/*)*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ extern "C"{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SerilizedBlock::SerilizedBlock(Block* block):
|
SerializedBlock::SerializedBlock(Block* block):
|
||||||
m_size(0),
|
m_size(0),
|
||||||
m_data(nullptr)
|
m_data(nullptr)
|
||||||
{
|
{
|
||||||
@ -47,7 +47,7 @@ SerilizedBlock::SerilizedBlock(Block* block):
|
|||||||
strncpy(&m_data[sizeof(BaseBlockData)], block->getName(), name_len);
|
strncpy(&m_data[sizeof(BaseBlockData)], block->getName(), name_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
SerilizedBlock::SerilizedBlock(uint16_t _size, char* _data) :
|
SerializedBlock::SerializedBlock(uint16_t _size, char* _data) :
|
||||||
m_size(_size),
|
m_size(_size),
|
||||||
m_data(_data)
|
m_data(_data)
|
||||||
{
|
{
|
||||||
@ -55,7 +55,7 @@ SerilizedBlock::SerilizedBlock(uint16_t _size, char* _data) :
|
|||||||
//memcpy(&m_data[0], _data, m_size);
|
//memcpy(&m_data[0], _data, m_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
SerilizedBlock::~SerilizedBlock()
|
SerializedBlock::~SerializedBlock()
|
||||||
{
|
{
|
||||||
if (m_data){
|
if (m_data){
|
||||||
delete[] m_data;
|
delete[] m_data;
|
||||||
@ -63,14 +63,14 @@ SerilizedBlock::~SerilizedBlock()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SerilizedBlock::SerilizedBlock(const SerilizedBlock& other)
|
SerializedBlock::SerializedBlock(const SerializedBlock& other)
|
||||||
{
|
{
|
||||||
m_size = other.m_size;
|
m_size = other.m_size;
|
||||||
m_data = new char[m_size];
|
m_data = new char[m_size];
|
||||||
memcpy(&m_data[0], other.m_data, m_size);
|
memcpy(&m_data[0], other.m_data, m_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
SerilizedBlock::SerilizedBlock(SerilizedBlock&& that)
|
SerializedBlock::SerializedBlock(SerializedBlock&& that)
|
||||||
{
|
{
|
||||||
m_size = that.m_size;
|
m_size = that.m_size;
|
||||||
m_data = that.m_data;
|
m_data = that.m_data;
|
||||||
@ -78,12 +78,12 @@ SerilizedBlock::SerilizedBlock(SerilizedBlock&& that)
|
|||||||
that.m_data = nullptr;
|
that.m_data = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
const BaseBlockData * SerilizedBlock::block() const
|
const BaseBlockData * SerializedBlock::block() const
|
||||||
{
|
{
|
||||||
return (const BaseBlockData*)m_data;
|
return (const BaseBlockData*)m_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* SerilizedBlock::getBlockName() const
|
const char* SerializedBlock::getBlockName() const
|
||||||
{
|
{
|
||||||
return (const char*)&m_data[sizeof(profiler::BaseBlockData)];
|
return (const char*)&m_data[sizeof(profiler::BaseBlockData)];
|
||||||
}
|
}
|
||||||
@ -150,7 +150,7 @@ void ProfileManager::setEnabled(bool isEnable)
|
|||||||
void ProfileManager::_internalInsertBlock(profiler::Block* _block)
|
void ProfileManager::_internalInsertBlock(profiler::Block* _block)
|
||||||
{
|
{
|
||||||
guard_lock_t lock(m_storedSpin);
|
guard_lock_t lock(m_storedSpin);
|
||||||
m_blocks.emplace_back(new SerilizedBlock(_block));
|
m_blocks.emplace_back(new SerializedBlock(_block));
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int ProfileManager::dumpBlocksToFile(const char* filename)
|
unsigned int ProfileManager::dumpBlocksToFile(const char* filename)
|
||||||
@ -180,6 +180,6 @@ void ProfileManager::setThreadName(const char* name)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
profiler::Block block(name, current_thread_id, 0, profiler::BLOCK_TYPE_THREAD_SIGN);
|
profiler::Block block(name, current_thread_id, 0, profiler::BLOCK_TYPE_THREAD_SIGN);
|
||||||
m_blocks.emplace_back(new SerilizedBlock(&block));
|
m_blocks.emplace_back(new SerializedBlock(&block));
|
||||||
m_namedThreades.insert(current_thread_id);
|
m_namedThreades.insert(current_thread_id);
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ class ProfileManager
|
|||||||
|
|
||||||
void _internalInsertBlock(profiler::Block* _block);
|
void _internalInsertBlock(profiler::Block* _block);
|
||||||
|
|
||||||
typedef std::list<profiler::SerilizedBlock*> serialized_list_t;
|
typedef std::list<profiler::SerializedBlock*> serialized_list_t;
|
||||||
serialized_list_t m_blocks;
|
serialized_list_t m_blocks;
|
||||||
|
|
||||||
set_of_thread_id m_namedThreades;
|
set_of_thread_id m_namedThreades;
|
||||||
|
@ -257,7 +257,7 @@ extern "C"{
|
|||||||
auto& per_thread_statistics = thread_statistics[block_thread_id];
|
auto& per_thread_statistics = thread_statistics[block_thread_id];
|
||||||
|
|
||||||
::profiler::BlocksTree tree;
|
::profiler::BlocksTree tree;
|
||||||
tree.node = new ::profiler::SerilizedBlock(sz, data);
|
tree.node = new ::profiler::SerializedBlock(sz, data);
|
||||||
tree.block_index = blocks_counter++;
|
tree.block_index = blocks_counter++;
|
||||||
|
|
||||||
if (::profiler::BLOCK_TYPE_THREAD_SIGN == baseData->getType())
|
if (::profiler::BLOCK_TYPE_THREAD_SIGN == baseData->getType())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user