[Profiler] Add basic profilerlistener
authorJihoon Lee <jhoon.it.lee@samsung.com>
Wed, 9 Dec 2020 07:23:03 +0000 (16:23 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Tue, 15 Dec 2020 04:57:32 +0000 (13:57 +0900)
commitfa8093139cc056445bb76b8df65f1265679c8e6e
treeb16e18645bdddf98254091111db5098ae890734e
parente1398e3e10e04b63b2d53fce782e8ac369df9080
[Profiler] Add basic profilerlistener

This patch adds global profiler listener for various purpose

From this patch,
1. Profiler can called globally with designated event key
2. Listener reporting suite included
3. Enum key has changed to int key to deal with unhashable
key compile error in few platforms.

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

v2)
1. Change listener to RAII object (with forcing profiler, event
designation)
2. Add unsubscribe method
3. Change event register to set to prevent notifying a listener twice
4. Change semintics to not allow adding same listener twice

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
nntrainer/models/neuralnet.cpp
nntrainer/utils/profiler.cpp
nntrainer/utils/profiler.h
test/unittest/unittest_nntrainer_profiler.cpp