Repository navigation
Conversation
44e75be to
4fb4652
Compare
| } // namespace hyrise | ||
|
|
||
| // Traces until the end of the current scope {} as one slice, and calls trace_event_end automatically. | ||
| #define HYRISE_TRACE_EVENT(category, ...) \ |
There was a problem hiding this comment.
We try to avoid macros as much as possible. And this looks like something doable with modern C++. Can you please try to rewrite?
There was a problem hiding this comment.
Sure we can have wrapper functions on Perfetto's macros. But "TRACE_EVENT" specifically needs to remain a macro however way it's wrapped, as its "end" is triggered by leaving a scope. We don't need it in this PR so we can remove it, but other use cases might benefit from it.
We can also use Perfetto's macros directly... (they don't have an alternative API).
|
I replaced our macros with plain functions, but I'm not sure macros are a bad fit here. Perfetto's API is macro-based by design, and Hyrise does the same in assert.hpp. Happy to switch back to minimal macros if it fits~ |
Bouncner
left a comment
There was a problem hiding this comment.
Cool, looking good. Thanks.
Can you run a TPC-H benchmark on a proper machine (not sidon please) to check the overhead? Just curious.
./hyriseBenchmarkTPCH --scheduler --time 1200 --mode=Shuffled --clients=16 -o output.json or so.
Once with, once without perfette. Release build.
Then you can run ./scripts/compare_benchmark.py with.json without.json
| static auto session = TracingSession{}; | ||
| } | ||
|
|
||
| void trace_event_begin(std::string_view category, std::string_view name) { |
There was a problem hiding this comment.
Code-wise, I like those function now much more. Yes, we have some in Hyrise (asserts) but at least back when we introduced them, they were necessary (e.g., to obtain the code line of the failed assert).
If we can avoid them, we should.
Now the question is, can we really avoid them? I am not sure. The macro previously passed __VA_ARGS__. I don't see any variadics in the C++ part?
|
Oh, and I think we should add the phases for one exemplary operator. Can you please have a look at the "operator steps" we have in the hash join? I'd like to see those in the perfetto traces. |
This PR adds optional tracing with Perfetto. Traces can be explored in the Perfetto UI as a timeline across worker threads. This first step records operator executions only. More detailed tracing will follow in separate PRs.
Changes
third_party. It is only compiled and linked with-DENABLE_PERFETTO=ON(default: OFF).utils/tracing.{hpp,cpp}withHYRISE_TRACE_EVENT*macros. Without Perfetto, they expand to nothing.AbstractOperator::execute()as one slice. The slice carries the operator's description and its input/output row counts as arguments.Usage
Open the resulting file at https://ui.perfetto.dev
Example: TPC-H Q9, SF 1
Single-threaded:

With

scheduler --cores 8:Next steps