修复错误

Signed-off-by: ganchuantao <ganchuantao1@huawei.com>
This commit is contained in:
ganchuantao 2024-11-18 02:11:08 +00:00 committed by Gitee
parent 2ba848cfcc
commit 4074d3c699
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -16,6 +16,7 @@
#include <fcntl.h>
#include <set>
#include <string>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/utsname.h>
@ -120,10 +121,10 @@ std::string FtraceFsOps::GetKernelSymbols() const
CHECK_TRUE(restrictValue.size() > 0, "", "read kptr_restrict failed!");
bool valueChanged = false;
if (restrictValue.find("0") == string::npos && restrictValue.find("1") == string::npos
&& restrictValue.find("2") == string::npos) {
if (restrictValue.find("0") == std::string::npos && restrictValue.find("1") == std::string::npos
&& restrictValue.find("2") == std::string::npos) {
PROFILER_LOG_ERROR(LOG_CORE, "not value string");
return ""
return "";
}
if (std::stoi(restrictValue) == 0) {
SetKptrRestrict("1");