Commit f4f1a0b4 authored by Philip Trettner's avatar Philip Trettner

added explicit access to cycle count

parent 9f9076d9
......@@ -91,6 +91,17 @@ struct visitor
void visit_thread(visitor& v);
#ifdef _WIN32
inline uint64_t current_cycles() { return __rdtsc(); }
#else // Linux/GCC
inline uint64_t current_cycles()
{
unsigned int lo, hi;
__asm__ __volatile__("rdtsc" : "=a"(lo), "=d"(hi));
return ((uint64_t)hi << 32) | lo;
}
#endif
/// writes all trace points to a json file
/// Format:
/// {
......@@ -201,6 +212,6 @@ struct raii_profiler
pd[3] = core;
}
};
}
}
}
} // namespace detail
} // namespace tracing
} // namespace aion
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment