Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dcu_env_check
Commits
811c1ff9
Commit
811c1ff9
authored
Jun 24, 2025
by
liumg
Browse files
Upload New File
parent
67e69755
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
tools/log_analyze.sh
tools/log_analyze.sh
+24
-0
No files found.
tools/log_analyze.sh
0 → 100644
View file @
811c1ff9
#!/usr/bin/bash
# 分析错误信息
analyze_errors
()
{
log
"分析关键字
$1
相关错误..."
local
error_pattern
=
"
$1
"
local
error_flags
=
"fail|error|uncorrect|warn|exception"
# 在dmesg和系统日志中搜索
grep
-iE
"
$error_pattern
.*(
$error_flags
)|(
$error_flags
).*
$error_pattern
"
\
"
$OUTPUT_DIR
/dmesg.log"
"
$OUTPUT_DIR
/system.log"
>
"
$OUTPUT_DIR
/driver_issues.log"
if
[
-s
"
$OUTPUT_DIR
/driver_issues.log"
]
;
then
log
"发现潜在问题:"
[
$QUIET_MODE
-eq
0
]
&&
cat
"
$OUTPUT_DIR
/driver_issues.log"
return
1
else
log
"未发现相关错误信息"
rm
-f
"
$OUTPUT_DIR
/driver_issues.log"
return
0
fi
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment