Add profiling viewer extension.
ClosedPublic

Authored by NikaWhite on Aug 1 2017, 5:01 AM.

Details

Summary

Due to splitting efl_profiling_viewer to the library this
extension was prepared. This is a first version of extension and will be
improved. After @Deepwarrior will publish code for efl_profiling_viewer that
make possible to work with real time data from efl_debug system, it will
be possible compile clouseau with efl_profiling_viewer support.

Test Plan

Inctall Profiling_Viewer library in the system.
Build clouseau.
Launch clouseau and select Profiling viewer extesion.

Diff Detail

Repository
rCLS tools/clouseau
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 4377
Build 4442: arc lint + arc unit
NikaWhite created this revision.Aug 1 2017, 5:01 AM
NikaWhite updated this revision to Diff 11901.Aug 2 2017, 7:20 AM

Comminication with efl_debugd works fine.

Hi Mykyta,

Thanks for the patch. I tried to compile it but it failed when looking for Efl_Profiler.h, which doesn't exist in my system. You need to check in the cmake file if the profiler lib exists and to compile the extension only if it is ok.

Thoughts?

Daniel

Deepwarrior added inline comments.Aug 2 2017, 10:19 AM
src/lib/extensions/profiling_viewer/main.c
120

Efl Profiler use this signal for initiation global structures for continues processing data from app. Also work with offsets inside profiler require to save all data from stream into log.
It is good time for choose name for this log, I think about /tmp/efl_debug_evlog-<CID>.log.

I propose to replace this callback with
evas_object_smart_callback_call(inf->profiler, "stream,processing,stop", &ext->app_id);

Hi Mykyta,

Thanks for the patch. I tried to compile it but it failed when looking for Efl_Profiler.h, which doesn't exist in my system. You need to check in the cmake file if the profiler lib exists and to compile the extension only if it is ok.

Thoughts?

Daniel

Hi Daniel,
You absolutely right about changes for cmake. I will prepare final version of this patch tomorrow.
The Efl_Profilier.h - is a header from https://git.enlightenment.org/devs/nikawhite/efl_profiler_viewer.git/ library.
But still need wait until @Deepwarrior share latest changes to Profiling Viewer

We are already close to the integration Profiling Viewer in #clouseau.

JackDanielZ added inline comments.Aug 2 2017, 10:52 AM
src/lib/extensions/profiling_viewer/main.c
120

Why do you need a log file? Is there so much data that it cannot stay in memory?

NikaWhite added inline comments.Aug 2 2017, 1:37 PM
src/lib/extensions/profiling_viewer/main.c
120

I have experience when 2 minute log file have size ~500mb. That happened when I traced jobs that executed in idle time.
Actually it depends only from user flow.

NikaWhite updated this revision to Diff 11907.Aug 3 2017, 6:51 AM

Finalize commit. Ready to land.

NikaWhite added projects: Restricted Project, Profiling Viewer (1.0.2).
NikaWhite removed subscribers: JackDanielZ, Deepwarrior.
NikaWhite retitled this revision from Add sceleton for profiling viewer extension. to Add profiling viewer extension..Aug 3 2017, 7:25 AM
NikaWhite edited the summary of this revision. (Show Details)
NikaWhite edited the test plan for this revision. (Show Details)
NikaWhite updated this revision to Diff 11908.Aug 3 2017, 7:38 AM

efl_profiler library isn't mandatory

NikaWhite updated this revision to Diff 11909.Aug 3 2017, 7:40 AM

Remove useless printf

Deepwarrior accepted this revision.Aug 3 2017, 8:17 AM
This revision is now accepted and ready to land.Aug 3 2017, 8:17 AM

Hi guys,

Sorry for the delay, I thought it was approved to I didnt try more :-)

Without the profiler, it compiles well. I just got some warning when doing cmake but it is not critical.
Now, I try to clone the profiler and fail on:
[ 91%] Linking C executable efl_profiling_viewer
CMakeFiles/efl_profiling_viewer.dir/main.c.o: In function `elm_main':
/home/daniel/projects/e/efl_profiler_viewer/src/bin/main.c:234: undefined reference to `efl_profiling_viewer_init'
/home/daniel/projects/e/efl_profiler_viewer/src/bin/main.c:243: undefined reference to `efl_profiling_viewer_shutdown'
collect2: error: ld returned 1 exit status

Do you known where can it come from?

10x
JackDanielZ

Hi @JackDanielZ,
welcome back :)

Your error looks like filed to find libefl_profiler.so in build directory.
Are you use next scenario:

  1. clone project
  2. cd efl_profiling_viewer
  3. mkdir build && cd build
  4. cmake ..
  5. make

?

This is exactly what I do

Here with verbose:
[ 91%] Linking C executable efl_profiling_viewer
cd /home/daniel/e/profiler_viewer/build/src/bin && /usr/bin/cmake -E cmake_link_script CMakeFiles/efl_profiling_viewer.dir/link.txt --verbose=1
/usr/bin/cc -Wall -Wextra -Wshadow -Wno-type-limits -g3 -O0 -Wpointer-arith -fvisibility=hidden -rdynamic CMakeFiles/efl_profiling_viewer.dir/main.c.o -o efl_profiling_viewer -Wl,-rpath,/home/daniel/e/profiler_viewer/build/src/lib:/opt/e/lib: ../lib/libefl_profiler.so /opt/e/lib/libeina.so /opt/e/lib/libeolian.so /opt/e/lib/libecore.so /opt/e/lib/libefl.so /opt/e/lib/libecore_evas.so /opt/e/lib/libecore_file.so /opt/e/lib/libevas.so /opt/e/lib/libedje.so /opt/e/lib/libelementary.so /opt/e/lib/libeet.so
CMakeFiles/efl_profiling_viewer.dir/main.c.o: In function `elm_main':
/home/daniel/e/profiler_viewer/src/bin/main.c:234: undefined reference to `efl_profiling_viewer_init'
/home/daniel/e/profiler_viewer/src/bin/main.c:243: undefined reference to `efl_profiling_viewer_shutdown'
collect2: error: ld returned 1 exit status

When I nm the library, I see the function as: 0000000000003a8a t efl_profiling_viewer_init. I think it should be a 'T' and not a 't'.

A few days ago, I updated my Arch and all efl repos and since then, I have issues when using dlsym to find functions (I had even one in Clouseau). The solution was to force the visibility (I used EAPI).

I tried to define the EAPI in the main.c and to set EAPI for both functions and it works. I dont know if this is the right solution.

JackDanielZ

I am already pushed commit into profiling viewer repository: https://git.enlightenment.org/devs/nikawhite/efl_profiler_viewer.git/commit/?id=b1063411d1d59f9bc2ee75c68dbed4aa7eebea65
Hope this is the same what you mean. :) Otherwise - share your patch to phab.

Sorry but this is not enough.

The problem is that you use the EAPI definition of Elementary that is nothing. Check the end of this file, you will undef and then "define EAPI"

You need your own EAPI definition in Efl_Profiler.h, defined after all the includes and (not mandatory) to include this file into main.c.

Sorry but this is not enough.

The problem is that you use the EAPI definition of Elementary that is nothing. Check the end of this file, you will undef and then "define EAPI"

You need your own EAPI definition in Efl_Profiler.h, defined after all the includes and (not mandatory) to include this file into main.c.

Hi, sorry for só long delay. I am on vacation right now.
In my opinion you should land patch for profiling viewer by yourself. Because personally I can't reproduce it.
So, waiting pushed commit from you. Thanks.

For some reason, the EAPI issues happen only in my computer

Anyway, I pushed the fix in your branch

JackDanielZ added inline comments.Aug 21 2017, 1:28 PM
src/lib/extensions/CMakeLists.txt
4

This variable doesn't help. It works with EFL_PROFILER_FOUND

src/lib/extensions/profiling_viewer/CMakeLists.txt
17

You need to add ${EFL_PROFILER_INCLUDE_DIRS} otherwise it doesn't find the H file.

NikaWhite updated this revision to Diff 12110.Aug 28 2017, 11:43 PM

Update cmake files accordingly to @JackDanielZ comments.

NikaWhite marked 2 inline comments as done.Aug 28 2017, 11:44 PM

This could be final patchset here :)

Hi guys,

Works for me. Good for pushing. Can you push by yourself or do you need me?

JackDanielZ

Push by yourself, because I have a trouble with ssh access to everything due to security reason :(
Thanks.

NikaWhite closed this revision.Sep 1 2017, 4:12 AM