sdk/tools/profctl.git
15 months agoMerge pull request #19 from dotnet/add_release_to_version_file accepted/tizen_7.0_unified accepted/tizen_8.0_unified accepted/tizen_unified accepted/tizen_unified_x tizen tizen_7.0 tizen_8.0 tizen_dev accepted/tizen/7.0/unified/20230503.111428 accepted/tizen/8.0/unified/20231005.100154 accepted/tizen/unified/20230504.054923 accepted/tizen/unified/x/20240629.053321 tizen_8.0_m2_release
Gleb Balykov/Advanced System SW Lab /SRR/Staff Engineer/Samsung Electronics [Fri, 14 Apr 2023 14:28:30 +0000 (17:28 +0300)]
Merge pull request #19 from dotnet/add_release_to_version_file

Add release info to version file

17 months agoAdd release info to version file
Hyungju Lee [Mon, 20 Feb 2023 08:55:24 +0000 (17:55 +0900)]
Add release info to version file

Change-Id: I9ce9b3a707b00ad40338c430ddf29dbb4b4b2635

2 years agoFix shadow declaration warnings. accepted/tizen_6.5_unified accepted/tizen_7.0_unified_hotfix tizen_6.5 tizen_7.0_hotfix accepted/tizen/6.5/unified/20211028.225519 accepted/tizen/7.0/unified/20221110.060254 accepted/tizen/7.0/unified/hotfix/20221116.112222 accepted/tizen/unified/20210926.235752 submit/tizen/20210924.180757 submit/tizen_6.5/20211028.164101 tizen_6.5.m2_release tizen_7.0_m2_release
Mikhail Kurinnoi [Fri, 24 Sep 2021 13:44:39 +0000 (06:44 -0700)]
Fix shadow declaration warnings.

3 years agoCreate version file
Alexander Soldatov [Thu, 15 Oct 2020 12:47:53 +0000 (15:47 +0300)]
Create version file

4 years agoAdd gbs arm64 build support. accepted/tizen_6.0_unified accepted/tizen_6.0_unified_hotfix tizen_6.0 tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.102615 accepted/tizen/6.0/unified/hotfix/20201103.044950 accepted/tizen/unified/20200824.134520 submit/tizen/20200821.035904 submit/tizen_6.0/20201029.205506 submit/tizen_6.0_hotfix/20201102.192906 submit/tizen_6.0_hotfix/20201103.115106 tizen_6.0.m2_release
Mikhail Kurinnoi [Mon, 13 Jul 2020 09:43:30 +0000 (12:43 +0300)]
Add gbs arm64 build support.

4 years agoFixing multiple issues in "profctl" program accepted/tizen_5.5_unified accepted/tizen_5.5_unified_wearable_hotfix tizen_5.5 tizen_5.5_wearable_hotfix accepted/tizen/5.5/unified/20200519.155015 accepted/tizen/5.5/unified/wearable/hotfix/20201027.092116 accepted/tizen/unified/20200515.081433 submit/tizen/20200515.062155 submit/tizen_5.5/20200515.062629 submit/tizen_5.5_wearable_hotfix/20201026.1843010 submit/tizen_5.5_wearable_hotfix/20201027.114701
Kirill Frolov [Mon, 23 Sep 2019 16:36:35 +0000 (19:36 +0300)]
Fixing multiple issues in "profctl" program
(related to program termination, and other):

Detailed list of changes:

1) profiling data pipe (`pipe_fd`) is opened in non-blocking mode (to
avoid blocking until external process starts) and made non-blocking for
reading;

2) start using raw file descriptor (`pipe_fd`) instead of libc file
(`pipef`) for reading end of data pipe;

3) control socket renamed from `control_socket` to `control_fd` (this
might be non socket, but any file) and made non-blocking for reading;

4) libc file `ctrl_file_in` isn't used anymore for reading control
socket (raw file descriptor is used directly);

5) libc file (`data_file_out`) isn't used anymore for writing profiling
data (raw file descriptor is used directly);

6) global variable `global_stop` eliminated, instead pipe `stop_pipe` is
used for stopping parallel threads;

7) second pipe `chld_pipe` used to process SIGCHLD synchronously (in
main loop);

8) flags which shows that particular thread terminated not used anymore;

9) MAIN CHANGE: not using anymore c-library functions from reading data
from non-blocking pipes or sockets (`pipe_fd` and `control_fd`), using
read(2) syscall with select(2) -- this allows correctly terminate
threads which blocks on reading from pipe or socket;

10) when copying data from data pipe (`pipe_fd`) to socket
(`data_socket`), using splice(2) system call (linux specific) to avoid
unnecessary copying via userspace;

11) external process starts after all sockets opened, but not before (to
simplify error handling), also stdin/stdout not closed begore exec, but
replaced to "/dev/null", stderr is never closed to allow errors
reporting;

12) in main loop (in main() function) only three reasons to terminate
application exists:

   * closing control file/socket/pipe;
   * "exit" command sent in control pipe;
   * external process termination.

If external process closes data pipe, if data copying thread fails, if
statistics thread fails -- none of this will terminate application, it
will wait until one of the three events listed above.

13) rewritten thread termination logic (now using just pthread_join() in
regular way);

14) rewritten code for extern program termination logic;

15) added -Wall and -Wextra CMakeLists.txt, fixed warnings;

16) added "--help" option to command line arguments;

17) fixed issue with wrong terminal settings on exit;

18) commented out code which closes stdin/stdout/stderr and calls
raise(SIGKILL) -- I not understood why this need, looks like some dirty
trick to avoid other bugs.

profctl.c file modified (see below)

Detailed list of changes:

1) code changed accordig code review comments;
2) reporting of dotnet-launcher exit code via socket;
3) fixed bug (SEGFAULT on exit when no stat thread started);
4) fixed few issues with non-blocking IO;
5) added FD_CLOEXEC for most files;
6) removed terminal-controlling functions (not needed);
7) removed close_files_and_sockets() function (not needed, because of using FD_CLOSEXEC option);
8) watching for helper process termination and log errors;
9) fixed issues with unexpected helper process termination;
10) fixed bugs/warnings.

profctl.c: added more comments, no program's logic changed.

profctl.c: redirect stderr of child processes to the log.

profctl.c: fixed bug -- 100% cpu load in data copying thread.

profctl.c: increase pipe size for helper process to avoid unwanted delays

profctl.c: setting pipe size for heaptrack_interpret

Increasing pipe buffer size at OS level might avoid program stops in
cases, when heaptrack_interpret works too slow.

Previously logger thread might hang if child process doesn't close other
end of the pipe.

5 years agoMerge pull request #9 from i-kulaychuk/fix-build accepted/tizen_5.5_unified_mobile_hotfix tizen_5.5_mobile_hotfix tizen_5.5_tv accepted/tizen/5.5/unified/20191031.004607 accepted/tizen/5.5/unified/mobile/hotfix/20201027.061028 accepted/tizen/unified/20190830.040744 submit/tizen/20190828.045909 submit/tizen_5.5/20191031.000009 submit/tizen_5.5_mobile_hotfix/20201026.1851010 submit/tizen_5.5_mobile_hotfix/20201027.114301 tizen_5.5.m2_release
Igor Kulaychuk/AI Ecosystem Lab /SRR/Engineer/삼성전자 [Tue, 18 Dec 2018 09:06:49 +0000 (12:06 +0300)]
Merge pull request #9 from i-kulaychuk/fix-build

Fix macro for checking strerror_r() variant

5 years agoFix macro for checking strerror_r() variant
Igor Kulaychuk [Fri, 14 Dec 2018 11:56:08 +0000 (14:56 +0300)]
Fix macro for checking strerror_r() variant

5 years agoMerge pull request #8 from i-kulaychuk/fix-svace-errors
Igor Kulaychuk/AI Ecosystem Lab /SRR/Engineer/삼성전자 [Thu, 13 Dec 2018 14:17:06 +0000 (17:17 +0300)]
Merge pull request #8 from i-kulaychuk/fix-svace-errors

Fix SVACE errors

5 years agoFix localtime thread-safety issue - use localtime_r
Igor Kulaychuk [Thu, 13 Dec 2018 12:15:05 +0000 (15:15 +0300)]
Fix localtime thread-safety issue - use localtime_r

5 years agoFix strerror thread-safety issue - use strerror_r
Igor Kulaychuk [Thu, 13 Dec 2018 12:13:29 +0000 (15:13 +0300)]
Fix strerror thread-safety issue - use strerror_r

5 years agoFix gmtime thread-safety issue - use gmtime_r
Igor Kulaychuk [Thu, 13 Dec 2018 12:07:10 +0000 (15:07 +0300)]
Fix gmtime thread-safety issue - use gmtime_r

5 years agoCheck malloc result
Igor Kulaychuk [Thu, 13 Dec 2018 12:01:18 +0000 (15:01 +0300)]
Check malloc result

5 years agoFix missing return values
Igor Kulaychuk [Thu, 13 Dec 2018 11:46:37 +0000 (14:46 +0300)]
Fix missing return values

5 years agoRemove appid option accepted/tizen_5.0_unified tizen_5.0 accepted/tizen/5.0/unified/20181102.031931 accepted/tizen/5.0/unified/20181106.202146 accepted/tizen/unified/20180912.061704 accepted/tizen/unified/20180912.061708 submit/tizen/20180911.125435 submit/tizen/20180911.141534 submit/tizen/20180912.070240 submit/tizen_5.0/20181101.000009 submit/tizen_5.0/20181106.000001
Aleksei Vereshchagin [Wed, 5 Sep 2018 16:29:13 +0000 (19:29 +0300)]
Remove appid option

5 years agoPipe creation refactoring
Aleksei Vereshchagin [Wed, 5 Sep 2018 16:26:17 +0000 (19:26 +0300)]
Pipe creation refactoring

5 years agoAdd setup additional environment for command launch option
Aleksei Vereshchagin [Wed, 5 Sep 2018 15:26:07 +0000 (18:26 +0300)]
Add setup additional environment for command launch option

5 years agoClose stdin/out/err
Aleksei Vereshchagin [Thu, 6 Sep 2018 18:31:53 +0000 (21:31 +0300)]
Close stdin/out/err

5 years agoAdd possibility to launch commands via profctl
Aleksei Vereshchagin [Tue, 4 Sep 2018 20:20:21 +0000 (23:20 +0300)]
Add possibility to launch commands via profctl

5 years agoMore strict options handling
Aleksei Vereshchagin [Tue, 4 Sep 2018 19:45:29 +0000 (22:45 +0300)]
More strict options handling

5 years agomodifications to make possible profiling using one profctl instance
Alexey Chernobaev [Mon, 3 Sep 2018 16:55:42 +0000 (19:55 +0300)]
modifications to make possible profiling using one profctl instance

5 years agoFix CPU count calculation for one-CPU systems
Aleksei Vereshchagin [Tue, 4 Sep 2018 15:31:44 +0000 (18:31 +0300)]
Fix CPU count calculation for one-CPU systems

5 years agoRemove AUL from sources
Aleksei Vereshchagin [Fri, 31 Aug 2018 18:38:16 +0000 (21:38 +0300)]
Remove AUL from sources

5 years agostop profctl if controlled application finished
Alexey Chernobaev [Fri, 31 Aug 2018 17:16:36 +0000 (20:16 +0300)]
stop profctl if controlled application finished

5 years agoSet USE_AUL to FALSE
Aleksei Vereshchagin [Thu, 30 Aug 2018 19:03:17 +0000 (22:03 +0300)]
Set USE_AUL to FALSE

5 years agoRemove AUL to avoid User::Shell access level need
Aleksei Vereshchagin [Thu, 30 Aug 2018 18:53:49 +0000 (21:53 +0300)]
Remove AUL to avoid User::Shell access level need

5 years agofinish profctl in case of command stream EOF or read error
Alexey Chernobaev [Thu, 30 Aug 2018 18:58:05 +0000 (21:58 +0300)]
finish profctl in case of command stream EOF or read error

5 years agobetter logging
Alexey Chernobaev [Thu, 30 Aug 2018 17:58:15 +0000 (20:58 +0300)]
better logging

5 years agoreduce CPU usage using sleep in main loop
Alexey Chernobaev [Wed, 29 Aug 2018 10:37:06 +0000 (13:37 +0300)]
reduce CPU usage using sleep in main loop

5 years agoopen data socket beforehand to prevent data loss
Alexey Chernobaev [Wed, 29 Aug 2018 10:23:09 +0000 (13:23 +0300)]
open data socket beforehand to prevent data loss

5 years agomassive refactoring: clean exit, error handling, etc.
Alexey Chernobaev [Wed, 29 Aug 2018 20:37:44 +0000 (23:37 +0300)]
massive refactoring: clean exit, error handling, etc.

5 years agorefactoring
Alexey Chernobaev [Wed, 29 Aug 2018 19:01:53 +0000 (22:01 +0300)]
refactoring

5 years agoclose sockets and file streams on exit
Alexey Chernobaev [Wed, 29 Aug 2018 18:45:33 +0000 (21:45 +0300)]
close sockets and file streams on exit

5 years agouse UTC time when logging
Alexey Chernobaev [Wed, 29 Aug 2018 18:39:06 +0000 (21:39 +0300)]
use UTC time when logging

5 years agoshow milliseconds in log
Aleksei Vereshchagin [Wed, 29 Aug 2018 18:31:52 +0000 (21:31 +0300)]
show milliseconds in log

5 years agoMove openPort() for dataPort to output_thread
Alexey Chernobaev [Wed, 29 Aug 2018 18:01:54 +0000 (21:01 +0300)]
Move openPort() for dataPort to output_thread

5 years agoclose stdin/stdout/stderr before exiting
Alexey Chernobaev [Wed, 29 Aug 2018 17:59:15 +0000 (20:59 +0300)]
close stdin/stdout/stderr before exiting

5 years agofputs uncommented, checks added
Alexey Chernobaev [Wed, 29 Aug 2018 17:30:38 +0000 (20:30 +0300)]
fputs uncommented, checks added

5 years agorepeat to actual stderr output in log_system_error_and_exit()
Alexey Chernobaev [Wed, 29 Aug 2018 17:27:22 +0000 (20:27 +0300)]
repeat to actual stderr output in log_system_error_and_exit()

5 years agoTemporary disable TIZEN ifndef
Alexey Chernobaev [Wed, 29 Aug 2018 17:25:17 +0000 (20:25 +0300)]
Temporary disable TIZEN ifndef

5 years agoChange installation path in spec-file
Aleksei Vereshchagin [Fri, 24 Aug 2018 14:22:18 +0000 (17:22 +0300)]
Change installation path in spec-file

5 years agooutput 'ready' to control and data socket
Alexey Chernobaev [Thu, 23 Aug 2018 16:46:42 +0000 (19:46 +0300)]
output 'ready' to control and data socket

5 years agocommands reply implemented (in socket mode)
Alexey Chernobaev [Tue, 28 Aug 2018 20:12:03 +0000 (23:12 +0300)]
commands reply implemented (in socket mode)

5 years agoAdd data port
Alexey Chernobaev [Tue, 28 Aug 2018 20:03:27 +0000 (23:03 +0300)]
Add data port

5 years agoRename IO streams
Alexey Chernobaev [Tue, 28 Aug 2018 19:46:38 +0000 (22:46 +0300)]
Rename IO streams

5 years agoImproved logging
Alexey Chernobaev [Tue, 28 Aug 2018 19:31:52 +0000 (22:31 +0300)]
Improved logging

5 years agoFix printf formatting for system info;
Rinat Dobrokhotov [Tue, 28 Aug 2018 14:22:16 +0000 (17:22 +0300)]
Fix printf formatting for system info;

5 years agoUse 'ofile' as output stream for 'output_thread'
Aleksei Vereshchagin [Thu, 16 Aug 2018 20:13:06 +0000 (23:13 +0300)]
Use 'ofile' as output stream for 'output_thread'

5 years agoImplemantation of socket support for data output
Igor Oblakov [Wed, 8 Aug 2018 16:21:39 +0000 (19:21 +0300)]
Implemantation of socket support for data output

5 years agoprofctl hang fix
Igor Oblakov [Fri, 10 Aug 2018 07:08:31 +0000 (10:08 +0300)]
profctl hang fix

5 years agoAdd TIZEN building option
Aleksei Vereshchagin [Wed, 15 Aug 2018 16:49:33 +0000 (19:49 +0300)]
Add TIZEN building option

5 years agoAdd .gitignore file
Aleksei Vereshchagin [Wed, 15 Aug 2018 16:54:22 +0000 (19:54 +0300)]
Add .gitignore file

5 years agoUse CMAKE_C_FLAGS* instead of CMAKE_CXX_FLAGS*
Aleksei Vereshchagin [Wed, 15 Aug 2018 15:40:15 +0000 (18:40 +0300)]
Use CMAKE_C_FLAGS* instead of CMAKE_CXX_FLAGS*

5 years agouse one gettimeofday call instead of time and gettimeofday
Alexey Chernobaev [Thu, 16 Aug 2018 15:33:52 +0000 (18:33 +0300)]
use one gettimeofday call instead of time and gettimeofday

5 years agoTry to open proc files several times due to problems with permissions accepted/tizen/unified/20180821.091206 submit/tizen/20180820.170401
Aleksei Vereshchagin [Fri, 10 Aug 2018 20:18:30 +0000 (23:18 +0300)]
Try to open proc files several times due to problems with permissions

5 years agoUse two buffers (statmname and statname) instead of one pidname
Aleksei Vereshchagin [Fri, 10 Aug 2018 20:06:39 +0000 (23:06 +0300)]
Use two buffers (statmname and statname) instead of one pidname

5 years agoset system information frequency to 500 milliseconds
Alexey Chernobaev [Tue, 3 Jul 2018 18:28:01 +0000 (21:28 +0300)]
set system information frequency to 500 milliseconds

5 years agoUpdate doc;
Rinat Dobrokhotov [Tue, 3 Jul 2018 16:23:31 +0000 (19:23 +0300)]
Update doc;

5 years agoFix indentation;
Rinat Dobrokhotov [Fri, 29 Jun 2018 09:30:42 +0000 (12:30 +0300)]
Fix indentation;

5 years agoAdd possibility to choose pipe owner;
Rinat Dobrokhotov [Thu, 28 Jun 2018 13:54:54 +0000 (16:54 +0300)]
Add possibility to choose pipe owner;

6 years agoAdd LICENSE and README.md accepted/tizen/unified/20180628.130556 submit/tizen/20180619.082107
Aleksei Vereshchagin [Fri, 1 Jun 2018 11:32:24 +0000 (14:32 +0300)]
Add LICENSE and README.md

6 years agoInitial implementation of profctl
Aleksei Vereshchagin [Fri, 1 Jun 2018 10:44:41 +0000 (13:44 +0300)]
Initial implementation of profctl

6 years agoInitial empty repository master
Tizen Infrastructure [Fri, 15 Jun 2018 01:20:46 +0000 (01:20 +0000)]
Initial empty repository