New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ITT traces to GStreamingExecutor #19917
Added ITT traces to GStreamingExecutor #19917
Conversation
ff8bb51
to
3757ce2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks cool!
66a90b7
to
09a5fa9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe SyncQueue instrumentation can be dropped for now as it only bloats the trace and is nearly equal to StreamingInput::get and so on. Overall well done!
backend_name = matches[1].str(); | ||
island_name = island_name + "_" + backend_name; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If match fails, I'd use the full backend type name instead of nothing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Full backend name will contain some mangled symbhols and numbers which are maps to "::" namespace resolution operator, is it applicable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please use the full name in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed!
9ad402b
to
a2b654a
Compare
7caf350
to
d8ece4a
Compare
Hi Anton(@anton-potapov)! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think TBB changes are ok and you can proceed with merge after fixing the non-regular island name handling.
if (std::regex_search(backend_impl_type_name, matches, rgx)) { | ||
if (2ul == matches.size()) { | ||
backend_name = matches[1].str(); | ||
island_name = island_name + "_" + backend_name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+= ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is reworked!
backend_name = matches[1].str(); | ||
island_name = island_name + "_" + backend_name; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please use the full name in that case.
@@ -1443,6 +1491,13 @@ void cv::gimpl::GStreamingExecutor::setSource(GRunArgs &&ins) | |||
out_queues.push_back(reader_queues(*m_island_graph, out_eh)); | |||
} | |||
|
|||
// Create just empty island meta information | |||
std::string island_meta_info { }; | |||
#if defined(OPENCV_WITH_ITT) && !defined(GAPI_STANDALONE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw whats wrong with STANDALONE here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
Thanks a lot!
I have realized that OPENCV_WITH_ITT
will be defined only if ITT dependency will be successfully resolved, what can be done only if we building with OpenCV. So, there will be no such define in G-API standalone mode and check for !GAPI_STANDALONE
is extra.
I have added a comment about this in itt.hpp
file and TODO
to support ITT traces in GAPI standalone mode in CMakeLists.txt
.
@@ -290,7 +292,8 @@ namespace GIslandModel | |||
// from the original model (! don't mix with DataSlot) | |||
// FIXME: GAPI_EXPORTS because of tests only! | |||
ade::NodeHandle GAPI_EXPORTS producerOf(const ConstGraph &g, ade::NodeHandle &data_nh); | |||
|
|||
// traceName - returns pretty island name for passed island node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe in should be traceIslandName
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Anton!!
a6faabb
to
96e2e5a
Compare
96e2e5a
to
12170ab
Compare
Hi Maxim(@mshabunin), Alexander(@alalek)! |
12170ab
to
6d630ab
Compare
std::string backend_name = ""; | ||
auto& backend_impl = island_ptr->backend().priv(); | ||
std::string backend_impl_type_name = typeid(backend_impl).name(); | ||
std::regex rgx("G([a-zA-Z0-9]+)BackendImpl"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::regex
is not working in GCC<4.9 (https://stackoverflow.com/questions/12530406/is-gcc-4-8-or-earlier-buggy-about-regular-expressions), but we still kinda support CentOS 7 which uses GCC 4.8.5. Is it possible to rewrite this part without regex usage?
f82892a
to
4568709
Compare
4568709
to
3a49ff9
Compare
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.