提交 3792ea4d 编写于 作者: Z Zheng Yejian 提交者: Zheng Zengkai

livepatch: Print logs when check calltrace failed

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I53WZ9

--------------------------------
Signed-off-by: NZheng Yejian <zhengyejian1@huawei.com>
Reviewed-by: NKuohai Xu <xukuohai@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 3c2830a6
......@@ -283,8 +283,10 @@ int klp_check_calltrace(struct klp_patch *patch, int enable)
};
ret = klp_check_activeness_func(patch, enable, &check_funcs);
if (ret)
if (ret) {
pr_err("collect active functions failed, ret=%d\n", ret);
goto out;
}
args.check_funcs = check_funcs;
for_each_process_thread(g, t) {
......
......@@ -276,8 +276,10 @@ int klp_check_calltrace(struct klp_patch *patch, int enable)
};
ret = klp_check_activeness_func(patch, enable, &check_funcs);
if (ret)
if (ret) {
pr_err("collect active functions failed, ret=%d\n", ret);
goto out;
}
args.check_funcs = check_funcs;
for_each_process_thread(g, t) {
......
......@@ -311,8 +311,10 @@ int klp_check_calltrace(struct klp_patch *patch, int enable)
};
ret = klp_check_activeness_func(patch, enable, &check_funcs);
if (ret)
if (ret) {
pr_err("collect active functions failed, ret=%d\n", ret);
goto out;
}
args.check_funcs = check_funcs;
for_each_process_thread(g, t) {
......
......@@ -359,8 +359,10 @@ int klp_check_calltrace(struct klp_patch *patch, int enable)
struct walk_stackframe_args args;
ret = klp_check_activeness_func(patch, enable, &check_funcs);
if (ret)
if (ret) {
pr_err("collect active functions failed, ret=%d\n", ret);
goto out;
}
args.check_funcs = check_funcs;
args.ret = 0;
......
......@@ -321,38 +321,42 @@ int klp_check_calltrace(struct klp_patch *patch, int enable)
#endif
ret = klp_check_activeness_func(patch, enable, &check_funcs);
if (ret)
if (ret) {
pr_err("collect active functions failed, ret=%d\n", ret);
goto out;
}
for_each_process_thread(g, t) {
if (!strncmp(t->comm, "migration/", 10))
continue;
#ifdef CONFIG_ARCH_STACKWALK
ret = stack_trace_save_tsk_reliable(t, trace_entries, MAX_STACK_ENTRIES);
if (ret < 0)
if (ret < 0) {
pr_err("%s:%d has an unreliable stack, ret=%d\n",
t->comm, t->pid, ret);
goto out;
}
trace_len = ret;
ret = 0;
ret = klp_check_stack(trace_entries, trace_len, check_funcs);
#else
trace.skip = 0;
trace.nr_entries = 0;
trace.max_entries = MAX_STACK_ENTRIES;
trace.entries = trace_entries;
ret = save_stack_trace_tsk_reliable(t, &trace);
#endif
WARN_ON_ONCE(ret == -ENOSYS);
if (ret) {
pr_info("%s: %s:%d has an unreliable stack\n",
__func__, t->comm, t->pid);
pr_err("%s: %s:%d has an unreliable stack, ret=%d\n",
__func__, t->comm, t->pid, ret);
goto out;
}
#ifdef CONFIG_ARCH_STACKWALK
ret = klp_check_stack(trace_entries, trace_len, check_funcs);
#else
ret = klp_check_stack(&trace, 0, check_funcs);
#endif
if (ret)
if (ret) {
pr_err("%s:%d check stack failed, ret=%d\n",
t->comm, t->pid, ret);
goto out;
}
}
out:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册