Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
a2642d83
Commit
a2642d83
authored
Dec 09, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16093 from alalek:core_itt_thread_name_16072
parents
a4cb9146
816f8268
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
parallel_impl.cpp
modules/core/src/parallel_impl.cpp
+5
-0
system.cpp
modules/core/src/system.cpp
+10
-0
No files found.
modules/core/src/parallel_impl.cpp
View file @
a2642d83
...
...
@@ -16,6 +16,8 @@
//#define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_VERBOSE + 1
#include <opencv2/core/utils/logger.hpp>
#include <opencv2/core/utils/trace.private.hpp>
//#define CV_PROFILE_THREADS 64
//#define getTickCount getCPUTickCount // use this if getTickCount() calls are expensive (and getCPUTickCount() is accurate)
...
...
@@ -276,6 +278,9 @@ public:
void
thread_body
();
static
void
*
thread_loop_wrapper
(
void
*
thread_object
)
{
#ifdef OPENCV_WITH_ITT
__itt_thread_set_name
(
cv
::
format
(
"OpenCVThread-%03d"
,
cv
::
utils
::
getThreadID
()).
c_str
());
#endif
((
WorkerThread
*
)
thread_object
)
->
thread_body
();
return
0
;
}
...
...
modules/core/src/system.cpp
View file @
a2642d83
...
...
@@ -1888,6 +1888,15 @@ BOOL WINAPI DllMain(HINSTANCE, DWORD fdwReason, LPVOID lpReserved)
namespace
{
#ifdef OPENCV_WITH_ITT
bool
overrideThreadName
()
{
static
bool
param
=
utils
::
getConfigurationParameterBool
(
"OPENCV_TRACE_ITT_SET_THREAD_NAME"
,
false
);
return
param
;
}
#endif
static
int
g_threadNum
=
0
;
class
ThreadID
{
public
:
...
...
@@ -1896,6 +1905,7 @@ public:
id
(
CV_XADD
(
&
g_threadNum
,
1
))
{
#ifdef OPENCV_WITH_ITT
if
(
overrideThreadName
())
__itt_thread_set_name
(
cv
::
format
(
"OpenCVThread-%03d"
,
id
).
c_str
());
#endif
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment