Code Monkey home page Code Monkey logo

perfutils's People

Contributors

cstlee avatar hq6 avatar jdellithorpe avatar jspeiser avatar kraftp avatar qianl15 avatar syang0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

perfutils's Issues

Allow user defined `make install` directory

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.

Inconsistent include directory structure between "build" and "install" (CMake)

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.

Include a c wrapper function for TimeTrace::record(timestamp, ...)?

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.