platformlab / perfutils Goto Github PK
View Code? Open in Web Editor NEWA collection of eclectic tools for measuring performance using the cycle counter and pinning threads.
License: Other
A collection of eclectic tools for measuring performance using the cycle counter and pinning threads.
License: Other
At the moment make install
adds the libraries and headers to the repository's root directory. It would be nice if a user could specify an alternative directory. Some typical ways to do this are to allow the assignment of a PREFIX
variable or a DESTDIR
variable (or both). RAMCloud seems to use INSTALL_DIR
.
I have added gtest to PerfUtils, but I don't currently have the knowledge to add it to CMakeLists.txt
.
@cstlee, please let me know when you have time to look at this together.
Applications of PerfUtils using CMake need to include headers differently depending on whether the application chooses to compile against the "build" copy of PerfUtils or the "install" copy of PerfUtils. At the moment if an application wants to include Cycles.h
using the "build" copy, the application would #include "Cycles.h"
; if using the "install" copy, the application would #include "PerfUtils/Cycles.h"
. This means that applications source code can't be agnostic to how a user might want to make PerfUtils available in their build.
In short, it would be beneficial if the include statements for PerfUtils headers were the same regardless of a users installation preferences.
TimeTrace::record(timestamp, ...)
is quite useful for adding a timetrace entry conditionally based on some value that is available only after the timetrace statement.
diff --git a/cwrapper/timetrace_wrapper.cc b/cwrapper/timetrace_wrapper.cc
index 0a03e8e..dd56626 100644
--- a/cwrapper/timetrace_wrapper.cc
+++ b/cwrapper/timetrace_wrapper.cc
@@ -53,6 +53,19 @@ timetrace_record(const char* format, uint32_t arg0, uint32_t arg1,
}
/**
+ * This function is the wrapper for TimeTrace::record
+ *
+ * Since C does not support default value, caller always needs to pass arg0-3.
+ * Also, we cannot separate definition and declaration of inline function, so
+ * this function cannot be inline function.
+ */
+void
+timetrace_record_ts(uint64_t timestamp, const char* format, uint32_t arg0,
+ uint32_t arg1, uint32_t arg2, uint32_t arg3) {
+ TimeTrace::record(timestamp, format, arg0, arg1, arg2, arg3);
+}
+
+/**
* This function is used to set TimeTrace::keepOldEvents
*/
void
diff --git a/cwrapper/timetrace_wrapper.h b/cwrapper/timetrace_wrapper.h
index 598317d..3c84567 100644
--- a/cwrapper/timetrace_wrapper.h
+++ b/cwrapper/timetrace_wrapper.h
@@ -35,6 +35,15 @@ void timetrace_print();
* uint32_t arg2, uint32_t arg3);
*/
void timetrace_record();
+/**
+ * The real signature of this function is the following. The timestamp and the
+ * format string are mandatory; remaining arguments are only necessary as
+ * specified by format string.
+ * void timetrace_record_ts(uint64_t timestamp, const char* format,
+ * uint32_t arg0, uint32_t arg1, uint32_t arg2,
+ * uint32_t arg3);
+ */
+void timetrace_record_ts();
void timetrace_set_keepoldevents(bool keep);
#ifdef __cplusplus
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.