summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-10-17packaging: Add execution bits to allow accessing the child entry of the ↵tizen_9.0_m2_releaseaccepted/tizen/unified/x/asan/20241022.113221accepted/tizen/unified/x/20241018.115445accepted/tizen/unified/toolchain/20241022.122755accepted/tizen/unified/toolchain/20241022.122301accepted/tizen/unified/20241020.073422accepted/tizen/9.0/unified/20241030.234612tizen_9.0tizenaccepted/tizen_unified_x_asanaccepted/tizen_unified_xaccepted/tizen_unified_toolchainaccepted/tizen_unifiedaccepted/tizen_9.0_unifiedSung-hun Kim1-1/+1
option directory Change-Id: I7d595d68137cb2e703f550bee881baafda915093 Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
2024-10-15packaging: Allow accessing to some tracing entries from user shellSung-hun Kim1-0/+4
Change-Id: I47a53d3fa229e5b0224222c2201fcbe741f6c91b Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
2024-07-04atrace: Fix a svace issueaccepted/tizen/unified/x/asan/20240813.225725accepted/tizen/unified/x/20240705.012351accepted/tizen/unified/toolchain/20240812.131449accepted/tizen/unified/dev/20240708.001750accepted/tizen/unified/20240704.173826accepted/tizen_unified_devSung-hun Kim1-2/+2
The new operator in C++ does not return nullptr when it is failed. Instead, it throws a bad_alloc exception to notify the failure. With an optional `std::nothrow` keyword, the new operator returns nullptr instead of exception throwing when it is failed. This patch fixes a svace issue 209972. Change-Id: I6a6f900f06bf7911fc9aa53366d5da6375680915 Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
2024-04-17Remove conditional statements for Mobile/Wearable profilesaccepted/tizen/unified/x/asan/20240625.091800accepted/tizen/unified/x/20240425.051100accepted/tizen/unified/dev/20240620.011410accepted/tizen/unified/20240423.164610Sung-hun Kim1-6/+6
Remove conditional statements in trace.h header file and use the Mobile version for since_tizen. Change-Id: I679e75bb3be8c45abe3298f9126a45ada1f18091 Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
2024-04-04packaging: Add a config file entry for trace_pipe to allow accesses from ↵accepted/tizen/unified/x/20240411.011756accepted/tizen/unified/20240409.155848accepted/tizen/unified/20240409.135539Sung-hun Kim1-0/+2
user shell Change-Id: I2af979fa8980c6f2cbfa3c0cea4737c22ef8ad7d Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
2024-03-04Fix lcov option for lcov 2.0accepted/tizen/unified/x/20240307.010657accepted/tizen/unified/toolchain/20240311.070135accepted/tizen/unified/20240306.094035JinWang An1-1/+1
Change-Id: Ida203348cafa4ab0cbecb28dd25595e7fa19746d Signed-off-by: JinWang An <jinwang.an@samsung.com>
2024-02-21atrace-helper: Fix a coverity issueaccepted/tizen/unified/20240306.011943Sung-hun Kim1-1/+12
Due to the return value of read syscall, tot_read can be overflowed or it can make an underflow case on the argument of read syscall. Also, if an argument length contains zero, it can make an underflow on `length - 1`. This patch handles such cases by checking values properly. Change-Id: I81bb2678d0a8cc38a000c16cc183589e0fcefb15 Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
2024-01-26Fix std=c++14 for gtest 1.14.0 version upgradeJinWang An4-4/+4
Change-Id: I5d2a712428e97a9550cf88b166dd9b71a1ed510a Signed-off-by: JinWang An <jinwang.an@samsung.com>
2023-08-31Exclude atrace from lcov coveragetizen_8.0_m2_releaseaccepted/tizen/unified/20230905.085513accepted/tizen/8.0/unified/20231005.100206tizen_8.0accepted/tizen_8.0_unifiedSung-hun Kim1-0/+1
Change-Id: Ia1227ae78e42a33b6c035bee3e12785f6f13cb4e Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
2023-02-28Increase the buffer size of PIDaccepted/tizen/unified/20230309.161422Sung-hun Kim1-6/+6
If the length of a PID number crosses 5, printed PID spoils the format of the trace. In this case, systrace viewer cannot parse this trace. To prevent this situation, this patch increases the buffer size of PID from 5 to 8. It will be safe as long as PID is less or equal than 99,999,999. Change-Id: Ia374a8b9846402f2578dd5bbefc1eabd75cd319b Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
2023-02-28Fix build errors for TTRACE_DEBUGSung-hun Kim1-11/+11
Due to the formatting error, ttrace package cannot be built if TTRACE_DEBUG is defined. This patch fixes this errors by applying proper formats. Change-Id: If949de75f3c3cf436a76749770f381651b40a9a9 Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
2023-02-27atrace: Enable a 'record-tgid' option for printing TGID of the taskSung-hun Kim1-0/+17
After Linux kernel version 4.13, an option should be set to print TGID of tasks. This patch enables this option. Change-Id: I22aaa91f0c3d8c43e83dee039733318b744f9a81 Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
2023-02-24atrace: Change sendfile to read/write callsSung-hun Kim1-5/+32
Because of the recent update of the Linux kernel, sendfile call on the trace file is no longer supported. Ref a below link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=36e2c7421f02a22f71c9283e55fdb672a9eb58e7 Moreover, sendfile call shows poor performance for some cases which is reported by the patch on android atrace: https://android.googlesource.com/platform/frameworks/native/+/d3d36e71f274a1f6df1eb77db5a6abfb12035c75 So, we changed sendfile call to commonly used read/write calls. Change-Id: If027ddc81781a6ec66bb85cbf826eb638a66cdc0 Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
2023-01-19Fix SVACE issuesaccepted/tizen/unified/20230126.170100Sung-hun Kim1-3/+7
The function strerror() is a vulnerable function because it is thread-unsafe. Instead of this function, ttrace will use strerror_r() which guarantees thread-safety. Change-Id: I904887011c404468a5660792efcf08c4a632366f Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
2022-11-10Add -fPIC to libttraceaccepted/tizen/unified/20221111.105333Sung-hun Kim1-0/+2
For some build environment (especially for the 64-bit emulator), building ttrace is failed due to the linking failure like below. [ 67s] /usr/lib64/gcc/x86_64-tizen-linux-gnu/9.2.0/../../../../x86_64-tizen-linux-gnu/bin/ld: /tmp/libttrace.so.1.1.0.VwGElR.ltrans0.ltrans.o: relocation R_X86_64_PC32 against symbol `cur_enabled_tag' can not be used when making a shared object; recompile with -fPIC [ 67s] /usr/lib64/gcc/x86_64-tizen-linux-gnu/9.2.0/../../../../x86_64-tizen-linux-gnu/bin/ld: final link failed: bad value [ 67s] collect2: error: ld returned 1 exit status Adding -fPIC can resolve this issue. Change-Id: I01197fc6704e5e1accdb70648ea147274ced4d58 Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
2022-11-09Change a GCC flag from -fpic to fPICaccepted/tizen/unified/20221109.171127Sung-hun Kim1-1/+1
Change-Id: Ibd656e33d3493c22b28d685f596623e6b9777464 Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
2022-06-03Fix here document in the spec filetizen_7.0_m2_releasesubmit/tizen/20220603.054759accepted/tizen/unified/20220608.140042accepted/tizen/7.0/unified/hotfix/20221116.112242tizen_7.0_hotfixaccepted/tizen_7.0_unified_hotfixSung-hun Kim1-1/+1
Add escape character for preserving missed argument expression. Change-Id: I9d31dec2d3b2c800e5c45f2f31272eb883f9a3b6 Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
2022-06-02Modify the spec file to deal with coverage measurement automationSung-hun Kim2-7/+43
- Create run-unittest.sh to automate coverage measurement. - Keep directory hierarchy of .gcno files. Change-Id: I417887688e792a816b4ee8f8eff6ace141d2f816 Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
2021-11-15Improve code coverageSeungha Son7-24/+134
In the QEMU environment, it was difficult to measure coverage for file-related functions during gtest operation, so bypass was performed. File-related functions were wrapped and processed as if they were normally processed in a QEMU environment to improve coverage. Note: description about comment for LCOV in below C++ code, an individual line can be excluded by adding LCOV_EXCL_LINE somewhere on that line, or a block can be excluded by surrounding it with lines containing LCOV_EXCL_START and LCOV_EXCL_STOP. Change-Id: Iea4413fd5cc128ed1f417efcc26ad1e797321981 Signed-off-by: Seungha Son <seungha.son@samsung.com>
2021-01-28Refactor cmake build structuresubmit/tizen/20210128.033347Seungha Son7-74/+91
This patch is for refactor cmake build structure. To facilitate analysis and modification by separating it 'src','atrace','atrace-helper', and 'test', respectively. Change-Id: I2f2349fd0e055e4f7a719da733c185896aaf7464 Signed-off-by: Seungha Son <seungha.son@samsung.com>
2021-01-06Remove unnecessary return statementSeungha Son1-2/+0
Change-Id: I01aa139933210053b877fa0359e1eef295d10656 Signed-off-by: Seungha Son <seungha.son@samsung.com>
2020-12-30Remove static librarytizen_6.5.m2_releasesubmit/tizen_6.5/20211028.164101submit/tizen/20210104.014652accepted/tizen/unified/20210105.125854accepted/tizen/6.5/unified/20211028.225718tizen_6.5accepted/tizen_6.5_unifiedSeungha Son2-17/+0
Change-Id: Ifb43d363f8d44f775f875e52063b4bf2041d08b9 Signed-off-by: Seungha Son <linuxias@gmail.com>
2020-12-23Change src, include reference commandSeungha Son1-15/+14
Change-Id: I31e13550281bf52aaa9542a5045df09e443c7e0b Signed-off-by: Seungha Son <linuxias@gmail.com>
2020-11-09Merge "Add Requires=local-fs.target and After=local-fs.target to ↵submit/tizen/20201109.044826accepted/tizen/unified/20201110.125036Seungha Son1-1/+2
ttrace-marker.service" into tizen
2020-10-22Adjust coverage measureSeungha Son3-3/+24
When building with the "gcov on" option, It can check the coverage result in the build log. Change-Id: Id9a05454342a720aedb58052b7035264d957e778 Signed-off-by: Seungha Son <seungha.son@samsung.com>
2020-10-08Add Requires=local-fs.target and After=local-fs.target to ttrace-marker.serviceINSUN PYO1-1/+2
Those dependencies prevent ttrace-marker.service from running in emergency mode, because local-fs.target always fails in emergency mode. Change-Id: I770d2a9b477831bc9c571c925c0ceb89b16829e4
2020-10-06Adjust gtest skeletonSeungha Son7-6/+151
Change-Id: I6fdc2ce6ac49700395d0758ab2b93c76e11069c6 Signed-off-by: Seungha Son <seungha.son@samsung.com>
2020-09-24Release version 1.1.0submit/tizen/20201006.050417submit/tizen/20200924.052347Seungha Son1-1/+1
- Add RemainAfterExit=yes to ttrace-marker.service - Fix API reference header issues - Add atrace-helper module - Refactor resource managements Change-Id: Ic847f35c3200fbece2feb8fefa64acb726a5abf3 Signed-off-by: Seungha Son <seungha.son@samsung.com>
2020-09-24Split atrace, atrace-helper CMakeLists.txtSeungha Son22-59/+57
Change-Id: Iaebd60a6feb8687f608cf1781974e9dacb2fe2e3 Signed-off-by: Seungha Son <seungha.son@samsung.com>
2020-09-23Arrange version managementSeungha Son2-8/+6
Change-Id: I42931c88e1d7a7a33db9a59062e6278c73a871c8 Signed-off-by: Seungha Son <seungha.son@samsung.com>
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