summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-09-11Add RemainAfterExit=yes to ttrace-marker.servicetizen_6.0.m2_releasesubmit/tizen_6.0_hotfix/20201103.115106submit/tizen_6.0_hotfix/20201102.192906submit/tizen_6.0/20201029.205506submit/tizen/20200915.051524accepted/tizen/unified/20200916.121736accepted/tizen/6.0/unified/hotfix/20201103.045007accepted/tizen/6.0/unified/20201030.102620tizen_6.0_hotfixaccepted/tizen_6.0_unified_hotfixINSUN PYO1-1/+1
Once started, this service never runs twice. Change-Id: Ic21b1f36467ce27cfd15ed0cede47b520735a522
2020-09-09Fix API reference header issuessubmit/tizen/20200909.054524accepted/tizen/unified/20200910.123954Seungha Son2-14/+14
- Create a link in documentation - Add '.' at the end of @brief - Add 'void' keyword inside parentheses Change-Id: Ib92a3a3305a792d6c40ab127815766d838579b46 Signed-off-by: Seungha Son <seungha.son@samsung.com>
2020-08-25Remove unnecessary white spaceSeungha Son1-2/+2
Change-Id: I2fa33741c06a286968dc4c38d0e1a69202e93279 Signed-off-by: Seungha Son <seungha.son@samsung.com>
2020-07-20Change method to link librarySeungha Son1-2/+2
Change-Id: Ib02e1fc6381dfe6f7a00561307d30119b78e4eca Signed-off-by: Seungha Son <seungha.son@samsung.com>
2020-06-22svace security issue fixsubmit/tizen/20200623.023228accepted/tizen/unified/20200623.123920sattdeepan.d2-4/+4
Change-Id: I85b4c82a96e42d3a08acd1ec3f2f25742205aa4e Signed-off-by: Seungha Son <seungha.son@samsung.com>
2020-05-18Fix SVACE issuesubmit/tizen/20200519.012936accepted/tizen/unified/20200528.133036sattdeepan.d1-2/+2
Fix an incorrect declaration to free the array unique_ptr. Change-Id: I863708576482584156cd37f8e21aa824bdc7abb7
2020-04-28Fix svace issuesubmit/tizen/20200428.053539accepted/tizen/unified/20200429.032857Seungha Son3-3/+7
Change-Id: I84e8343338f07a8e2a9e817e1ccca221c98aeff6 Signed-off-by: Seungha Son <seungha.son@samsung.com>
2020-04-22Add LICENSE for atrace_helpersubmit/tizen/20200422.054054accepted/tizen/unified/20200423.054609Seungha Son2-1/+28
Change-Id: Ice751dae71952b2fa2452cb301a91eb4b28fa5e2 Signed-off-by: Seungha Son <seungha.son@samsung.com>
2020-04-10Fix build warningSeungha Son2-2/+3
warning: format '%llx' expects argument of type 'long long unsigned int*', but argument has type 'uint64_t*' {aka 'long unsigned int*'} Change-Id: I7e54040d62d10ebcf2084410bfbbd84310664e07 Signed-off-by: Seungha Son <seungha.son@samsung.com>
2020-04-08Add atrace-helper moduleSeungha Son15-0/+1199
atrace_helper is an optional binary which can be pushed onto the device running systrace in order to enrich the traces with further details (memory, I/O, etc). - Memory snapshots of runnig processes(PSS/RSS) - Periodic snapshotting of processes and thread names. - File paths for filesystem events (only inode numbers). Base repo : https://chromium.googlesource.com/catapult/+/refs/heads/master/systrace/atrace_helper/ Changed contents : Remove specific logic related android Change-Id: I84b6dff914d4d5f151003e002dd0ff08ab0ae81c Signed-off-by: Seungha Son <seungha.son@samsung.com>
2020-04-08Refactor resource managementsSeungha Son1-18/+11
Buffers, managed by malloc() and free(), are replaced with std::unique_ptr type, so it will automatically deleted when going out of scope. Change-Id: I117bea7d0a980c94c0481f3e470da2a626ca4595 Signed-off-by: Seungha Son <seungha.son@samsung.com>
2020-04-06Change error check orderSeungha Son1-12/+9
Change-Id: I0bc2f11b1dff501b8dcfc84bbbad166a8a5d1b64 Signed-off-by: Seungha Son <seungha.son@samsung.com>
2020-04-03Improve logic for setting trace clockSeungha Son2-8/+36
Set the clock to the best available option while tracing. Use 'boot' if it's available; otherwise, use 'mono'. If neither are available use 'global'. Any write to the trace_clock sysfs file will reset the buffer, so only update it if the requested value is not the current value. Reference : https://www.kernel.org/doc/Documentation/trace/ftrace.txt trace_clock: Whenever an event is recorded into the ring buffer, a "timestamp" is added. This stamp comes from a specified clock. By default, ftrace uses the "local" clock. This clock is very fast and strictly per cpu, but on some systems it may not be monotonic with respect to other CPUs. In other words, the local clocks may not be in sync with local clocks on other CPUs. Usual clocks for tracing: # cat trace_clock [local] global counter x86-tsc The clock with the square brackets around it is the one in effect. local: Default clock, but may not be in sync across CPUs global: This clock is in sync with all CPUs but may be a bit slower than the local clock. mono: This uses the fast monotonic clock (CLOCK_MONOTONIC) which is monotonic and is subject to NTP rate adjustments. boot: This is the boot clock (CLOCK_BOOTTIME) and is based on the fast monotonic clock, but also accounts for time spent in suspend. Since the clock access is designed for use in tracing in the suspend path, some side effects are possible if clock is accessed after the suspend time is accounted before the fast mono clock is updated. In this case, the clock update appears to happen slightly sooner than it normally would have. Also on 32-bit systems, it's possible that the 64-bit boot offset sees a partial update. These effects are rare and post processing should be able to handle them. See comments in the ktime_get_boot_fast_ns() function for more information. Change-Id: Iba2d4fcd4f6272fd8faa2e7d462c5b275547c73f Signed-off-by: Seungha Son <seungha.son@samsung.com>
2020-04-02Change 0 or NULL to nullptrSeungha Son1-33/+33
nullptr is a keyword that can be used at all places where NULL is expected. Like NULL, nullptr is implicitly convertible and comparable to any pointer type. Unlike NULL, it is not implicitly convertible or comparable to integral types. Change-Id: Ie1ea211adaff6f818d1f86b0e0a8d9736320b0bf Signed-off-by: Seungha Son <seungha.son@samsung.com>
2020-03-27Add additional system eventsSeungha Son1-2/+45
Add events based on kernel version 4.19.81. Change-Id: I4b96d790b518dff794c5b2b06d6556e882d8b0c6 Signed-off-by: Seungha Son <seungha.son@samsung.com>
2019-07-01Merge "make a gcov package for measuring coverage easier" into tizenChangjoon Baek0-0/+0
2019-07-01make a gcov package for measuring coverage easiertizen_5.5.m2_releasesubmit/tizen_5.5_wearable_hotfix/20201027.114701submit/tizen_5.5_wearable_hotfix/20201026.1843010submit/tizen_5.5_mobile_hotfix/20201027.114301submit/tizen_5.5_mobile_hotfix/20201026.1851010submit/tizen_5.5/20191031.000013submit/tizen_5.5/20191031.000011submit/tizen_5.5/20191031.000009submit/tizen/20190701.045532accepted/tizen/unified/20190702.114958accepted/tizen/5.5/unified/wearable/hotfix/20201027.091920accepted/tizen/5.5/unified/mobile/hotfix/20201027.061108accepted/tizen/5.5/unified/20191031.034044tizen_5.5_wearable_hotfixtizen_5.5_tvtizen_5.5_mobile_hotfixaccepted/tizen_5.5_unified_wearable_hotfixaccepted/tizen_5.5_unified_mobile_hotfixjoon.c.baek1-0/+30
Change-Id: I8bc65b1d0767ad5cc940d6ebdb31cd622fca4c6f Signed-off-by: joon.c.baek <joon.c.baek@samsung.com>
2019-06-28make a gcov package for measuring coverage easierjoon.c.baek1-0/+30
Change-Id: I8bc65b1d0767ad5cc940d6ebdb31cd622fca4c6f Signed-off-by: joon.c.baek <joon.c.baek@samsung.com>
2018-07-31Add condition and change options for tracefssubmit/tizen_5.0/20181106.000001submit/tizen_5.0/20181101.000009submit/tizen/20180731.065338accepted/tizen/unified/20180801.080110accepted/tizen/5.0/unified/20181106.202433tizen_5.0accepted/tizen_5.0_unifiedjoon.c.baek1-1/+2
To mount tracefs needs to check existed path, And add mount options in details. Change-Id: I9393c5629b8bf423d48ecec51fd4d99418d421cc Signed-off-by: joon.c.baek <joon.c.baek@samsung.com>
2018-07-31Revert "Remove sys-kernel-debug-tracing.mount"joon.c.baek3-1/+24
'sys-kernel-debug-tracing.mount' was removed for resolving 'systemctl --state failed' issue. However, Add 'Options=remount,rw' to this file, it can be solution also. This reverts commit 0a2883bf7940b3ee138551434117d3ea63cbfb2a. Change-Id: I5d7f4f5236f7212f06f41bd7ddf815c3f548c85a
2018-07-31Resolve the service failed of ttrace-marker.servicejoon.c.baek1-2/+2
When ttrace-marker.service is executed twice, Second execution makes service failed because of already generated tag file what generated correctly. So, In this case(founding existed tag file) initEnabledTagFile() will return true. Change-Id: Ie4dbee288b1b8daa1231513a8be62bc6884e438b Signed-off-by: joon.c.baek <joon.c.baek@samsung.com>
2018-07-31Remove sys-kernel-debug-tracing.mountjoon.c.baek3-24/+1
Change-Id: I8f549274fcc65c8a4fb8c5f1c289874c281ed964 Signed-off-by: joon.c.baek <joon.c.baek@samsung.com>
2017-11-27Change permission of /tmp/ttrace_tag and servicesubmit/tizen/20171128.025544submit/tizen/20171127.060630accepted/tizen/unified/20171130.063204joon.c.baek2-1/+3
- Change permisstion of /tmp/ttrace_tag root -> system_fw - Assign User/Group to ttrace-marker.service root -> system_fw Change-Id: Ic48b0cfd347f56da2a052511e9e37edac539d033 Signed-off-by: joon.c.baek <joon.c.baek@samsung.com>
2017-11-22Add sys-kernel-debug-tracing.mount filesubmit/tizen/20171123.075325accepted/tizen/unified/20171124.064548joon.c.baek4-20/+23
- Add sys-kernel-debug-tracing.mount to replace sys-kernel.tracing.service. - This file can mount tracefs without /bin/touch executable. Change-Id: I035fc08243c95b09c39a70c46acecc758d7c7d1b Signed-off-by: joon.c.baek <joon.c.baek@samsung.com>
2017-09-29Reomve capabilities in sys-kernel-tracing.servicesubmit/tizen/20171010.025828accepted/tizen/unified/20171010.162459joon.c.baek1-4/+0
Assigning capabilities to sys-kernel-tracing.service causes fail in Odroid U3+, Raspberry Pi3 at Tizen:Unified(5.0). To resolve this issue, remove capabilities on tizen branch. Change-Id: I437d1f005703c0ab6bc6e01aeaf5315138b47cbb Signed-off-by: joon.c.baek <joon.c.baek@samsung.com>
2017-09-19Assign capabilities 'cap_dac_override' to servicesubmit/tizen/20170925.022002accepted/tizen/unified/20170926.061839joon.c.baek1-0/+4
'cap_dac_override' capabilities used inteaded of root permission of sys-kernel-tracing.service. Change-Id: I71870eab4c2a32ac3a904f9713f0cb73a2295126 Signed-off-by: joon.c.baek <joon.c.baek@samsung.com>
2017-09-15Align indentation and remove build warningsubmit/tizen/20170915.063230joon.c.baek1-147/+154
Used invalid type in printf(), change to correct type. Many code lines did keep a indentation, aligned indent for all of source codes. Change-Id: I7cc0438d061c734b5356accd9ff9ff0801f64ff6
2017-09-15Resolve vulnerability about untrusted stringjoon.c.baek2-78/+108
The sceanario of bootup-trace has vulnerability about untrusted string loaded and execution. This patch changes how to execution and remove system() calling. And change open permission 0666 to 0600. Change-Id: Ibfc19a9c8c7ef43af084e8d6b7496bf59c12dfe5 Signed-off-by: joon.c.baek <joon.c.baek@samsung.com>
2017-09-14Set Smack label to ttrace-marker.servicejoon.c.baek1-0/+1
Add SmackProcessLabel=System at ttrace-marker.service. Without this label, ttrace-marker.service will be worked as System::Privileged, This service is enough with System label. Change-Id: I8d588822713a7c7a376f4cbc24e870f3c33bfdbd Signed-off-by: joon.c.baek <joon.c.baek@samsung.com>
2017-08-01Remove build warnings with GCC 6.2submit/tizen_4.0_unified/20170814.115522submit/tizen_4.0/20170828.100009submit/tizen_4.0/20170814.115522submit/tizen_4.0/20170811.094300submit/tizen/20170801.044617accepted/tizen/unified/20170803.010335accepted/tizen/4.0/unified/20170828.223019accepted/tizen/4.0/unified/20170816.015423Gihun Chang2-8/+8
*For implicit declaration of function [-Wimplicit-function-declaration] . Add #include <stdio.h> prior to use of the function vsnprintf. *For Unused bariable [-Wunused-variable] . Remove it. Really Unused. . bufSize, buf, ret *For Ignoring return value of func() [-Wunused-result] . Remove the use of function by https://review.tizen.org/gerrit/#/c/124677/ Change-Id: I7e376cfc30078832141128d10b2e44cd598b9b56
2017-08-01Revert "Remove build warnings with gcc 6.2"Gihun Chang1-2/+2
This reverts commit f4dc8f8166d34463ac1cbe4750fcadf5f364fc83. Change-Id: Ic13032fd562ef5b124e223bada29bd57f89f6b8b
2017-07-31Merge "Remove meaningless codes" into tizenGihun Chang1-2/+0
2017-06-05Merge "Remove build warnings with gcc 6.2" into tizensubmit/tizen/20170605.012851accepted/tizen/unified/20170605.151226Gihun Chang1-2/+2
2017-06-02Add traceFS mount service and adjust service ordersubmit/tizen/20170602.072408accepted/tizen/unified/20170602.155201Changjoon Baek4-44/+25
4.x kernel splited traceFS and debugFS. /sys/kernel/debug/tracing and /tmp should be mounted before ttrace-marker.service started. - Add sys-kernel-tracing.service to mount tracefs to /sys/kernel/debug/tracing - Adjust ttrace-marker.service order to be after the sys-kernel-tracing.service Change-Id: I48f08bb8d4a31fa24b8508307812241a6fcb73b6 Signed-off-by: Changjoon Baek <joon.c.baek@samsung.com>
2017-05-30Remove build warnings with gcc 6.2Gihun Chang1-2/+2
* warning: implicit declaration of function 'vsnprintf' [-Wimplicit-function-declaration] * warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result] Change-Id: Ie400cc8fea6b99d08ab935198b60ec1767ac75c6
2017-05-19Apply %license macrosubmit/tizen/20170522.043327accepted/tizen/unified/20170531.082331Changjoon Baek1-3/+1
Remove manual copy for license file in spec Change-Id: Ie3288252dcf5f667d1bc3524439685d29fc18bfb Signed-off-by: Changjoon Baek <joon.c.baek@samsung.com>
2017-04-12Remove meaningless codesChangjoon Baek1-2/+0
tracing_init_dentry() auto-mount tracefs in kernel 4.10.x. This initializing is triggered fs_initcall. So, Removed code in this commit is meaningless. Change-Id: I9ae499131d6f7a8d2dd6e6c2c2d09e33585e3bf6 Signed-off-by: Changjoon Baek <joon.c.baek@samsung.com>
2017-03-08Apply Tizen 3.0 Smack policy to ttrace pkgChangjoon Baek5-222/+51
Change smack labeling to using systemd tmpfiles instead of set_smacklabel() initializing Change-Id: I0e44ea62200929804c745175f73cd469b9b4623e Signed-off-by: Changjoon Baek <joon.c.baek@samsung.com>
2017-02-02Merge "Prepare for Tizen 4.0 Build" into tizentizen_4.0.m1_releasesubmit/tizen_unified/20170308.100420submit/tizen/20170202.230138accepted/tizen/wearable/20170203.023411accepted/tizen/unified/20170309.040840accepted/tizen/tv/20170203.023407accepted/tizen/mobile/20170203.023402accepted/tizen/ivi/20170203.023425accepted/tizen/common/20170203.161629accepted/tizen_wearableaccepted/tizen_tvaccepted/tizen_mobileaccepted/tizen_iviaccepted/tizen_commonGihun Chang1-1/+1
2017-02-02Replace usage of deprecated libsmack functionRafal Krypa1-1/+2
The libsmack function smack_setlabel is deprecated and will be removed. Using the alternative instead. Change-Id: Ia02383700175ba1e4eb91c85e4aa17c4033290f6 Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
2017-01-13Prepare for Tizen 4.0 BuildMyungJoo Ham1-1/+1
I've assumed that Tizen 4.0 code is going to be more similar with 3.0 than 2.0. Please do not rely on string == compare for version check. Change-Id: I7465a0b1cd26de939f60190cf8e2227aa1e9e763 Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2017-01-12Update support version of werable profile (3.0 -> 2.3.2)Gihun Chang1-6/+6
Change-Id: Icac243d8093e0460d74267d2a59e0e82c897163a
2016-12-23Merge branch 'tizen_3.0' into 'tizen'Gihun Chang4-7/+10
2016-12-22Update T-Trace version to 1.0.3res/for/tizen_3.0Gihun Chang1-1/+1
Change-Id: Ibdc1cef11acc258bfed7e61303b648ace77bfd1f
2016-12-22Formatting help messageGihun Chang1-2/+3
Change-Id: I4a0f580006ae18cc55901f912fc11ad999f5f3be
2016-12-20Remove dependancy with libstdc++Changjoon Baek1-1/+1
The dependancy with libstdc++ existed meaningless. Remove depandancy using "-fno-exceptions" option. Change-Id: I405922988bccebf5760be58586f98f5a392b319e Signed-off-by: Changjoon Baek <joon.c.baek@samsung.com>
2016-12-16Fix side effect on previous commitsubmit/tizen_3.0/20161216.083703submit/tizen_3.0.m2/20170104.093756accepted/tizen/3.0/wearable/20161219.012523accepted/tizen/3.0/tv/20161219.012517accepted/tizen/3.0/mobile/20161219.012514accepted/tizen/3.0/ivi/20161219.012527accepted/tizen/3.0/common/20161219.113529accepted/tizen/3.0.m2/wearable/20170105.030235accepted/tizen/3.0.m2/tv/20170105.030010accepted/tizen/3.0.m2/mobile/20170105.025841tizen_3.0.m2accepted/tizen_3.0.m2_wearableaccepted/tizen_3.0.m2_tvaccepted/tizen_3.0.m2_mobileGihun Chang2-2/+2
Change-Id: Ice3dd142bb38b15fa331157d2b6b0ef9dd106b8e
2016-12-16Fix message overflowsubmit/tizen_3.0/20161216.045231Gihun Chang2-3/+5
Change-Id: Iaa3a46b5d6550e02d3d5ea66d0213e44a2048779
2016-12-05Use absolute path for execlp()submit/tizen_3.0/20161205.051821accepted/tizen/3.0/wearable/20161205.070021accepted/tizen/3.0/tv/20161205.070016accepted/tizen/3.0/mobile/20161205.070009accepted/tizen/3.0/ivi/20161205.070028accepted/tizen/3.0/common/20161206.125359Changjoon Baek1-1/+1
Attacker can exploit by modified 'PATH' environment. Excuting system command have to use absolute path. Change-Id: Ided661e83c072684524c5ab8b73fc89db9842e13 Signed-off-by: Changjoon Baek <joon.c.baek@samsung.com>
2016-12-05Use absolute path for execlp()Changjoon Baek1-1/+1
Attacker can exploit by modified 'PATH' environment. Excuting system command have to use absolute path. Change-Id: Ided661e83c072684524c5ab8b73fc89db9842e13 Signed-off-by: Changjoon Baek <joon.c.baek@samsung.com>