mirror of
https://github.com/openharmony/developtools_bytrace_standard.git
synced 2026-07-19 15:03:32 -04:00
code review file permission and specification fix
Signed-off-by: zhaolihui <zhaolihui2@huawei.com>
This commit is contained in:
@@ -12,9 +12,6 @@
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
Notes:
|
||||
This is project config file for OpenHarmony OSS Audit Tool, if you have any questions or concerns, please email chenyaxun@huawei.com.
|
||||
-->
|
||||
<!-- OAT(OSS Audit Tool) configuration guide:
|
||||
basedir: Root dir, the basedir + project path is the real source file location.
|
||||
@@ -62,4 +59,4 @@ Note:If the text contains special characters, please escape them according to th
|
||||
</filefilter>
|
||||
</filefilterlist>
|
||||
</oatconfig>
|
||||
</configuration>
|
||||
</configuration>
|
||||
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
+3
-3
@@ -420,7 +420,7 @@ static void ParseLongOpt(const string& cmd, int optionIndex, bool& isTrue)
|
||||
struct stat buf;
|
||||
size_t len = strnlen(optarg, MAX_OUTPUT_LEN);
|
||||
if (len == MAX_OUTPUT_LEN || len < 1 ||
|
||||
(stat(optarg, &buf) == 0 && (buf.st_mode & S_IFDIR) != 0)) {
|
||||
(stat(optarg, &buf) == 0 && (buf.st_mode & S_IFDIR))) {
|
||||
fprintf(stderr, "Error: output file is illegal\n");
|
||||
isTrue = false;
|
||||
} else {
|
||||
@@ -480,7 +480,7 @@ static bool ParseOpt(int opt, char** argv, int optIndex)
|
||||
struct stat buf;
|
||||
size_t len = strnlen(optarg, MAX_OUTPUT_LEN);
|
||||
if (len == MAX_OUTPUT_LEN || len < 1 ||
|
||||
(stat(optarg, &buf) == 0 && (buf.st_mode & S_IFDIR) != 0)) {
|
||||
(stat(optarg, &buf) == 0 && (buf.st_mode & S_IFDIR))) {
|
||||
fprintf(stderr, "Error: output file is illegal\n");
|
||||
isTrue = false;
|
||||
} else {
|
||||
@@ -844,7 +844,7 @@ static void InitAllSupportTags()
|
||||
g_tagMap["ark"] = { "ark", "ARK Module", BYTRACE_TAG_ARK, USER, {}};
|
||||
g_tagMap["window"] = { "window", "Window Manager", BYTRACE_TAG_WINDOW_MANAGER, USER, {}};
|
||||
g_tagMap["app"] = { "app", "APP Module", BYTRACE_TAG_APP, USER, {}};
|
||||
g_tagMap["zbinder"] = { "zbinder", "Harmony binder communication", 0, KERNEL, {
|
||||
g_tagMap["zbinder"] = { "zbinder", "OpenHarmony binder communication", 0, KERNEL, {
|
||||
{ "events/zbinder/enable" },
|
||||
}};
|
||||
|
||||
|
||||
Executable → Regular
Executable → Regular
+1
@@ -12,6 +12,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <atomic>
|
||||
#include <cinttypes>
|
||||
#include <climits>
|
||||
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
|
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.9 KiB |
Executable → Regular
Executable → Regular
Executable → Regular
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@@ -23,4 +23,4 @@ EXTERN_C_START
|
||||
napi_value BytraceInit(napi_env env, napi_value exports);
|
||||
EXTERN_C_END
|
||||
|
||||
#endif // DEVELOPTOOLS_INTERFACES_KITS_DECLARE_NAPI_H
|
||||
#endif // DEVELOPTOOLS_INTERFACES_KITS_DECLARE_NAPI_H
|
||||
|
||||
Executable → Regular
Executable → Regular
+3
-3
@@ -39,8 +39,8 @@ def read_files(file, devices_name):
|
||||
if trace_match:
|
||||
traces.append((float(trace_match.group(5)), line))
|
||||
if line.find("realtime_ts") > -1:
|
||||
time_regex = trace_regex + \
|
||||
"tracing_mark_write:\s+trace_event_clock_sync: realtime_ts=(.*)"
|
||||
time_regex = "{}{}".format(trace_regex, \
|
||||
"tracing_mark_write:\s+trace_event_clock_sync: realtime_ts=(.*)")
|
||||
time_match = re.match(time_regex, line)
|
||||
all_real_time_dict[devices_name] = { \
|
||||
"realtime_ts": int(time_match.group(6)), \
|
||||
@@ -130,7 +130,7 @@ def main():
|
||||
# Sort by timestamp from small to large
|
||||
all_trace_sorted_list = sorted(all_trace_list, key=lambda x: x[0])
|
||||
curtime = time.strftime("%Y%m%d_%H%M%S", time.localtime())
|
||||
write_to_file(all_trace_sorted_list, "multi_trace_"+str(curtime)+".ftrace")
|
||||
write_to_file(all_trace_sorted_list, "multi_trace_{}.ftrace".format(str(curtime)))
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user