0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-28 17:28:14 +08:00

Merge branch 'event_tracing' of https://github.com/yse/easy_profiler into event_tracing

This commit is contained in:
Victor Zarubkin 2016-09-07 21:52:40 +03:00
commit 68bbd0eef3
8 changed files with 109 additions and 97 deletions

View File

@ -26,13 +26,21 @@ along with this program.If not, see <http://www.gnu.org/licenses/>.
# define EASY_THREAD_LOCAL __declspec(thread)
# endif
#elif defined(__GNUC__)
#ifndef __clang__
# if (__GNUC__ == 4 && __GNUC_MINOR__ < 8) || (__GNUC__ < 4)
// There is no support for C++11 thread_local keyword prior to gcc 4.8. Use __thread instead.
# define EASY_THREAD_LOCAL __thread
#endif
# endif
#if defined ( __clang__ )
# if (__clang_major__ == 3 && __clang_minor__ < 3) || (__clang_major__ < 3)
# define EASY_THREAD_LOCAL __thread
#endif
#endif
// TODO: Check thread_local support for Clang!
#endif
// TODO: Check thread local support for clanv earlier than 3.3
#ifndef EASY_THREAD_LOCAL
# define EASY_THREAD_LOCAL thread_local

View File

@ -84,7 +84,7 @@ const QRgb TIMELINE_BACKGROUND = 0x20303030;
const QRgb SELECTED_ITEM_COLOR = 0x000050a0;
const QColor CHRONOMETER_COLOR2 = QColor::fromRgba(0x40408040);
const unsigned int TEST_PROGRESSION_BASE = 4;
//const unsigned int TEST_PROGRESSION_BASE = 4;
const int FLICKER_INTERVAL = 16; // 60Hz

View File

@ -211,7 +211,7 @@ public:
void setHover(bool _hover);
bool contains(const QPointF& _pos) const;
bool contains(const QPointF& _pos) const override;
inline bool hoverIndicator() const
{

View File

@ -41,7 +41,7 @@
//////////////////////////////////////////////////////////////////////////
const qreal SCALING_COEFFICIENT = 1.25;
const qreal SCALING_COEFFICIENT_INV = 1.0 / SCALING_COEFFICIENT;
//const qreal SCALING_COEFFICIENT_INV = 1.0 / SCALING_COEFFICIENT;
const int DEFAULT_TOP = -40;
const int DEFAULT_HEIGHT = 80;
const int INDICATOR_SIZE = 8;
@ -490,7 +490,6 @@ void EasyGraphicsScrollbar::mouseMoveEvent(QMouseEvent* _event)
void EasyGraphicsScrollbar::wheelEvent(QWheelEvent* _event)
{
qreal deltaSign = _event->delta() < 0 ? -1 : 1;
auto w = m_slider->halfwidth() * (_event->delta() < 0 ? ::profiler_gui::SCALING_COEFFICIENT : ::profiler_gui::SCALING_COEFFICIENT_INV);
setValue(mapToScene(_event->pos()).x() - m_minimumValue - w);
emit wheeled(w * m_windowScale, _event->delta());

View File

@ -97,13 +97,13 @@ public:
const uint16_t SIZEOF_CSWITCH = sizeof(profiler::BaseBlockData) + 1;
class ThreadStorage final
{
typedef std::vector<profiler::SerializedBlock*> serialized_list_t;
typedef std::vector<profiler::SerializedBlock*> serialized_list_t;
template <class T, const uint16_t N>
struct BlocksList final
{
BlocksList() = default;
template <class T, const uint16_t N>
struct BlocksList final
{
class Stack final {
//std::stack<T> m_stack;
std::vector<T> m_stack;
@ -144,8 +144,11 @@ class ThreadStorage final
alloc.clear();
usedMemorySize = 0;
}
};
};
class ThreadStorage final
{
public:
BlocksList<std::reference_wrapper<profiler::Block>, SIZEOF_CSWITCH * (uint16_t)1024U> blocks;
@ -156,6 +159,8 @@ public:
void storeBlock(const profiler::Block& _block);
void storeCSwitch(const profiler::Block& _block);
void clearClosed();
ThreadStorage() = default;
};
//////////////////////////////////////////////////////////////////////////