code review file permission and specification fix

Signed-off-by: zhaolihui <zhaolihui2@huawei.com>
This commit is contained in:
zhaolihui
2022-03-10 17:09:53 +08:00
parent d0997fb33e
commit c8a3a7b676
20 changed files with 10 additions and 12 deletions
Executable → Regular
View File
+1 -4
View File
@@ -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
View File
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
+3 -3
View File
@@ -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
View File
Executable → Regular
+1
View File
@@ -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
View File
View File
Executable → Regular
View File
View File

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Executable → Regular
View File
View File
View File
Vendored Executable → Regular
View File
+2 -2
View File
@@ -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
View File
Executable → Regular
+3 -3
View File
@@ -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()