Hilog轻量化

Signed-off-by:wenlong12 <wenlong12@huawei.com>

Signed-off-by: wenlong12 <wenlong12@huawei.com>
This commit is contained in:
wenlong12 2023-12-27 11:23:21 +08:00
parent 77042877b6
commit a4bd476152
136 changed files with 1506 additions and 1490 deletions

View File

@ -155,38 +155,34 @@ static inline std::string StringFormat(const char* fmt, ...)
}
} // logging
#ifdef HILOG_DEBUG
#undef HILOG_DEBUG
#endif
#ifdef HILOG_INFO
#undef HILOG_INFO
#endif
#ifdef HILOG_WARN
#undef HILOG_WARN
#endif
#ifdef HILOG_ERROR
#undef HILOG_ERROR
#endif
#ifdef HILOG_PRINT
#undef HILOG_PRINT
#endif
#ifdef HAVE_HILOG
#define HILOG_PRINT(type, level, fmt, ...) \
HiLogPrint(type, level, LOG_DOMAIN, LOG_TAG, "%{public}s", logging::StringFormat(fmt, ##__VA_ARGS__).c_str())
#define HILOG_PRINT_DEBUG(type, fmt, ...) \
HILOG_DEBUG(type, "%{public}s", logging::StringFormat(fmt, ##__VA_ARGS__).c_str())
#define HILOG_PRINT_INFO(type, fmt, ...) \
HILOG_INFO(type, "%{public}s", logging::StringFormat(fmt, ##__VA_ARGS__).c_str())
#define HILOG_PRINT_WARN(type, fmt, ...) \
HILOG_WARN(type, "%{public}s", logging::StringFormat(fmt, ##__VA_ARGS__).c_str())
#define HILOG_PRINT_ERROR(type, fmt, ...) \
HILOG_ERROR(type, "%{public}s", logging::StringFormat(fmt, ##__VA_ARGS__).c_str())
#else
#define HILOG_PRINT(type, level, fmt, ...) \
#define HILOG_PRINT_DEBUG(type, level, fmt, ...) \
HiLogPrint(type, level, LOG_DOMAIN, LOG_TAG, "%s", logging::StringFormat(fmt, ##__VA_ARGS__).c_str())
#define HILOG_PRINT_INFO(type, level, fmt, ...) \
HiLogPrint(type, level, LOG_DOMAIN, LOG_TAG, "%s", logging::StringFormat(fmt, ##__VA_ARGS__).c_str())
#define HILOG_PRINT_WARN(type, level, fmt, ...) \
HiLogPrint(type, level, LOG_DOMAIN, LOG_TAG, "%s", logging::StringFormat(fmt, ##__VA_ARGS__).c_str())
#define HILOG_PRINT_ERROR(type, level, fmt, ...) \
HiLogPrint(type, level, LOG_DOMAIN, LOG_TAG, "%s", logging::StringFormat(fmt, ##__VA_ARGS__).c_str())
#endif
#define HILOG_DEBUG(type, fmt, ...) HILOG_PRINT(type, LOG_DEBUG, fmt, ##__VA_ARGS__)
#define HILOG_INFO(type, fmt, ...) HILOG_PRINT(type, LOG_INFO, fmt, ##__VA_ARGS__)
#define HILOG_WARN(type, fmt, ...) HILOG_PRINT(type, LOG_WARN, fmt, ##__VA_ARGS__)
#define HILOG_ERROR(type, fmt, ...) HILOG_PRINT(type, LOG_ERROR, fmt, ##__VA_ARGS__)
#define PROFILER_LOG_DEBUG(type, fmt, ...) HILOG_PRINT_DEBUG(type, fmt, ##__VA_ARGS__)
#define PROFILER_LOG_INFO(type, fmt, ...) HILOG_PRINT_INFO(type, fmt, ##__VA_ARGS__)
#define PROFILER_LOG_WARN(type, fmt, ...) HILOG_PRINT_WARN(type, fmt, ##__VA_ARGS__)
#define PROFILER_LOG_ERROR(type, fmt, ...) HILOG_PRINT_ERROR(type, fmt, ##__VA_ARGS__)
#endif // NDEBUG
#define STD_PTR(K, T) std::K##_ptr<T>
@ -196,8 +192,9 @@ static inline std::string StringFormat(const char* fmt, ...)
#define CHECK_NOTNULL(ptr, retval, fmt, ...) \
do { \
if (ptr == nullptr) { \
HILOG_WARN(LOG_CORE, "CHECK_NOTNULL(%s) in %s:%d FAILED, " fmt, #ptr, __func__, \
__LINE__, ##__VA_ARGS__); \
std::string str = std::string("CHECK_NOTNULL(") + logging::StringFormat(fmt, ##__VA_ARGS__) + \
") in " + __func__ + ":" + std::to_string(__LINE__) + "FAILED"; \
HILOG_WARN(LOG_CORE, "%{public}s", str.c_str()); \
return retval; \
} \
} while (0)
@ -206,7 +203,9 @@ static inline std::string StringFormat(const char* fmt, ...)
#define CHECK_TRUE(expr, retval, fmt, ...) \
do { \
if (!(expr)) { \
HILOG_WARN(LOG_CORE, "CHECK_TRUE(%s) in %s:%d FAILED, " fmt, #expr, __func__, __LINE__, ##__VA_ARGS__); \
std::string str = std::string("CHECK_TRUE(") + logging::StringFormat(fmt, ##__VA_ARGS__) + \
") in " + __func__ + ":" + std::to_string(__LINE__) + "FAILED"; \
HILOG_WARN(LOG_CORE, "%{public}s", str.c_str()); \
return retval; \
} \
} while (0)
@ -222,7 +221,7 @@ static inline std::string StringFormat(const char* fmt, ...)
#define RETURN_IF(expr, retval, fmt, ...) \
do { \
if ((expr)) { \
HILOG_WARN(LOG_CORE, fmt, ##__VA_ARGS__); \
HILOG_WARN(LOG_CORE, "%{public}s", logging::StringFormat(fmt, ##__VA_ARGS__).c_str()); \
return retval; \
} \
} while (0)

View File

@ -84,26 +84,26 @@ bool IsProcessRunning(int& lockFileFd)
const int bufSize = 256;
char buf[bufSize] = {0};
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "%s:failed to open(%s), errno(%d:%s)", __func__, fileName.c_str(), errno, buf);
PROFILER_LOG_ERROR(LOG_CORE, "%s:failed to open(%s), errno(%d:%s)", __func__, fileName.c_str(), errno, buf);
return false;
}
int flags = fcntl(fd, F_GETFD);
if (flags == -1) {
close(fd);
HILOG_ERROR(LOG_CORE, "%s: get fd flags failed!", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s: get fd flags failed!", __func__);
return false;
}
flags |= FD_CLOEXEC;
if (fcntl(fd, F_SETFD, flags) == -1) {
close(fd);
HILOG_ERROR(LOG_CORE, "%s: set fd_cloexec failed!", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s: set fd_cloexec failed!", __func__);
return false;
}
if (flock(fd, LOCK_EX | LOCK_NB) == -1) {
// 进程正在运行,加锁失败
close(fd);
printf("%s is running, please don't start it again.\n", processName.c_str());
HILOG_ERROR(LOG_CORE, "%s is running, please don't start it again.", processName.c_str());
PROFILER_LOG_ERROR(LOG_CORE, "%s is running, please don't start it again.", processName.c_str());
return true;
}
std::string pidStr = std::to_string(getpid());
@ -129,12 +129,12 @@ bool IsProcessExist(const std::string& processName, int& pid)
char filePath[FILE_PATH_SIZE] = {0};
int len = snprintf_s(filePath, FILE_PATH_SIZE, FILE_PATH_SIZE - 1, "/proc/%s/cmdline", ptr->d_name);
if (len < 0) {
HILOG_WARN(LOG_CORE, "maybe, the contents of cmdline had be cut off");
PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of cmdline had be cut off");
continue;
}
FILE* fp = fopen(filePath, "r");
if (fp == nullptr) {
HILOG_DEBUG(LOG_CORE, "open file failed! %s", filePath);
PROFILER_LOG_DEBUG(LOG_CORE, "open file failed! %s", filePath);
continue;
}
char buf[BUFFER_SIZE] = {0};
@ -180,7 +180,7 @@ int StartProcess(const std::string& processBin, std::vector<char*>& argv)
int retval = execvp(processBin.c_str(), argv.data());
if (retval == -1 && errno == EXECVP_ERRNO) {
printf("warning: %s does not exist!\n", processBin.c_str());
HILOG_WARN(LOG_CORE, "warning: %s does not exist!", processBin.c_str());
PROFILER_LOG_WARN(LOG_CORE, "warning: %s does not exist!", processBin.c_str());
}
_exit(EXIT_FAILURE);
}
@ -214,7 +214,7 @@ void PrintMallinfoLog(const std::string& mallInfoPrefix, const struct mallinfo2&
", fsmblks = " + std::to_string(mi.fsmblks) + ", uordblks = " + std::to_string(mi.uordblks);
mallinfoLog +=
", fordblks = " + std::to_string(mi.fordblks) + ", keepcost = " + std::to_string(mi.keepcost);
HILOG_INFO(LOG_CORE, "%s", mallinfoLog.c_str());
PROFILER_LOG_INFO(LOG_CORE, "%s", mallinfoLog.c_str());
#endif // HOOK_ENABLE
}
@ -239,9 +239,9 @@ inline int CustomFdFclose(FILE** fp)
FILE* CustomPopen(const std::vector<std::string>& command, const char* type, int fds[],
volatile pid_t& childPid, bool needUnblock)
{
HILOG_DEBUG(LOG_CORE, "BEGN %s: ready!", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "BEGN %s: ready!", __func__);
if (command.empty() || type == nullptr) {
HILOG_ERROR(LOG_CORE, "%s: param invalid", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s: param invalid", __func__);
return nullptr;
}
@ -280,7 +280,7 @@ FILE* CustomPopen(const std::vector<std::string>& command, const char* type, int
setpgid(pid, pid);
// exe path = argv[0]; exe name = argv[1]
if (execve(argv[0], &argv[1], envp) == -1) {
HILOG_ERROR(LOG_CORE, "execve failed {%s:%s}", __func__, strerror(errno));
PROFILER_LOG_ERROR(LOG_CORE, "execve failed {%s:%s}", __func__, strerror(errno));
exit(EXIT_FAILURE);
}
}
@ -300,28 +300,28 @@ FILE* CustomPopen(const std::vector<std::string>& command, const char* type, int
// Make sure the parent pipe reads and writes exist;CustomPUnblock will use.
childPid = pid;
if (strncmp(type, "r", strlen(type)) == 0) {
HILOG_DEBUG(LOG_CORE, "END %s fds[READ]: success!", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "END %s fds[READ]: success!", __func__);
return fdopen(fds[READ], "r");
}
HILOG_DEBUG(LOG_CORE, "END %s fds[WRITE]: success!", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "END %s fds[WRITE]: success!", __func__);
return fdopen(fds[WRITE], "w");
}
int CustomPclose(FILE* fp, int fds[], volatile pid_t& childPid, bool needUnblock)
{
HILOG_DEBUG(LOG_CORE, "BEGN %s: ready!", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "BEGN %s: ready!", __func__);
CHECK_NOTNULL(fp, -1, "NOTE %s: fp is null", __func__);
int stat = 0;
if (needUnblock) {
HILOG_DEBUG(LOG_CORE, "NOTE Kill Endless Loop Child %d.", childPid);
PROFILER_LOG_DEBUG(LOG_CORE, "NOTE Kill Endless Loop Child %d.", childPid);
kill(childPid, SIGKILL);
}
while (waitpid(childPid, &stat, 0) == -1) {
HILOG_ERROR(LOG_CORE, "%s: %s.", __func__, strerror(errno));
PROFILER_LOG_ERROR(LOG_CORE, "%s: %s.", __func__, strerror(errno));
if (errno == EINTR) {
continue;
}
@ -336,20 +336,20 @@ int CustomPclose(FILE* fp, int fds[], volatile pid_t& childPid, bool needUnblock
fds[WRITE] = -1;
CHECK_TRUE(CustomFdClose(fds[READ]) == 0, -1, "CustomFdClose failed!");
} else {
HILOG_INFO(LOG_CORE, "%s: Can't find fp in fds[READ/WRITE].", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s: Can't find fp in fds[READ/WRITE].", __func__);
}
}
CHECK_TRUE(CustomFdFclose(&fp) == 0, -1, "CustomFdFclose failed!");
HILOG_DEBUG(LOG_CORE, "END %s: success!", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "END %s: success!", __func__);
return stat;
}
// IF pipe fds is block, before release other threads, you need call CustomPUnblock
int CustomPUnblock(int fds[])
{
HILOG_DEBUG(LOG_CORE, "BEGN %s: ready!", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "BEGN %s: ready!", __func__);
CHECK_TRUE(fds[READ] != -1 && fds[WRITE] != -1, -1, "END fds[READ/WRITE]=-1");
@ -357,12 +357,12 @@ int CustomPUnblock(int fds[])
CHECK_TRUE(stat != -1, -1, "END fcntl(F_GETFL) failed!");
if (!(stat & O_NONBLOCK)) {
HILOG_DEBUG(LOG_CORE, "NOTE %s: ready!Unblock r_fd and close all", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "NOTE %s: ready!Unblock r_fd and close all", __func__);
const char* eof = "\n\0";
write(fds[WRITE], eof, strlen(eof) + 1);
fcntl(fds[READ], F_SETFL, O_NONBLOCK);
}
HILOG_DEBUG(LOG_CORE, "END %s: success!", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "END %s: success!", __func__);
return 0;
}
@ -381,14 +381,14 @@ int GetServicePort()
istr >> minPort >> maxPort;
const int offset = 3168; // To be compatible with previously used port 50051;
int port = (minPort + maxPort) / 2 + offset;
HILOG_DEBUG(LOG_CORE, "Service port is: %d", port);
PROFILER_LOG_DEBUG(LOG_CORE, "Service port is: %d", port);
return port;
}
void SplitString(const std::string& str, const std::string &sep, std::vector<std::string>& ret)
{
if (str.empty()) {
HILOG_ERROR(LOG_CORE, "The string splited is empty!");
PROFILER_LOG_ERROR(LOG_CORE, "The string splited is empty!");
return;
}
std::string::size_type beginPos = str.find_first_not_of(sep);
@ -416,7 +416,7 @@ bool CheckApplicationPermission(int pid, const std::string& processName)
if (pid > 0) {
std::string filePath = "/proc/" + std::to_string(pid) + "/cmdline";
if (!LoadStringFromFile(filePath, bundleName)) {
HILOG_ERROR(LOG_CORE, "Get process name by pid failed!");
PROFILER_LOG_ERROR(LOG_CORE, "Get process name by pid failed!");
return false;
}
bundleName.resize(strlen(bundleName.c_str()));
@ -525,16 +525,16 @@ bool GetCurrentUserId(int32_t& userId)
std::vector<int32_t> activeIds;
int32_t ret = AccountSA::OsAccountManager::QueryActiveOsAccountIds(activeIds);
if (ret != 0) {
HILOG_ERROR(LOG_CORE, "QueryActiveOsAccountIds failed ret:%d", ret);
PROFILER_LOG_ERROR(LOG_CORE, "QueryActiveOsAccountIds failed ret:%d", ret);
return false;
}
if (activeIds.empty()) {
HILOG_ERROR(LOG_CORE, "QueryActiveOsAccountIds activeIds empty");
PROFILER_LOG_ERROR(LOG_CORE, "QueryActiveOsAccountIds activeIds empty");
return false;
}
userId = activeIds[0];
HILOG_INFO(LOG_CORE, "QueryActiveOsAccountIds userId[0]:%d", userId);
PROFILER_LOG_INFO(LOG_CORE, "QueryActiveOsAccountIds userId[0]:%d", userId);
return true;
}
@ -542,26 +542,26 @@ int32_t GetPackageUid(const std::string& name)
{
int32_t userId = 0;
if (!GetCurrentUserId(userId)) {
HILOG_ERROR(LOG_CORE, "Failed to get current user id");
PROFILER_LOG_ERROR(LOG_CORE, "Failed to get current user id");
return EC_INVALID_VALUE;
}
auto manager = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager();
if (manager == nullptr) {
HILOG_ERROR(LOG_CORE, "systemAbilityManager is nullptr");
PROFILER_LOG_ERROR(LOG_CORE, "systemAbilityManager is nullptr");
return EC_INVALID_VALUE;
}
sptr<IRemoteObject> remoteObject = manager->GetSystemAbility(BUNDLE_MGR_SERVICE_SYS_ABILITY_ID);
if (remoteObject == nullptr) {
HILOG_ERROR(LOG_CORE, "failed to get service id");
PROFILER_LOG_ERROR(LOG_CORE, "failed to get service id");
return EC_INVALID_VALUE;
}
sptr<AppExecFwk::IBundleMgr> mgr = iface_cast<AppExecFwk::IBundleMgr>(remoteObject);
if (mgr == nullptr) {
HILOG_ERROR(LOG_CORE, "mgr is nullptr");
PROFILER_LOG_ERROR(LOG_CORE, "mgr is nullptr");
return EC_INVALID_VALUE;
}
int32_t uid = mgr->GetUidByBundleName(name, userId);
HILOG_INFO(LOG_CORE, "pkgname is: %s, uid is : %d", name.c_str(), uid);
PROFILER_LOG_INFO(LOG_CORE, "pkgname is: %s, uid is : %d", name.c_str(), uid);
return uid;
}
} // namespace COMMON

View File

@ -31,11 +31,11 @@ EpollEventPoller::EpollEventPoller(int timeOut) : timeOut_(timeOut), epollFd_(IN
EpollEventPoller::~EpollEventPoller()
{
if (state_ == STARTED) {
HILOG_INFO(LOG_CORE, "need Stop in destructor!");
PROFILER_LOG_INFO(LOG_CORE, "need Stop in destructor!");
Stop();
}
if (state_ == INITIED) {
HILOG_INFO(LOG_CORE, "need Finalize in dtor!");
PROFILER_LOG_INFO(LOG_CORE, "need Finalize in dtor!");
Finalize();
}
}
@ -106,10 +106,10 @@ bool EpollEventPoller::UpdateEvent(int op, const EventContextPtr& ctx)
event.data.ptr = ctx.get();
std::string name = EpollOpName(op).c_str();
HILOG_DEBUG(LOG_CORE, "poll set %s %d %x start!", name.c_str(), ctx->fd, event.events);
PROFILER_LOG_DEBUG(LOG_CORE, "poll set %s %d %x start!", name.c_str(), ctx->fd, event.events);
int retval = epoll_ctl(epollFd_, op, ctx->fd, &event);
CHECK_TRUE(retval == 0, false, "epoll_ctl %s failed, %d", name.c_str(), errno);
HILOG_DEBUG(LOG_CORE, "poll set %s %d %x done!", name.c_str(), ctx->fd, event.events);
PROFILER_LOG_DEBUG(LOG_CORE, "poll set %s %d %x done!", name.c_str(), ctx->fd, event.events);
return true;
}
@ -125,7 +125,7 @@ void EpollEventPoller::Run()
int retval = TEMP_FAILURE_RETRY(epoll_wait(epollFd_, eventVec.data(), eventVec.size(), timeOut_));
CHECK_TRUE(retval >= 0, NO_RETVAL, "epoll_wait failed, %d!", errno);
if (retval == 0) {
HILOG_INFO(LOG_CORE, "epoll_wait %dms timeout!", timeOut_);
PROFILER_LOG_INFO(LOG_CORE, "epoll_wait %dms timeout!", timeOut_);
continue;
}
for (int i = 0; i < retval; i++) {
@ -154,20 +154,20 @@ void EpollEventPoller::OnNotify()
{
uint64_t value = 0;
CHECK_TRUE(read(eventFd_, &value, sizeof(value)) == sizeof(value), NO_RETVAL, "read eventfd FAILED!");
HILOG_DEBUG(LOG_CORE, "OnNotify %llu done!", static_cast<unsigned long long>(value));
PROFILER_LOG_DEBUG(LOG_CORE, "OnNotify %llu done!", static_cast<unsigned long long>(value));
}
bool EpollEventPoller::Notify(uint64_t value)
{
auto nbytes = write(eventFd_, &value, sizeof(value));
CHECK_TRUE(static_cast<size_t>(nbytes) == sizeof(value), false, "write eventfd FAILED!");
HILOG_DEBUG(LOG_CORE, "Notify %llu done!", static_cast<unsigned long long>(value));
PROFILER_LOG_DEBUG(LOG_CORE, "Notify %llu done!", static_cast<unsigned long long>(value));
return true;
}
bool EpollEventPoller::Init()
{
HILOG_INFO(LOG_CORE, "Init %d", state_.load());
PROFILER_LOG_INFO(LOG_CORE, "Init %d", state_.load());
CHECK_TRUE(state_ == INITIAL, false, "Init FAIL %d", state_.load());
int epollFd = epoll_create1(EPOLL_CLOEXEC);
@ -187,7 +187,7 @@ bool EpollEventPoller::Init()
epollFd_ = epollFd;
eventFd_ = eventFd;
AddContextLocked(eventFdCtx);
HILOG_INFO(LOG_CORE, "EpollEventPoller::Init %d done!", state_.load());
PROFILER_LOG_INFO(LOG_CORE, "EpollEventPoller::Init %d done!", state_.load());
state_ = INITIED;
return true;
}
@ -195,11 +195,11 @@ bool EpollEventPoller::Init()
bool EpollEventPoller::Finalize()
{
if (state_ == STARTED) {
HILOG_INFO(LOG_CORE, "need Stop in Finalize!");
PROFILER_LOG_INFO(LOG_CORE, "need Stop in Finalize!");
Stop();
}
HILOG_INFO(LOG_CORE, "Finalize %d", state_.load());
PROFILER_LOG_INFO(LOG_CORE, "Finalize %d", state_.load());
CHECK_TRUE(state_ == INITIED, false, "Finalize FAIL %d", state_.load());
std::unique_lock<std::mutex> lock(mutex_);
@ -208,7 +208,7 @@ bool EpollEventPoller::Finalize()
contextVec.push_back(ctxPair.second);
}
for (auto ctxPtr : contextVec) {
HILOG_DEBUG(LOG_CORE, "remove context for %d", ctxPtr->fd);
PROFILER_LOG_DEBUG(LOG_CORE, "remove context for %d", ctxPtr->fd);
RemoveContextLocked(ctxPtr);
}
@ -225,7 +225,7 @@ bool EpollEventPoller::Finalize()
bool EpollEventPoller::Start()
{
HILOG_INFO(LOG_CORE, "%s %d", __func__, state_.load());
PROFILER_LOG_INFO(LOG_CORE, "%s %d", __func__, state_.load());
CHECK_TRUE(state_ == INITIED, false, "Start FAIL %d", state_.load());
running_ = true;

View File

@ -46,19 +46,19 @@ EventNotifier::EventNotifier(unsigned int initValue, unsigned int mask) : fd_(-1
}
fd_ = eventfd(initValue, flags_);
CHECK_TRUE(fd_ >= 0, NO_RETVAL, "create eventfd FAILED, %d", errno);
HILOG_DEBUG(LOG_CORE, "EventNotifier create eventfd %d done!", fd_);
PROFILER_LOG_DEBUG(LOG_CORE, "EventNotifier create eventfd %d done!", fd_);
}
EventNotifier::EventNotifier(int fd) : fd_(fd), flags_(0)
{
int flags = fcntl(fd_, F_GETFL);
CHECK_TRUE(flags >= 0, NO_RETVAL, "get flags of fd %d FAILED, %d", fd, errno);
HILOG_DEBUG(LOG_CORE, "EventNotifier bind eventfd %d done!", fd_);
PROFILER_LOG_DEBUG(LOG_CORE, "EventNotifier bind eventfd %d done!", fd_);
}
EventNotifier::~EventNotifier()
{
HILOG_DEBUG(LOG_CORE, "EventNotifier close eventfd %d", fd_);
PROFILER_LOG_DEBUG(LOG_CORE, "EventNotifier close eventfd %d", fd_);
close(fd_);
}

View File

@ -63,7 +63,7 @@ int32_t ScheduleTaskManager::ScheduleTask(const std::function<void(void)>& callb
{
int32_t timerFd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
if (timerFd == -1) {
HILOG_ERROR(LOG_CORE, "ScheduleTaskManager timerfd create failed");
PROFILER_LOG_ERROR(LOG_CORE, "ScheduleTaskManager timerfd create failed");
return -1;
}
@ -71,7 +71,7 @@ int32_t ScheduleTaskManager::ScheduleTask(const std::function<void(void)>& callb
struct itimerspec time;
if (once) {
if (interval == 0) {
HILOG_ERROR(LOG_CORE, "the interval parameters of a single execution cannot be 0");
PROFILER_LOG_ERROR(LOG_CORE, "the interval parameters of a single execution cannot be 0");
return -1;
}
time.it_value.tv_sec = interval / TIME_BASE;
@ -89,7 +89,7 @@ int32_t ScheduleTaskManager::ScheduleTask(const std::function<void(void)>& callb
int32_t ret = timerfd_settime(timerFd, 0, &time, NULL);
if (ret == -1) {
HILOG_ERROR(LOG_CORE, "ScheduleTaskManager timerfd settime failed");
PROFILER_LOG_ERROR(LOG_CORE, "ScheduleTaskManager timerfd settime failed");
return -1;
}

View File

@ -34,21 +34,21 @@ protected:
FILE* file = fopen(filePath.c_str(), "w");
if (file == nullptr) {
std::string errorMsg = GetErrorMsg();
HILOG_ERROR(LOG_CORE, "WriteFile: fopen() fail, %s, %s", filePath.c_str(), errorMsg.c_str());
PROFILER_LOG_ERROR(LOG_CORE, "WriteFile: fopen() fail, %s, %s", filePath.c_str(), errorMsg.c_str());
return false;
}
size_t len = fwrite(const_cast<char*>(fileContent.c_str()), 1, fileContent.length(), file);
if (len < 0) {
std::string errorMsg = GetErrorMsg();
HILOG_ERROR(LOG_CORE, "WriteFile: fwrite() fail, %s", errorMsg.c_str());
PROFILER_LOG_ERROR(LOG_CORE, "WriteFile: fwrite() fail, %s", errorMsg.c_str());
(void)fclose(file);
return false;
}
if (fflush(file) == EOF) {
std::string errorMsg = GetErrorMsg();
HILOG_ERROR(LOG_CORE, "WriteFile: fflush() error = %s", errorMsg.c_str());
PROFILER_LOG_ERROR(LOG_CORE, "WriteFile: fflush() error = %s", errorMsg.c_str());
(void)fclose(file);
return false;
}
@ -56,7 +56,7 @@ protected:
fsync(fileno(file));
if (fclose(file) != 0) {
std::string errorMsg = GetErrorMsg();
HILOG_ERROR(LOG_CORE, "CreateConfigFile: fclose() error = %s", errorMsg.c_str());
PROFILER_LOG_ERROR(LOG_CORE, "CreateConfigFile: fclose() error = %s", errorMsg.c_str());
return false;
}
return true;

View File

@ -66,7 +66,7 @@ HWTEST_F(EpollEventPollerTest, InitFinalize, TestSize.Level1)
{
ASSERT_NE(eventPoller, nullptr);
HILOG_INFO(LOG_CORE, "EpollEventPollerTest.InitFinalize start!");
PROFILER_LOG_INFO(LOG_CORE, "EpollEventPollerTest.InitFinalize start!");
EXPECT_TRUE(eventPoller->Init());
EXPECT_TRUE(eventPoller->Finalize());
}
@ -79,7 +79,7 @@ HWTEST_F(EpollEventPollerTest, InitFinalize, TestSize.Level1)
HWTEST_F(EpollEventPollerTest, InitOnly, TestSize.Level1)
{
ASSERT_NE(eventPoller, nullptr);
HILOG_INFO(LOG_CORE, "EpollEventPollerTest.InitOnly start!");
PROFILER_LOG_INFO(LOG_CORE, "EpollEventPollerTest.InitOnly start!");
EXPECT_TRUE(eventPoller->Init());
}
@ -92,7 +92,7 @@ HWTEST_F(EpollEventPollerTest, Init2Finalize1, TestSize.Level1)
{
ASSERT_NE(eventPoller, nullptr);
HILOG_INFO(LOG_CORE, "EpollEventPollerTest.Init2Finalize1 start!");
PROFILER_LOG_INFO(LOG_CORE, "EpollEventPollerTest.Init2Finalize1 start!");
EXPECT_TRUE(eventPoller->Init());
EXPECT_FALSE(eventPoller->Init());
EXPECT_TRUE(eventPoller->Finalize());
@ -107,7 +107,7 @@ HWTEST_F(EpollEventPollerTest, InitStartStopFinalize, TestSize.Level1)
{
ASSERT_NE(eventPoller, nullptr);
HILOG_INFO(LOG_CORE, "EpollEventPollerTest.InitStartStopFinalize start!");
PROFILER_LOG_INFO(LOG_CORE, "EpollEventPollerTest.InitStartStopFinalize start!");
EXPECT_TRUE(eventPoller->Init());
EXPECT_TRUE(eventPoller->Start());
EXPECT_TRUE(eventPoller->Stop());
@ -123,7 +123,7 @@ HWTEST_F(EpollEventPollerTest, InitStartStop, TestSize.Level1)
{
ASSERT_NE(eventPoller, nullptr);
HILOG_INFO(LOG_CORE, "EpollEventPollerTest.InitStartStop start!");
PROFILER_LOG_INFO(LOG_CORE, "EpollEventPollerTest.InitStartStop start!");
EXPECT_TRUE(eventPoller->Init());
EXPECT_TRUE(eventPoller->Start());
EXPECT_TRUE(eventPoller->Stop());
@ -138,7 +138,7 @@ HWTEST_F(EpollEventPollerTest, InitStart, TestSize.Level1)
{
ASSERT_NE(eventPoller, nullptr);
HILOG_INFO(LOG_CORE, "EpollEventPollerTest.InitStart start!");
PROFILER_LOG_INFO(LOG_CORE, "EpollEventPollerTest.InitStart start!");
EXPECT_TRUE(eventPoller->Init());
EXPECT_TRUE(eventPoller->Start());
}
@ -152,7 +152,7 @@ HWTEST_F(EpollEventPollerTest, InitStartAddFd, TestSize.Level1)
{
ASSERT_NE(eventPoller, nullptr);
HILOG_INFO(LOG_CORE, "EpollEventPollerTest.InitStartAddFd start!");
PROFILER_LOG_INFO(LOG_CORE, "EpollEventPollerTest.InitStartAddFd start!");
EXPECT_TRUE(eventPoller->Init());
EXPECT_TRUE(eventPoller->Start());
@ -160,7 +160,7 @@ HWTEST_F(EpollEventPollerTest, InitStartAddFd, TestSize.Level1)
uint64_t readValue = 0;
auto onReadable = [&readValue, &eventFd]() {
read(eventFd, &readValue, sizeof(readValue));
HILOG_INFO(LOG_CORE, "EpollEventPollerTest.InitStartAddFd read %" PRIu64, readValue);
PROFILER_LOG_INFO(LOG_CORE, "EpollEventPollerTest.InitStartAddFd read %" PRIu64, readValue);
};
EXPECT_TRUE(eventPoller->AddFileDescriptor(eventFd, onReadable));
@ -182,7 +182,7 @@ HWTEST_F(EpollEventPollerTest, InitStartAddEventFd, TestSize.Level1)
{
ASSERT_NE(eventPoller, nullptr);
HILOG_INFO(LOG_CORE, "EpollEventPollerTest.InitStartAddFd start!");
PROFILER_LOG_INFO(LOG_CORE, "EpollEventPollerTest.InitStartAddFd start!");
EXPECT_TRUE(eventPoller->Init());
EXPECT_TRUE(eventPoller->Start());
@ -190,7 +190,7 @@ HWTEST_F(EpollEventPollerTest, InitStartAddEventFd, TestSize.Level1)
uint64_t readValue = 0;
auto onReadable = [&readValue, &notifier]() {
readValue = notifier->Take();
HILOG_INFO(LOG_CORE, "EpollEventPollerTest.InitStartAddFd read %" PRIu64, readValue);
PROFILER_LOG_INFO(LOG_CORE, "EpollEventPollerTest.InitStartAddFd read %" PRIu64, readValue);
};
EXPECT_TRUE(eventPoller->AddFileDescriptor(notifier->GetFd(), onReadable));

View File

@ -106,7 +106,7 @@ public:
size_t nbytes = 0;
if ((strlen(path.c_str()) >= PATH_MAX) || (realpath(path.c_str(), realPath) == nullptr)) {
HILOG_ERROR(LOG_CORE, "%s:path is invalid: %s, errno=%d", __func__, path.c_str(), errno);
PROFILER_LOG_ERROR(LOG_CORE, "%s:path is invalid: %s, errno=%d", __func__, path.c_str(), errno);
return "";
}
FILE* file = fopen(realPath, "rb");
@ -131,7 +131,7 @@ public:
result.push_back(HEX_CHARS[LHB(out[i])]);
}
HILOG_DEBUG(LOG_CORE, "%s:%s-(%s)", __func__, path.c_str(), result.c_str());
PROFILER_LOG_DEBUG(LOG_CORE, "%s:%s-(%s)", __func__, path.c_str(), result.c_str());
return result;
}
@ -173,7 +173,7 @@ public:
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "CreateConfigFile: fopen() error = %s", buf);
PROFILER_LOG_ERROR(LOG_CORE, "CreateConfigFile: fopen() error = %s", buf);
return;
}
@ -182,9 +182,9 @@ public:
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "CreateConfigFile: fwrite() error = %s", buf);
PROFILER_LOG_ERROR(LOG_CORE, "CreateConfigFile: fwrite() error = %s", buf);
if (fclose(writeFp) != 0) {
HILOG_ERROR(LOG_CORE, "fclose() error");
PROFILER_LOG_ERROR(LOG_CORE, "fclose() error");
}
return;
}
@ -194,9 +194,9 @@ public:
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "CreateConfigFile: fflush() error = %s", buf);
PROFILER_LOG_ERROR(LOG_CORE, "CreateConfigFile: fflush() error = %s", buf);
if (fclose(writeFp) != 0) {
HILOG_ERROR(LOG_CORE, "fclose() error");
PROFILER_LOG_ERROR(LOG_CORE, "fclose() error");
}
return;
}
@ -207,7 +207,7 @@ public:
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "CreateConfigFile: fclose() error = %s", buf);
PROFILER_LOG_ERROR(LOG_CORE, "CreateConfigFile: fclose() error = %s", buf);
return;
}
}
@ -467,17 +467,17 @@ public:
{
int pid = -1;
std::string findpid = "pidof " + processName;
HILOG_INFO(LOG_CORE, "find pid command : %s", findpid.c_str());
PROFILER_LOG_INFO(LOG_CORE, "find pid command : %s", findpid.c_str());
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(findpid.c_str(), "r"), pclose);
char line[LINE_SIZE];
do {
if (fgets(line, sizeof(line), pipe.get()) == nullptr) {
HILOG_INFO(LOG_CORE, "not find processName : %s", processName.c_str());
PROFILER_LOG_INFO(LOG_CORE, "not find processName : %s", processName.c_str());
return;
} else if (strlen(line) > 0 && isdigit(static_cast<unsigned char>(line[0]))) {
pid = atoi(line);
HILOG_INFO(LOG_CORE, "find processName : %s, pid: %d", processName.c_str(), pid);
PROFILER_LOG_INFO(LOG_CORE, "find processName : %s, pid: %d", processName.c_str(), pid);
break;
}
} while (1);

View File

@ -35,10 +35,10 @@ BufferWriter::BufferWriter(std::string name,
uint32_t pluginId)
: pluginName_(name), pluginVersion_(version)
{
HILOG_INFO(LOG_CORE, "%s:%s %d [%d] [%d]", __func__, name.c_str(), size, smbFd, eventFd);
PROFILER_LOG_INFO(LOG_CORE, "%s:%s %d [%d] [%d]", __func__, name.c_str(), size, smbFd, eventFd);
shareMemoryBlock_ = ShareMemoryAllocator::GetInstance().CreateMemoryBlockRemote(name, size, smbFd);
if (shareMemoryBlock_ == nullptr) {
HILOG_DEBUG(LOG_CORE, "%s:create shareMemoryBlock_ failed!", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:create shareMemoryBlock_ failed!", __func__);
}
eventNotifier_ = EventNotifier::CreateWithFd(eventFd);
pluginId_ = pluginId;
@ -50,14 +50,14 @@ BufferWriter::BufferWriter(std::string name,
BufferWriter::~BufferWriter()
{
HILOG_DEBUG(LOG_CORE, "%s:destroy eventfd = %d!", __func__, eventNotifier_ ? eventNotifier_->GetFd() : -1);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:destroy eventfd = %d!", __func__, eventNotifier_ ? eventNotifier_->GetFd() : -1);
eventNotifier_ = nullptr;
ShareMemoryAllocator::GetInstance().ReleaseMemoryBlockRemote(pluginName_);
}
void BufferWriter::Report() const
{
HILOG_DEBUG(LOG_CORE, "%s:stats B: %" PRIu64 ", P: %d, W:%" PRIu64 ", F: %d", __func__,
PROFILER_LOG_DEBUG(LOG_CORE, "%s:stats B: %" PRIu64 ", P: %d, W:%" PRIu64 ", F: %d", __func__,
bytesCount_.load(), bytesPending_.load(), writeCount_.load(), flushCount_.load());
}

View File

@ -40,7 +40,7 @@ bool CommandPoller::OnConnect()
bool CommandPoller::OnCreateSessionCmd(const CreateSessionCmd& cmd, SocketContext& context) const
{
HILOG_DEBUG(LOG_CORE, "%s:proc", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:proc", __func__);
CHECK_TRUE(cmd.buffer_sizes().size() != 0 && cmd.plugin_configs().size() != 0, false, "%s:cmd invalid!", __func__);
uint32_t bufferSize = cmd.buffer_sizes(0);
@ -56,24 +56,24 @@ bool CommandPoller::OnCreateSessionCmd(const CreateSessionCmd& cmd, SocketContex
int smbFd = -1;
int eventFd = -1;
if (bufferSize != 0) {
HILOG_DEBUG(LOG_CORE, "%s:bufferSize = %d", __func__, bufferSize);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:bufferSize = %d", __func__, bufferSize);
smbFd = context.ReceiveFileDiscriptor();
eventFd = context.ReceiveFileDiscriptor();
int flags = fcntl(eventFd, F_GETFL);
HILOG_DEBUG(LOG_CORE, "%s:smbFd = %d, eventFd = %d", __func__, smbFd, eventFd);
HILOG_DEBUG(LOG_CORE, "%s:eventFd flags = %X", __func__, flags);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:smbFd = %d, eventFd = %d", __func__, smbFd, eventFd);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:eventFd flags = %X", __func__, flags);
}
CHECK_TRUE(pluginManager->CreateWriter(config.name(), bufferSize, smbFd, eventFd, config.is_protobuf_serialize()),
false, "%s:createWriter failed!", __func__);
CHECK_TRUE(pluginManager->CreatePluginSession(configVec), false,
"%s:createPluginSession failed!", __func__);
HILOG_DEBUG(LOG_CORE, "%s:ok", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:ok", __func__);
return true;
}
bool CommandPoller::OnDestroySessionCmd(const DestroySessionCmd& cmd) const
{
HILOG_DEBUG(LOG_CORE, "%s:proc", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:proc", __func__);
CHECK_TRUE(cmd.plugin_ids().size() != 0, false, "%s:cmd invalid!", __func__);
uint32_t pluginId = cmd.plugin_ids(0);
std::vector<uint32_t> pluginIdVec;
@ -85,13 +85,13 @@ bool CommandPoller::OnDestroySessionCmd(const DestroySessionCmd& cmd) const
"%s:destroyPluginSession failed!", __func__);
CHECK_TRUE(pluginManager->ResetWriter(pluginId), false, "%s:resetWriter failed!", __func__);
CHECK_TRUE(pluginManager->UnloadPlugin(pluginId), false, "%s:unloadPlugin failed!", __func__);
HILOG_DEBUG(LOG_CORE, "%s:ok", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:ok", __func__);
return true;
}
bool CommandPoller::OnStartSessionCmd(const StartSessionCmd& cmd, PluginResult& result) const
{
HILOG_DEBUG(LOG_CORE, "%s:proc", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:proc", __func__);
CHECK_TRUE(cmd.plugin_ids().size() != 0 && cmd.plugin_configs().size() != 0, false,
"%s:cmd invalid!", __func__);
std::vector<uint32_t> pluginIds;
@ -103,13 +103,13 @@ bool CommandPoller::OnStartSessionCmd(const StartSessionCmd& cmd, PluginResult&
CHECK_NOTNULL(pluginManager, false, "promote FAILED!");
CHECK_TRUE(pluginManager->StartPluginSession(pluginIds, configVec, result), false,
"%s:start Session failed!", __func__);
HILOG_DEBUG(LOG_CORE, "%s:OK", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:OK", __func__);
return true;
}
bool CommandPoller::OnStopSessionCmd(const StopSessionCmd& cmd) const
{
HILOG_DEBUG(LOG_CORE, "%s:proc", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:proc", __func__);
CHECK_TRUE(cmd.plugin_ids().size() != 0, false, "%s:cmd invalid!", __func__);
std::vector<uint32_t> pluginIds;
pluginIds.push_back(cmd.plugin_ids(0));
@ -117,13 +117,13 @@ bool CommandPoller::OnStopSessionCmd(const StopSessionCmd& cmd) const
auto pluginManager = pluginManager_.lock(); // promote to shared_ptr
CHECK_NOTNULL(pluginManager, false, "promote FAILED!");
CHECK_TRUE(pluginManager->StopPluginSession(pluginIds), false, "%s:stop Session failed!", __func__);
HILOG_DEBUG(LOG_CORE, "%s:ok", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:ok", __func__);
return true;
}
bool CommandPoller::OnReportBasicDataCmd(const RefreshSessionCmd& cmd) const
{
HILOG_DEBUG(LOG_CORE, "%s:proc", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:proc", __func__);
CHECK_TRUE(cmd.plugin_ids().size() != 0, false, "%s:cmd invalid!", __func__);
std::vector<uint32_t> pluginIds;
pluginIds.push_back(cmd.plugin_ids(0));
@ -131,13 +131,13 @@ bool CommandPoller::OnReportBasicDataCmd(const RefreshSessionCmd& cmd) const
auto pluginManager = pluginManager_.lock(); // promote to shared_ptr
CHECK_NOTNULL(pluginManager, false, "promote FAILED!");
CHECK_TRUE(pluginManager->ReportPluginBasicData(pluginIds), false, "%s:report basic data failed!", __func__);
HILOG_INFO(LOG_CORE, "%s:ok", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:ok", __func__);
return true;
}
bool CommandPoller::OnGetCommandResponse(SocketContext& context, ::GetCommandResponse& response)
{
HILOG_DEBUG(LOG_CORE, "%s:proc", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:proc", __func__);
std::this_thread::sleep_for(std::chrono::milliseconds(SLEEP_TIME));
NotifyResultRequest nrr;
nrr.set_request_id(1);
@ -173,10 +173,10 @@ bool CommandPoller::OnGetCommandResponse(SocketContext& context, ::GetCommandRes
OnReportBasicDataCmd(response.refresh_session_cmd());
status->set_state(ProfilerPluginState::IN_SESSION);
} else {
HILOG_DEBUG(LOG_CORE, "%s:command Response failed!", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:command Response failed!", __func__);
return false;
}
HILOG_DEBUG(LOG_CORE, "%s:ok id = %d", __func__, nrr.command_id());
PROFILER_LOG_DEBUG(LOG_CORE, "%s:ok id = %d", __func__, nrr.command_id());
NotifyResult(nrr);
return true;
}

View File

@ -60,7 +60,7 @@ std::vector<std::string> presetPluginVec = {
volatile sig_atomic_t g_isRunning = true;
void SignalSigtermHandler(int sig)
{
HILOG_INFO(LOG_CORE, "hiprofiler plugin receive sigterm signal!");
PROFILER_LOG_INFO(LOG_CORE, "hiprofiler plugin receive sigterm signal!");
g_isRunning = false;
}
} // namespace
@ -75,7 +75,7 @@ int main(int argc, char* argv[])
const int connectRetrySeconds = 3;
std::string pluginDir(DEFAULT_PLUGIN_PATH);
if (argv[1] != nullptr) {
HILOG_DEBUG(LOG_CORE, "%s:pluginDir = %s", __func__, argv[1]);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:pluginDir = %s", __func__, argv[1]);
pluginDir = argv[1];
}
@ -89,7 +89,7 @@ int main(int argc, char* argv[])
if (commandPoller->OnConnect()) {
break;
}
HILOG_DEBUG(LOG_CORE, "%s:connect failed, try again", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:connect failed, try again", __func__);
sleep(connectRetrySeconds);
}
pluginManager->SetCommandPoller(commandPoller);
@ -98,9 +98,9 @@ int main(int argc, char* argv[])
for (size_t i = 0; i < presetPluginVec.size(); i++) {
const std::string pluginPath = DEFAULT_LIB_PATH + presetPluginVec[i];
if (pluginManager->AddPlugin(pluginPath)) {
HILOG_INFO(LOG_CORE, "add preset plugin %s success!", pluginPath.c_str());
PROFILER_LOG_INFO(LOG_CORE, "add preset plugin %s success!", pluginPath.c_str());
} else {
HILOG_INFO(LOG_CORE, "add preset plugin %s failed!", pluginPath.c_str());
PROFILER_LOG_INFO(LOG_CORE, "add preset plugin %s failed!", pluginPath.c_str());
}
}
@ -108,7 +108,7 @@ int main(int argc, char* argv[])
std::this_thread::sleep_for(std::chrono::milliseconds(SLEEP_ONE_SECOND));
}
if (flock(lockFileFd, LOCK_UN) == -1) {
HILOG_INFO(LOG_CORE, "release lockfile failed!");
PROFILER_LOG_INFO(LOG_CORE, "release lockfile failed!");
}
close(lockFileFd);
pluginManager->StopAllPluginSession();

View File

@ -45,7 +45,7 @@ std::string ComputeFileSha256(const std::string& path)
size_t nbytes = 0;
if ((path.length() >= PATH_MAX) || (realpath(path.c_str(), realPath) == nullptr)) {
HILOG_ERROR(LOG_CORE, "%s:path is invalid: %s, errno=%d", __func__, path.c_str(), errno);
PROFILER_LOG_ERROR(LOG_CORE, "%s:path is invalid: %s, errno=%d", __func__, path.c_str(), errno);
return "";
}
std::unique_ptr<FILE, decltype(fclose)*> fptr(fopen(realPath, "rb"), fclose);
@ -61,7 +61,7 @@ std::string ComputeFileSha256(const std::string& path)
result.push_back(HEX_CHARS[LHB(out[i])]);
}
HILOG_DEBUG(LOG_CORE, "%s:%s-(%s)", __func__, path.c_str(), result.c_str());
PROFILER_LOG_DEBUG(LOG_CORE, "%s:%s-(%s)", __func__, path.c_str(), result.c_str());
return result;
}
} // namespace
@ -80,27 +80,27 @@ bool PluginManager::AddPlugin(const std::string& pluginPath)
CHECK_TRUE(plugin->Load(), false, "%s:load failed!", __func__);
if (!plugin->BindFunctions()) {
HILOG_DEBUG(LOG_CORE, "%s:bindFunctions failed %s", __func__, pluginPath.c_str());
PROFILER_LOG_DEBUG(LOG_CORE, "%s:bindFunctions failed %s", __func__, pluginPath.c_str());
plugin->Unload();
return false;
}
if (!plugin->GetInfo(info)) {
HILOG_DEBUG(LOG_CORE, "%s:getinfo failed!", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:getinfo failed!", __func__);
plugin->Unload();
return false;
}
std::string pluginName = info.name;
if (pluginIds_.find(pluginName) != pluginIds_.end()) {
HILOG_DEBUG(LOG_CORE, "%s:already add", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:already add", __func__);
plugin->Unload();
return false;
}
HILOG_DEBUG(LOG_CORE, "%s:add plugin name = %s", __func__, pluginName.c_str());
PROFILER_LOG_DEBUG(LOG_CORE, "%s:add plugin name = %s", __func__, pluginName.c_str());
if (!plugin->Unload()) {
HILOG_DEBUG(LOG_CORE, "%s:unload failed!", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:unload failed!", __func__);
return false;
}
@ -122,19 +122,19 @@ bool PluginManager::RegisterPlugin(const PluginModulePtr& plugin, const std::str
request.set_plugin_version(pluginInfo.pluginVersion);
if (commandPoller_->RegisterPlugin(request, response)) {
if (response.status() == ResponseStatus::OK) {
HILOG_DEBUG(LOG_CORE, "%s:response.plugin_id() = %d", __func__, response.plugin_id());
PROFILER_LOG_DEBUG(LOG_CORE, "%s:response.plugin_id() = %d", __func__, response.plugin_id());
pluginIds_[pluginInfo.name] = response.plugin_id();
pluginModules_.insert(std::pair<uint32_t, std::shared_ptr<PluginModule>>(response.plugin_id(), plugin));
pluginPathAndNameMap_.insert(
{pluginPath, pluginInfo.name}
);
HILOG_DEBUG(LOG_CORE, "%s:registerPlugin ok", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:registerPlugin ok", __func__);
} else {
HILOG_DEBUG(LOG_CORE, "%s:registerPlugin fail 1", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:registerPlugin fail 1", __func__);
return false;
}
} else {
HILOG_DEBUG(LOG_CORE, "%s:registerPlugin fail 2", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:registerPlugin fail 2", __func__);
return false;
}
@ -149,33 +149,34 @@ bool PluginManager::RemovePlugin(const std::string& pluginPath)
std::string pluginName = pluginPathAndNameMap_[pluginPath];
auto it = pluginIds_.find(pluginName);
if (it == pluginIds_.end()) {
HILOG_DEBUG(LOG_CORE, "%s:plugin not exist", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:plugin not exist", __func__);
return false;
}
uint32_t index = it->second;
// stop plugin if plugin running
if (pluginModules_[index]->IsRunning()) {
HILOG_WARN(LOG_CORE, "%s:plugin delete while using, stop plugin", __func__);
PROFILER_LOG_WARN(LOG_CORE, "%s:plugin delete while using, stop plugin", __func__);
// delete schedule task if POLLING mode
if (pluginModules_[index]->GetSampleMode() == PluginModule::SampleMode::POLLING) {
HILOG_WARN(LOG_CORE, "%s:delete schedule task plugin name = %s", __func__, pluginName.c_str());
PROFILER_LOG_WARN(LOG_CORE, "%s:delete schedule task plugin name = %s", __func__, pluginName.c_str());
if (!scheduleTaskManager_.UnscheduleTask(scheduleTask_[pluginName])) {
HILOG_WARN(LOG_CORE, "%s:delete schedule task plugin name = %s failed!", __func__, pluginName.c_str());
PROFILER_LOG_WARN(LOG_CORE, "%s:delete schedule task plugin name = %s failed!",
__func__, pluginName.c_str());
}
}
if (!pluginModules_[index]->StopSession()) {
HILOG_WARN(LOG_CORE, "%s:plugin stop failed!", __func__);
PROFILER_LOG_WARN(LOG_CORE, "%s:plugin stop failed!", __func__);
}
}
// Unload plugin if plugin loaded
if (pluginModules_[index]->IsLoaded()) {
HILOG_WARN(LOG_CORE, "%s:plugin delete while using, unload plugin", __func__);
PROFILER_LOG_WARN(LOG_CORE, "%s:plugin delete while using, unload plugin", __func__);
if (!pluginModules_[index]->Unload()) {
HILOG_WARN(LOG_CORE, "%s:unload plugin failed!", __func__);
PROFILER_LOG_WARN(LOG_CORE, "%s:unload plugin failed!", __func__);
}
}
@ -185,17 +186,17 @@ bool PluginManager::RemovePlugin(const std::string& pluginPath)
UnregisterPluginResponse response;
if (commandPoller_->UnregisterPlugin(request, response)) {
if (response.status() != ResponseStatus::OK) {
HILOG_DEBUG(LOG_CORE, "%s:registerPlugin fail 1", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:registerPlugin fail 1", __func__);
return false;
}
} else {
HILOG_DEBUG(LOG_CORE, "%s:registerPlugin fail 2", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:registerPlugin fail 2", __func__);
return false;
}
auto itPluginModules = pluginModules_.find(index);
if (it == pluginIds_.end()) {
HILOG_DEBUG(LOG_CORE, "%s:plugin not exist", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:plugin not exist", __func__);
return false;
}
pluginModules_.erase(itPluginModules);
@ -205,7 +206,7 @@ bool PluginManager::RemovePlugin(const std::string& pluginPath)
bool PluginManager::LoadPlugin(const std::string& pluginName)
{
HILOG_DEBUG(LOG_CORE, "%s:size = %zu", __func__, pluginIds_.size());
PROFILER_LOG_DEBUG(LOG_CORE, "%s:size = %zu", __func__, pluginIds_.size());
auto it = pluginIds_.find(pluginName);
CHECK_TRUE(it != pluginIds_.end(), false, "%s:plugin not exist", __func__);
uint32_t index = it->second;
@ -223,7 +224,7 @@ bool PluginManager::UnloadPlugin(const std::string& pluginName)
{
auto it = pluginIds_.find(pluginName);
if (it == pluginIds_.end()) {
HILOG_DEBUG(LOG_CORE, "%s:plugin not exist", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:plugin not exist", __func__);
return false;
}
@ -232,9 +233,9 @@ bool PluginManager::UnloadPlugin(const std::string& pluginName)
bool PluginManager::UnloadPlugin(const uint32_t pluginId)
{
HILOG_INFO(LOG_CORE, "%s:ready!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:ready!", __func__);
if (pluginModules_.find(pluginId) == pluginModules_.end()) {
HILOG_DEBUG(LOG_CORE, "%s:plugin not exist", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:plugin not exist", __func__);
return false;
}
if (!pluginModules_[pluginId]->Unload()) {
@ -245,17 +246,17 @@ bool PluginManager::UnloadPlugin(const uint32_t pluginId)
bool PluginManager::CreatePluginSession(const std::vector<ProfilerPluginConfig>& config)
{
HILOG_DEBUG(LOG_CORE, "%s:ready", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:ready", __func__);
for (size_t idx = 0; idx < config.size(); ++idx) {
HILOG_DEBUG(LOG_CORE, "%s:config->name() = %s", __func__, config[idx].name().c_str());
PROFILER_LOG_DEBUG(LOG_CORE, "%s:config->name() = %s", __func__, config[idx].name().c_str());
auto it = pluginIds_.find(config[idx].name());
if (it == pluginIds_.end()) {
HILOG_DEBUG(LOG_CORE, "%s:plugin not find", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:plugin not find", __func__);
return false;
}
HILOG_INFO(LOG_CORE, "%s:index = %d, clock = %s", __func__, it->second, config[idx].clock().c_str());
PROFILER_LOG_INFO(LOG_CORE, "%s:index = %d, clock = %s", __func__, it->second, config[idx].clock().c_str());
pluginModules_[it->second]->SetConfigData(config[idx].config_data());
pluginModules_[it->second]->SetClockId(COMMON::GetClockId(config[idx].clock()));
}
@ -267,7 +268,7 @@ bool PluginManager::DestroyPluginSession(const std::vector<uint32_t>& pluginIds)
for (uint32_t id : pluginIds) {
auto it = pluginModules_.find(id);
if (it == pluginModules_.end()) {
HILOG_DEBUG(LOG_CORE, "%s:plugin not find", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:plugin not find", __func__);
return false;
}
}
@ -277,13 +278,13 @@ bool PluginManager::DestroyPluginSession(const std::vector<uint32_t>& pluginIds)
bool PluginManager::StartPluginSession(const std::vector<uint32_t>& pluginIds,
const std::vector<ProfilerPluginConfig>& config, PluginResult& result)
{
HILOG_INFO(LOG_CORE, "%s:ready!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:ready!", __func__);
size_t idx = 0;
for (uint32_t id : pluginIds) {
auto it = pluginModules_.find(id);
if (it == pluginModules_.end()) {
HILOG_DEBUG(LOG_CORE, "%s:plugin not find", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:plugin not find", __func__);
return false;
}
auto plugin = pluginModules_[id];
@ -294,17 +295,17 @@ bool PluginManager::StartPluginSession(const std::vector<uint32_t>& pluginIds,
if (plugin->GetSampleMode() == PluginModule::SampleMode::POLLING) {
if (idx > config.size()) {
HILOG_WARN(LOG_CORE, "%s:idx %zu out of size %zu", __func__, idx, config.size());
PROFILER_LOG_WARN(LOG_CORE, "%s:idx %zu out of size %zu", __func__, idx, config.size());
return false;
}
if (config[idx].sample_interval() == 0) {
HILOG_DEBUG(LOG_CORE, "%s:scheduleTask interval == 0 error!", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:scheduleTask interval == 0 error!", __func__);
return false;
}
auto callback = std::bind(&PluginManager::PullResult, this, id, config[idx].is_protobuf_serialize());
int32_t timerFd = scheduleTaskManager_.ScheduleTask(callback, config[idx].sample_interval());
if (timerFd == -1) {
HILOG_DEBUG(LOG_CORE, "%s:scheduleTask failed!", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:scheduleTask failed!", __func__);
return false;
}
scheduleTask_[config[idx].name()] = timerFd;
@ -326,16 +327,16 @@ bool PluginManager::StartPluginSession(const std::vector<uint32_t>& pluginIds,
bool PluginManager::StopPluginSession(const std::vector<uint32_t>& pluginIds)
{
HILOG_INFO(LOG_CORE, "%s:ready!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:ready!", __func__);
for (uint32_t id : pluginIds) {
if (pluginModules_.find(id) == pluginModules_.end()) {
HILOG_DEBUG(LOG_CORE, "%s:plugin not find", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:plugin not find", __func__);
return false;
}
if (pluginModules_[id]->GetSampleMode() == PluginModule::SampleMode::POLLING) {
for (const auto& it : pluginIds_) {
if (it.second == id) {
HILOG_DEBUG(LOG_CORE, "%s:find plugin name = %s", __func__, it.first.c_str());
PROFILER_LOG_DEBUG(LOG_CORE, "%s:find plugin name = %s", __func__, it.first.c_str());
if (!scheduleTaskManager_.UnscheduleTask(scheduleTask_[it.first])) {
return false;
}
@ -361,7 +362,7 @@ bool PluginManager::StopAllPluginSession()
bool PluginManager::ReportPluginBasicData(const std::vector<uint32_t>& pluginIds)
{
HILOG_INFO(LOG_CORE, "%s:ready!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:ready!", __func__);
for (uint32_t id : pluginIds) {
CHECK_TRUE(pluginModules_.find(id) != pluginModules_.end(), false, "%s:plugin not find", __func__);
// notify plugin to report basic data
@ -372,7 +373,7 @@ bool PluginManager::ReportPluginBasicData(const std::vector<uint32_t>& pluginIds
bool PluginManager::SubmitResult(const PluginResult& pluginResult)
{
HILOG_INFO(LOG_CORE, "%s:ready!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:ready!", __func__);
NotifyResultRequest request;
CHECK_NOTNULL(commandPoller_, false, "%s:commandPoller_ is null", __func__);
request.set_request_id(commandPoller_->GetRequestId());
@ -381,14 +382,14 @@ bool PluginManager::SubmitResult(const PluginResult& pluginResult)
*p = pluginResult;
NotifyResultResponse response;
if (!commandPoller_->NotifyResult(request, response)) {
HILOG_DEBUG(LOG_CORE, "%s:fail 1", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:fail 1", __func__);
return false;
}
if (response.status() != ResponseStatus::OK) {
HILOG_DEBUG(LOG_CORE, "%s:fail 2", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:fail 2", __func__);
return false;
}
HILOG_DEBUG(LOG_CORE, "%s:ok", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:ok", __func__);
return true;
}
@ -399,7 +400,7 @@ bool PluginManager::PullResult(uint32_t pluginId, bool isProtobufSerialize)
std::string version = "";
auto it = pluginModules_.find(pluginId);
if (it == pluginModules_.end()) {
HILOG_DEBUG(LOG_CORE, "%s:plugin not find", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:plugin not find", __func__);
return false;
}
pluginModules_[pluginId]->GetBufferSizeHint(size);
@ -470,19 +471,19 @@ bool PluginManager::CreateWriter(std::string pluginName, uint32_t bufferSize, in
{
auto it = pluginIds_.find(pluginName);
if (it == pluginIds_.end()) {
HILOG_DEBUG(LOG_CORE, "%s:plugin not exist", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:plugin not exist", __func__);
return false;
}
uint32_t index = it->second;
if (bufferSize > 0) {
HILOG_DEBUG(LOG_CORE, "%s:%s Use ShareMemory %d", __func__, pluginName.c_str(), bufferSize);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:%s Use ShareMemory %d", __func__, pluginName.c_str(), bufferSize);
std::string pluginVersion = "";
pluginModules_[index]->GetPluginVersion(pluginVersion);
pluginModules_[index]->RegisterWriter(std::make_shared<BufferWriter>
(pluginName, pluginVersion, bufferSize, smbFd, eventFd, index), isProtobufSerialize);
} else {
HILOG_ERROR(LOG_CORE, "%s:no shared memory buffer allocated!", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s:no shared memory buffer allocated!", __func__);
return false;
}
return true;
@ -491,10 +492,10 @@ bool PluginManager::CreateWriter(std::string pluginName, uint32_t bufferSize, in
bool PluginManager::ResetWriter(uint32_t pluginId)
{
if (pluginModules_.find(pluginId) == pluginModules_.end()) {
HILOG_DEBUG(LOG_CORE, "%s:plugin not exist", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:plugin not exist", __func__);
return false;
}
HILOG_DEBUG(LOG_CORE, "%s:resetWriter %u", __func__, pluginId);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:resetWriter %u", __func__, pluginId);
pluginModules_[pluginId]->RegisterWriter(nullptr);
return true;
}

View File

@ -35,7 +35,7 @@ bool PluginModule::Load()
{
char realPath[PATH_MAX + 1] = {0};
if (handle_ != nullptr) {
HILOG_DEBUG(LOG_CORE, "%s:already open", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:already open", __func__);
return false;
}
CHECK_TRUE((path_.length() < PATH_MAX) && (realpath(path_.c_str(), realPath) != nullptr), false,
@ -44,7 +44,7 @@ bool PluginModule::Load()
std::string rpath = realPath; // for SC warning
handle_ = dlopen(rpath.c_str(), RTLD_NODELETE);
if (handle_ == nullptr) {
HILOG_DEBUG(LOG_CORE, "%s:dlopen err:%s.", __func__, dlerror());
PROFILER_LOG_DEBUG(LOG_CORE, "%s:dlopen err:%s.", __func__, dlerror());
return false;
}
return true;
@ -52,10 +52,10 @@ bool PluginModule::Load()
bool PluginModule::Unload()
{
HILOG_INFO(LOG_CORE, "%s:unload ready!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:unload ready!", __func__);
if (handle_ != nullptr) {
int ret = dlclose(handle_);
HILOG_INFO(LOG_CORE, "%s:unload plugin ret = %d", __func__, ret);
PROFILER_LOG_INFO(LOG_CORE, "%s:unload plugin ret = %d", __func__, ret);
handle_ = nullptr;
structPtr_ = nullptr;
return true;
@ -105,7 +105,7 @@ std::string PluginModule::GetConfigData() const
void PluginModule::SetClockId(clockid_t clockId)
{
clockId_ = clockId;
HILOG_INFO(LOG_CORE, "SetClockId: plugin=%s, clock=%d", GetPluginName().c_str(), clockId);
PROFILER_LOG_INFO(LOG_CORE, "SetClockId: plugin=%s, clock=%d", GetPluginName().c_str(), clockId);
if (writerAdapter_ != nullptr && writerAdapter_->GetWriter() != nullptr) {
writerAdapter_->GetWriter()->SetClockId(clockId);
}
@ -199,19 +199,19 @@ bool PluginModule::BindFunctions()
if (structPtr_ == nullptr) {
structPtr_ = static_cast<PluginModuleStruct*>(dlsym(handle_, "g_pluginModule"));
if (structPtr_ == nullptr) {
HILOG_DEBUG(LOG_CORE, "%s:structPtr_ == nullptr", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:structPtr_ == nullptr", __func__);
return false;
}
}
if (structPtr_->callbacks == nullptr) {
HILOG_DEBUG(LOG_CORE, "%s:structPtr_->callbacks == nullptr", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:structPtr_->callbacks == nullptr", __func__);
return false;
}
if ((structPtr_->callbacks->onPluginSessionStart == nullptr) ||
(structPtr_->callbacks->onPluginSessionStop == nullptr)) {
HILOG_DEBUG(LOG_CORE, "%s:onPluginSessionStart == nullptr", __func__);
PROFILER_LOG_DEBUG(LOG_CORE, "%s:onPluginSessionStart == nullptr", __func__);
return false;
}
@ -220,7 +220,7 @@ bool PluginModule::BindFunctions()
bool PluginModule::StartSession(const uint8_t* buffer, uint32_t size)
{
HILOG_DEBUG(LOG_CORE, "StartSession");
PROFILER_LOG_DEBUG(LOG_CORE, "StartSession");
CHECK_NOTNULL(handle_, false, "%s:plugin not load", __func__);
if (structPtr_ != nullptr && structPtr_->callbacks != nullptr) {
if (structPtr_->callbacks->onPluginSessionStart) {
@ -233,7 +233,7 @@ bool PluginModule::StartSession(const uint8_t* buffer, uint32_t size)
bool PluginModule::StopSession()
{
HILOG_INFO(LOG_CORE, "%s:stop Session ready!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:stop Session ready!", __func__);
CHECK_NOTNULL(handle_, false, "%s:plugin not load", __func__);
if (structPtr_ != nullptr && structPtr_->callbacks != nullptr) {
if (structPtr_->callbacks->onPluginSessionStop != nullptr) {
@ -246,7 +246,7 @@ bool PluginModule::StopSession()
bool PluginModule::ReportBasicData()
{
HILOG_INFO(LOG_CORE, "%s:report basic data ready!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:report basic data ready!", __func__);
CHECK_NOTNULL(handle_, false, "%s:plugin not load", __func__);
if (structPtr_ != nullptr && structPtr_->callbacks != nullptr) {
if (structPtr_->callbacks->onReportBasicDataCallback != nullptr) {

View File

@ -36,7 +36,7 @@ PluginWatcher::PluginWatcher(const PluginManagerPtr& pluginManager)
{
inotifyFd_ = inotify_init1(IN_CLOEXEC | IN_NONBLOCK);
if (inotifyFd_ < 0) {
HILOG_INFO(LOG_CORE, "%s:inotify_init1 failed! inotifyFd_ : %d", __func__, inotifyFd_);
PROFILER_LOG_INFO(LOG_CORE, "%s:inotify_init1 failed! inotifyFd_ : %d", __func__, inotifyFd_);
} else {
monitorThread_ = std::thread(&PluginWatcher::Monitor, this);
}
@ -61,7 +61,7 @@ bool PluginWatcher::ScanPlugins(const std::string& pluginDir)
struct dirent* entry = nullptr;
char fullpath[PATH_MAX + 1] = {0};
realpath(pluginDir.c_str(), fullpath);
HILOG_INFO(LOG_CORE, "%s:scan plugin from directory %s", __func__, fullpath);
PROFILER_LOG_INFO(LOG_CORE, "%s:scan plugin from directory %s", __func__, fullpath);
dir = opendir(fullpath);
if (dir == nullptr) {
return false;
@ -69,7 +69,7 @@ bool PluginWatcher::ScanPlugins(const std::string& pluginDir)
while (true) {
entry = readdir(dir);
if (!entry) {
HILOG_INFO(LOG_CORE, "%s:readdir finish!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:readdir finish!", __func__);
break;
}
std::string fileName = entry->d_name;
@ -91,10 +91,10 @@ bool PluginWatcher::WatchPlugins(const std::string& pluginDir)
int wd = inotify_add_watch(inotifyFd_, fullpath, IN_ALL_EVENTS);
if (wd < 0) {
HILOG_INFO(LOG_CORE, "%s:inotify_add_watch add directory %s failed!", __func__, pluginDir.c_str());
PROFILER_LOG_INFO(LOG_CORE, "%s:inotify_add_watch add directory %s failed!", __func__, pluginDir.c_str());
return false;
}
HILOG_INFO(LOG_CORE, "%s:inotify_add_watch add directory %s success!", __func__, fullpath);
PROFILER_LOG_INFO(LOG_CORE, "%s:inotify_add_watch add directory %s success!", __func__, fullpath);
std::lock_guard<std::mutex> guard(mtx_);
wdToDir_.insert(std::pair<int, std::string>(wd, std::string(fullpath)));
return true;
@ -137,7 +137,7 @@ bool PluginWatcher::MonitorIsSet()
}
}
if (memset_s(buffer, sizeof(buffer), 0, sizeof(buffer)) != 0) {
HILOG_ERROR(LOG_CORE, "%s:memset_s error!", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s:memset_s error!", __func__);
}
return true;
}
@ -171,12 +171,12 @@ void PluginWatcher::OnPluginAdded(const std::string& pluginPath)
auto pluginManager = pluginManager_.lock();
if (pluginManager != nullptr) {
if (pluginManager->AddPlugin(pluginPath)) {
HILOG_INFO(LOG_CORE, "%s:plugin %s add success!", __func__, pluginPath.c_str());
PROFILER_LOG_INFO(LOG_CORE, "%s:plugin %s add success!", __func__, pluginPath.c_str());
} else {
HILOG_INFO(LOG_CORE, "%s:pluginPath %s add failed!", __func__, pluginPath.c_str());
PROFILER_LOG_INFO(LOG_CORE, "%s:pluginPath %s add failed!", __func__, pluginPath.c_str());
}
} else {
HILOG_INFO(LOG_CORE, "%s:weak_ptr pluginManager lock failed!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:weak_ptr pluginManager lock failed!", __func__);
}
}
@ -185,11 +185,11 @@ void PluginWatcher::OnPluginRemoved(const std::string& pluginPath)
auto pluginManager = pluginManager_.lock();
if (pluginManager != nullptr) {
if (pluginManager->RemovePlugin(pluginPath)) {
HILOG_INFO(LOG_CORE, "%s:pluginPath %s remove success!", __func__, pluginPath.c_str());
PROFILER_LOG_INFO(LOG_CORE, "%s:pluginPath %s remove success!", __func__, pluginPath.c_str());
} else {
HILOG_INFO(LOG_CORE, "%s:pluginPath %s remove failed!", __func__, pluginPath.c_str());
PROFILER_LOG_INFO(LOG_CORE, "%s:pluginPath %s remove failed!", __func__, pluginPath.c_str());
}
} else {
HILOG_INFO(LOG_CORE, "%s:weak_ptr pluginManager lock failed!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:weak_ptr pluginManager lock failed!", __func__);
}
}

View File

@ -44,7 +44,7 @@ int InitShareMemory1()
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "CreateBlock ftruncate ERR : %s", buf);
PROFILER_LOG_ERROR(LOG_CORE, "CreateBlock ftruncate ERR : %s", buf);
return -1;
}
@ -54,7 +54,7 @@ int InitShareMemory1()
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "CreateBlock g_smbAddr1 mmap ERR : %s", buf);
PROFILER_LOG_ERROR(LOG_CORE, "CreateBlock g_smbAddr1 mmap ERR : %s", buf);
return -1;
}
@ -81,7 +81,7 @@ int InitShareMemory2()
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "CreateBlock ftruncate ERR : %s", buf);
PROFILER_LOG_ERROR(LOG_CORE, "CreateBlock ftruncate ERR : %s", buf);
return -1;
}
@ -91,7 +91,7 @@ int InitShareMemory2()
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "CreateBlock g_smbAddr2 mmap ERR : %s", buf);
PROFILER_LOG_ERROR(LOG_CORE, "CreateBlock g_smbAddr2 mmap ERR : %s", buf);
return -1;
}

View File

@ -76,7 +76,7 @@ constexpr uint32_t CPU_PROFILER_INTERVAL_DEFAULT = 1000;
int32_t ArkTSPlugin::Start(const uint8_t* configData, uint32_t configSize)
{
if (protoConfig_.ParseFromArray(configData, configSize) <= 0) {
HILOG_ERROR(LOG_CORE, "%s:parseFromArray failed!", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s:parseFromArray failed!", __func__);
return -1;
}
@ -91,7 +91,7 @@ int32_t ArkTSPlugin::Start(const uint8_t* configData, uint32_t configSize)
pid_ = protoConfig_.pid();
if (pid_ <= 0) {
HILOG_ERROR(LOG_CORE, "%s: pid is less than or equal to 0", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s: pid is less than or equal to 0", __func__);
return -1;
}
@ -109,7 +109,7 @@ int32_t ArkTSPlugin::Start(const uint8_t* configData, uint32_t configSize)
if (protoConfig_.enable_cpu_profiler()) {
if (EnableCpuProfiler() != 0) {
HILOG_ERROR(LOG_CORE, "arkts plugin cpu profiler start failed");
PROFILER_LOG_ERROR(LOG_CORE, "arkts plugin cpu profiler start failed");
return -1;
}
}
@ -122,11 +122,11 @@ int32_t ArkTSPlugin::Start(const uint8_t* configData, uint32_t configSize)
return EnableTimeline();
}
case static_cast<int32_t>(HeapType::INVALID): {
HILOG_INFO(LOG_CORE, "arkts plugin memory type is INVALID");
PROFILER_LOG_INFO(LOG_CORE, "arkts plugin memory type is INVALID");
return 0;
}
default: {
HILOG_ERROR(LOG_CORE, "arkts plugin start type error");
PROFILER_LOG_ERROR(LOG_CORE, "arkts plugin start type error");
return -1;
}
}
@ -146,14 +146,14 @@ int32_t ArkTSPlugin::EnableTimeline()
int32_t ArkTSPlugin::EnableSnapshot()
{
if (protoConfig_.interval() == 0) {
HILOG_ERROR(LOG_CORE, "%s:scheduleTask interval == 0 error!", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s:scheduleTask interval == 0 error!", __func__);
return -1;
}
snapshotCmd_ = SNAPSHOT_HEAD + (protoConfig_.capture_numeric_value() ? "true" : "false") + SNAPSHOT_TAIL;
auto callback = std::bind(&ArkTSPlugin::Snapshot, this);
snapshotScheduleTaskFd_ = scheduleTaskManager_.ScheduleTask(callback, protoConfig_.interval() * TIME_BASE);
if (snapshotScheduleTaskFd_ == -1) {
HILOG_ERROR(LOG_CORE, "%s:scheduleTask failed!", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s:scheduleTask failed!", __func__);
return -1;
}
return 0;
@ -198,7 +198,7 @@ int32_t ArkTSPlugin::Stop()
break;
}
default: {
HILOG_ERROR(LOG_CORE, "arkts plugin stop type error");
PROFILER_LOG_ERROR(LOG_CORE, "arkts plugin stop type error");
break;
}
}
@ -251,7 +251,7 @@ void ArkTSPlugin::FlushData(const std::string& command)
while (true) {
std::string recv = Decode();
if (recv.empty()) {
HILOG_ERROR(LOG_CORE, "%s: recv is empty", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s: recv is empty", __func__);
break;
}
ArkTSResult data;
@ -282,19 +282,20 @@ void ArkTSPlugin::FlushData(const std::string& command)
bool ArkTSPlugin::ClientConnectUnixWebSocket(const std::string& sockName, uint32_t timeoutLimit)
{
if (socketState_ != SocketState::UNINITED) {
HILOG_ERROR(LOG_CORE, "client has inited");
PROFILER_LOG_ERROR(LOG_CORE, "client has inited");
return true;
}
client_ = socket(AF_UNIX, SOCK_STREAM, 0);
if (client_ < SOCKET_SUCCESS) {
HILOG_ERROR(LOG_CORE, "client socket failed, error = %d, , desc = %s", errno, strerror(errno));
PROFILER_LOG_ERROR(LOG_CORE, "client socket failed, error = %d, , desc = %s", errno, strerror(errno));
return false;
}
// set send and recv timeout limit
if (!SetWebSocketTimeOut(client_, timeoutLimit)) {
HILOG_ERROR(LOG_CORE, "client SetWebSocketTimeOut failed, error = %d, desc = %s", errno, strerror(errno));
PROFILER_LOG_ERROR(LOG_CORE, "client SetWebSocketTimeOut failed, error = %d, desc = %s",
errno, strerror(errno));
close(client_);
client_ = -1;
return false;
@ -302,15 +303,16 @@ bool ArkTSPlugin::ClientConnectUnixWebSocket(const std::string& sockName, uint32
struct sockaddr_un serverAddr;
if (memset_s(&serverAddr, sizeof(serverAddr), 0, sizeof(serverAddr)) != EOK) {
HILOG_ERROR(LOG_CORE, "client memset_s serverAddr failed, error = %d, desc = %s", errno, strerror(errno));
PROFILER_LOG_ERROR(LOG_CORE, "client memset_s serverAddr failed, error = %d, desc = %s",
errno, strerror(errno));
close(client_);
client_ = -1;
return false;
}
serverAddr.sun_family = AF_UNIX;
if (strcpy_s(serverAddr.sun_path + 1, sizeof(serverAddr.sun_path) - 1, sockName.c_str()) != EOK) {
HILOG_ERROR(LOG_CORE, "client strcpy_s serverAddr.sun_path failed, error = %d, , desc = %s", errno,
strerror(errno));
PROFILER_LOG_ERROR(LOG_CORE, "client strcpy_s serverAddr.sun_path failed, error = %d, , desc = %s",
errno, strerror(errno));
close(client_);
client_ = -1;
return false;
@ -320,56 +322,56 @@ bool ArkTSPlugin::ClientConnectUnixWebSocket(const std::string& sockName, uint32
uint32_t len = offsetof(struct sockaddr_un, sun_path) + strlen(sockName.c_str()) + 1;
int ret = connect(client_, reinterpret_cast<struct sockaddr*>(&serverAddr), static_cast<int32_t>(len));
if (ret != SOCKET_SUCCESS) {
HILOG_ERROR(LOG_CORE, "client connect failed, error, error = %d, , desc = %s", errno, strerror(errno));
PROFILER_LOG_ERROR(LOG_CORE, "client connect failed, error, error = %d, , desc = %s", errno, strerror(errno));
close(client_);
client_ = -1;
return false;
}
socketState_ = SocketState::INITED;
HILOG_INFO(LOG_CORE, "client connect success...");
PROFILER_LOG_INFO(LOG_CORE, "client connect success...");
return true;
}
bool ArkTSPlugin::ClientSendWSUpgradeReq()
{
if (socketState_ == SocketState::UNINITED) {
HILOG_ERROR(LOG_CORE, "client has not inited");
PROFILER_LOG_ERROR(LOG_CORE, "client has not inited");
return false;
}
if (socketState_ == SocketState::CONNECTED) {
HILOG_ERROR(LOG_CORE, "client has connected");
PROFILER_LOG_ERROR(LOG_CORE, "client has connected");
return true;
}
int msgLen = strlen(CLIENT_WEBSOCKET_UPGRADE_REQ);
int32_t sendLen = send(client_, CLIENT_WEBSOCKET_UPGRADE_REQ, msgLen, 0);
if (sendLen != msgLen) {
HILOG_ERROR(LOG_CORE, "client send wsupgrade req failed, error = %d, desc = %s", errno, strerror(errno));
PROFILER_LOG_ERROR(LOG_CORE, "client send wsupgrade req failed, error = %d, desc = %s", errno, strerror(errno));
socketState_ = SocketState::UNINITED;
shutdown(client_, SHUT_RDWR);
close(client_);
client_ = -1;
return false;
}
HILOG_INFO(LOG_CORE, "client send wsupgrade req success");
PROFILER_LOG_INFO(LOG_CORE, "client send wsupgrade req success");
return true;
}
bool ArkTSPlugin::ClientRecvWSUpgradeRsp()
{
if (socketState_ == SocketState::UNINITED) {
HILOG_ERROR(LOG_CORE, "client has not inited");
PROFILER_LOG_ERROR(LOG_CORE, "client has not inited");
return false;
}
if (socketState_ == SocketState::CONNECTED) {
HILOG_ERROR(LOG_CORE, "ClientRecvWSUpgradeRsp::client has connected");
PROFILER_LOG_ERROR(LOG_CORE, "ClientRecvWSUpgradeRsp::client has connected");
return true;
}
char recvBuf[CLIENT_WEBSOCKET_UPGRADE_RSP_LEN + 1] = {0};
int32_t bufLen = recv(client_, recvBuf, CLIENT_WEBSOCKET_UPGRADE_RSP_LEN, 0);
if (bufLen != CLIENT_WEBSOCKET_UPGRADE_RSP_LEN) {
HILOG_ERROR(LOG_CORE, "client recv wsupgrade rsp failed, error = %d, desc = %s", errno, strerror(errno));
PROFILER_LOG_ERROR(LOG_CORE, "client recv wsupgrade rsp failed, error = %d, desc = %s", errno, strerror(errno));
socketState_ = SocketState::UNINITED;
shutdown(client_, SHUT_RDWR);
close(client_);
@ -377,14 +379,14 @@ bool ArkTSPlugin::ClientRecvWSUpgradeRsp()
return false;
}
socketState_ = SocketState::CONNECTED;
HILOG_INFO(LOG_CORE, "client recv wsupgrade rsp success");
PROFILER_LOG_INFO(LOG_CORE, "client recv wsupgrade rsp success");
return true;
}
bool ArkTSPlugin::ClientSendReq(const std::string& message)
{
if (socketState_ != SocketState::CONNECTED) {
HILOG_ERROR(LOG_CORE, "client has not connected");
PROFILER_LOG_ERROR(LOG_CORE, "client has not connected");
return false;
}
@ -417,7 +419,7 @@ bool ArkTSPlugin::ClientSendReq(const std::string& message)
}
if (memcpy_s(sendBuf + sendMsgLen, SOCKET_MASK_LEN, MASK_KEY, SOCKET_MASK_LEN) != EOK) {
HILOG_ERROR(LOG_CORE, "client memcpy_s MASK_KEY failed, error = %d, desc = %s", errno, strerror(errno));
PROFILER_LOG_ERROR(LOG_CORE, "client memcpy_s MASK_KEY failed, error = %d, desc = %s", errno, strerror(errno));
return false;
}
sendMsgLen += SOCKET_MASK_LEN;
@ -428,23 +430,24 @@ bool ArkTSPlugin::ClientSendReq(const std::string& message)
maskMessage.push_back(message[i] ^ MASK_KEY[j]);
}
if (memcpy_s(sendBuf + sendMsgLen, msgLen, maskMessage.c_str(), msgLen) != EOK) {
HILOG_ERROR(LOG_CORE, "client memcpy_s maskMessage failed, error = %d, desc = %s", errno, strerror(errno));
PROFILER_LOG_ERROR(LOG_CORE, "client memcpy_s maskMessage failed, error = %d, desc = %s",
errno, strerror(errno));
return false;
}
msgBuf[sendMsgLen + msgLen] = '\0';
if (send(client_, sendBuf, sendMsgLen + msgLen, 0) != static_cast<int>(sendMsgLen + msgLen)) {
HILOG_ERROR(LOG_CORE, "client send msg req failed, error = %d, desc = %s", errno, strerror(errno));
PROFILER_LOG_ERROR(LOG_CORE, "client send msg req failed, error = %d, desc = %s", errno, strerror(errno));
return false;
}
HILOG_INFO(LOG_CORE, "ClientRecvWSUpgradeRsp::client send msg req success...");
PROFILER_LOG_INFO(LOG_CORE, "ClientRecvWSUpgradeRsp::client send msg req success...");
return true;
}
void ArkTSPlugin::Close()
{
if (socketState_ == SocketState::UNINITED) {
HILOG_ERROR(LOG_CORE, "client has not inited");
PROFILER_LOG_ERROR(LOG_CORE, "client has not inited");
return;
}
shutdown(client_, SHUT_RDWR);
@ -470,12 +473,12 @@ bool ArkTSPlugin::SetWebSocketTimeOut(int32_t fd, uint32_t timeoutLimit)
std::string ArkTSPlugin::Decode()
{
if (socketState_ != SocketState::CONNECTED) {
HILOG_ERROR(LOG_CORE, "client has not connected");
PROFILER_LOG_ERROR(LOG_CORE, "client has not connected");
return {};
}
char recvbuf[SOCKET_HEADER_LEN + 1];
if (!Recv(client_, recvbuf, SOCKET_HEADER_LEN, 0)) {
HILOG_ERROR(LOG_CORE, "Decode failed, client websocket disconnect");
PROFILER_LOG_ERROR(LOG_CORE, "Decode failed, client websocket disconnect");
socketState_ = SocketState::INITED;
shutdown(client_, SHUT_RDWR);
close(client_);
@ -514,7 +517,7 @@ bool ArkTSPlugin::HandleFrame(WebSocketFrame& wsFrame)
if (wsFrame.payloadLen == 126) { // 126: the payloadLen read from frame
char recvbuf[PAYLOAD_LEN + 1] = {0};
if (!Recv(client_, recvbuf, PAYLOAD_LEN, 0)) {
HILOG_ERROR(LOG_CORE, "HandleFrame: Recv payloadLen == 126 failed");
PROFILER_LOG_ERROR(LOG_CORE, "HandleFrame: Recv payloadLen == 126 failed");
return false;
}
recvbuf[PAYLOAD_LEN] = '\0';
@ -526,7 +529,7 @@ bool ArkTSPlugin::HandleFrame(WebSocketFrame& wsFrame)
} else if (wsFrame.payloadLen > 126) { // 126: the payloadLen read from frame
char recvbuf[EXTEND_PAYLOAD_LEN + 1] = {0};
if (!Recv(client_, recvbuf, EXTEND_PAYLOAD_LEN, 0)) {
HILOG_ERROR(LOG_CORE, "HandleFrame: Recv payloadLen > 127 failed");
PROFILER_LOG_ERROR(LOG_CORE, "HandleFrame: Recv payloadLen > 127 failed");
return false;
}
recvbuf[EXTEND_PAYLOAD_LEN] = '\0';

View File

@ -52,7 +52,7 @@ public:
if (std::regex_search(result, match, pattern)) {
std::string matchedString = match[1].str();
pid_ = std::stoi(matchedString);
HILOG_INFO(LOG_CORE, "ArkTSPluginTest: pid_ is %d", pid_);
PROFILER_LOG_INFO(LOG_CORE, "ArkTSPluginTest: pid_ is %d", pid_);
}
}
}

View File

@ -65,7 +65,7 @@ void ParseConfig(const BytracePluginConfig& config)
bool RunCommand(const std::string& cmd)
{
HILOG_INFO(LOG_CORE, "%s:start running commond: %s", __func__, cmd.c_str());
PROFILER_LOG_INFO(LOG_CORE, "%s:start running commond: %s", __func__, cmd.c_str());
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd.data(), "r"), pclose);
CHECK_TRUE(pipe, false, "BytraceCall::RunCommand: create popen FAILED!");
@ -74,7 +74,7 @@ bool RunCommand(const std::string& cmd)
while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr) {
result += buffer.data();
}
HILOG_INFO(LOG_CORE, "%s:runCommand result: %s", __func__, result.data());
PROFILER_LOG_INFO(LOG_CORE, "%s:runCommand result: %s", __func__, result.data());
return true;
}
@ -153,7 +153,7 @@ int BytracePluginSessionStop()
int BytraceRegisterWriterStruct(const WriterStruct* writer)
{
HILOG_INFO(LOG_CORE, "%s:writer %p", __func__, writer);
PROFILER_LOG_INFO(LOG_CORE, "%s:writer %p", __func__, writer);
return 0;
}

View File

@ -54,7 +54,7 @@ CpuDataPlugin::CpuDataPlugin()
CpuDataPlugin::~CpuDataPlugin()
{
HILOG_INFO(LOG_CORE, "%s:~CpuDataPlugin!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:~CpuDataPlugin!", __func__);
if (buffer_ != nullptr) {
free(buffer_);
buffer_ = nullptr;
@ -79,12 +79,12 @@ int CpuDataPlugin::Start(const uint8_t* configData, uint32_t configSize)
if (protoConfig_.pid() > 0) {
pid_ = protoConfig_.pid();
} else if (protoConfig_.report_process_info()) {
HILOG_INFO(LOG_CORE, "%s:need report process info", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:need report process info", __func__);
} else {
HILOG_ERROR(LOG_CORE, "%s:invalid pid", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s:invalid pid", __func__);
return RET_FAIL;
}
HILOG_INFO(LOG_CORE, "%s:start success!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:start success!", __func__);
return RET_SUCC;
}
@ -143,7 +143,7 @@ template <typename T> bool CpuDataPlugin::WriteProcnum(T& cpuData)
while (int32_t tid = GetValidTid(procDir)) {
if (tid <= 0) {
closedir(procDir);
HILOG_WARN(LOG_CORE, "%s: get pid[%d] failed", __func__, tid);
PROFILER_LOG_WARN(LOG_CORE, "%s: get pid[%d] failed", __func__, tid);
return false;
}
i++;
@ -165,7 +165,7 @@ int CpuDataPlugin::Stop()
prevThreadCpuTimeMap_.clear();
prevCoreSystemCpuTimeMap_.clear();
prevCoreSystemBootTimeMap_.clear();
HILOG_INFO(LOG_CORE, "%s:stop success!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:stop success!", __func__);
return 0;
}
@ -180,14 +180,14 @@ int32_t CpuDataPlugin::ReadFile(std::string& fileName)
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "snprintf_s(%s) error, errno(%d:%s)", fileName.c_str(), errno, buf);
PROFILER_LOG_ERROR(LOG_CORE, "snprintf_s(%s) error, errno(%d:%s)", fileName.c_str(), errno, buf);
return RET_FAIL;
}
if (realpath(filePath, realPath) == nullptr) {
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "realpath(%s) failed, errno(%d:%s)", fileName.c_str(), errno, buf);
PROFILER_LOG_ERROR(LOG_CORE, "realpath(%s) failed, errno(%d:%s)", fileName.c_str(), errno, buf);
return RET_FAIL;
}
@ -196,12 +196,12 @@ int32_t CpuDataPlugin::ReadFile(std::string& fileName)
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "%s:failed to open(%s), errno(%d:%s)", __func__, realPath, errno, buf);
PROFILER_LOG_ERROR(LOG_CORE, "%s:failed to open(%s), errno(%d:%s)", __func__, realPath, errno, buf);
err_ = errno;
return RET_FAIL;
}
if (buffer_ == nullptr) {
HILOG_ERROR(LOG_CORE, "%s:empty address, buffer_ is NULL", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s:empty address, buffer_ is NULL", __func__);
err_ = RET_NULL_ADDR;
close(fd);
return RET_FAIL;
@ -209,7 +209,7 @@ int32_t CpuDataPlugin::ReadFile(std::string& fileName)
bytesRead = read(fd, buffer_, READ_BUFFER_SIZE - 1);
if (bytesRead <= 0) {
close(fd);
HILOG_ERROR(LOG_CORE, "%s:failed to read(%s), errno=%d", __func__, realPath, errno);
PROFILER_LOG_ERROR(LOG_CORE, "%s:failed to read(%s), errno=%d", __func__, realPath, errno);
err_ = errno;
return RET_FAIL;
}
@ -276,7 +276,7 @@ template <typename T> void CpuDataPlugin::WriteProcessCpuUsage(T& cpuUsageInfo,
// 获取到的数据不包含utime、stime、cutime、cstime四个数值时返回
if (cpuUsageVec.size() != PROCESS_UNSPECIFIED) {
HILOG_ERROR(LOG_CORE, "%s:failed to get process cpu usage, size=%zu", __func__, cpuUsageVec.size());
PROFILER_LOG_ERROR(LOG_CORE, "%s:failed to get process cpu usage, size=%zu", __func__, cpuUsageVec.size());
return;
}
@ -604,7 +604,7 @@ template <typename T> void CpuDataPlugin::WriteThread(T& threadInfo, const char*
// 获取到的数据不包含utime、stime、cutime、cstime四个数值时返回
if (cpuUsageVec.size() != PROCESS_UNSPECIFIED) {
HILOG_ERROR(LOG_CORE, "%s:failed to get thread cpu usage, size=%zu", __func__, cpuUsageVec.size());
PROFILER_LOG_ERROR(LOG_CORE, "%s:failed to get thread cpu usage, size=%zu", __func__, cpuUsageVec.size());
return;
}

View File

@ -89,7 +89,7 @@ int main(int agrc, char* agrv[])
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "test:dlopen err, errno(%d:%s)", errno, buf);
PROFILER_LOG_ERROR(LOG_CORE, "test:dlopen err, errno(%d:%s)", errno, buf);
return 0;
}

View File

@ -39,7 +39,7 @@ DiskioDataPlugin::DiskioDataPlugin()
DiskioDataPlugin::~DiskioDataPlugin()
{
HILOG_INFO(LOG_CORE, "%s:~DiskioDataPlugin!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:~DiskioDataPlugin!", __func__);
if (buffer_ != nullptr) {
free(buffer_);
buffer_ = nullptr;
@ -57,7 +57,7 @@ int DiskioDataPlugin::Start(const uint8_t* configData, uint32_t configSize)
if (protoConfig_.report_io_stats()) {
ioEntry_ = std::make_shared<IoStats>(protoConfig_.report_io_stats());
}
HILOG_INFO(LOG_CORE, "%s:start success!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:start success!", __func__);
return RET_SUCC;
}
@ -109,7 +109,7 @@ int DiskioDataPlugin::Stop()
ioEntry_.reset();
ioEntry_ = nullptr;
}
HILOG_INFO(LOG_CORE, "%s:plugin:stop success!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:plugin:stop success!", __func__);
return 0;
}
@ -122,12 +122,12 @@ int32_t DiskioDataPlugin::ReadFile(std::string& fileName)
"%s:path is invalid: %s, errno=%d", __func__, fileName.c_str(), errno);
fd = open(realPath, O_RDONLY | O_CLOEXEC);
if (fd == -1) {
HILOG_ERROR(LOG_CORE, "%s:failed to open(%s), errno=%d", __func__, fileName.c_str(), errno);
PROFILER_LOG_ERROR(LOG_CORE, "%s:failed to open(%s), errno=%d", __func__, fileName.c_str(), errno);
err_ = errno;
return RET_FAIL;
}
if (buffer_ == nullptr) {
HILOG_ERROR(LOG_CORE, "%s:empty address, buffer_ is NULL", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s:empty address, buffer_ is NULL", __func__);
err_ = RET_NULL_ADDR;
close(fd);
return RET_FAIL;
@ -135,7 +135,7 @@ int32_t DiskioDataPlugin::ReadFile(std::string& fileName)
bytesRead = read(fd, buffer_, READ_BUFFER_SIZE - 1);
if (bytesRead <= 0) {
close(fd);
HILOG_ERROR(LOG_CORE, "%s:failed to read(%s), errno=%d", __func__, fileName.c_str(), errno);
PROFILER_LOG_ERROR(LOG_CORE, "%s:failed to read(%s), errno=%d", __func__, fileName.c_str(), errno);
err_ = errno;
return RET_FAIL;
}
@ -171,14 +171,16 @@ template <typename T> void DiskioDataPlugin::SetDiskioData(T& diskioData, const
std::string curWord = std::string(totalbuffer.CurWord(), totalbuffer.CurWordSize());
if (strcmp(curWord.c_str(), "pgpgin") == 0) {
if (!totalbuffer.NextWord('\n')) {
HILOG_ERROR(LOG_CORE, "%s:failed to get pgpgin, CurWord() = %s", __func__, totalbuffer.CurWord());
PROFILER_LOG_ERROR(LOG_CORE, "%s:failed to get pgpgin, CurWord() = %s",
__func__, totalbuffer.CurWord());
break;
}
curWord = std::string(totalbuffer.CurWord(), totalbuffer.CurWordSize());
rd_sectors_kb = atoi(curWord.c_str());
} else if (strcmp(curWord.c_str(), "pgpgout") == 0) {
if (!totalbuffer.NextWord('\n')) {
HILOG_ERROR(LOG_CORE, "%s:failed to get pgpgout, CurWord() = %s", __func__, totalbuffer.CurWord());
PROFILER_LOG_ERROR(LOG_CORE, "%s:failed to get pgpgout, CurWord() = %s",
__func__, totalbuffer.CurWord());
break;
}
curWord = std::string(totalbuffer.CurWord(), totalbuffer.CurWordSize());

View File

@ -36,12 +36,12 @@ public:
SubEventParser()
{
HILOG_INFO(LOG_CORE, "SubEventParser create!");
PROFILER_LOG_INFO(LOG_CORE, "SubEventParser create!");
}
~SubEventParser()
{
HILOG_INFO(LOG_CORE, "SubEventParser destroy!");
PROFILER_LOG_INFO(LOG_CORE, "SubEventParser destroy!");
}
static SubEventParser<T>& GetInstance()
@ -59,7 +59,7 @@ public:
{
auto it = nameToFunctions_.find(format.eventName);
if (it == nameToFunctions_.end()) {
HILOG_INFO(LOG_CORE, "SetupEvent: event(%s) is not supported", format.eventName.c_str());
PROFILER_LOG_INFO(LOG_CORE, "SetupEvent: event(%s) is not supported", format.eventName.c_str());
return false;
}

View File

@ -59,7 +59,7 @@ std::string FileUtils::ReadFile(const std::string& path)
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_WARN(LOG_CORE, "open file %s FAILED: %s!", path.c_str(), buf);
PROFILER_LOG_WARN(LOG_CORE, "open file %s FAILED: %s!", path.c_str(), buf);
return "";
}
std::string content = ReadFile(fd);

View File

@ -63,7 +63,7 @@ FlowController::FlowController()
FlowController::~FlowController(void)
{
HILOG_INFO(LOG_CORE, "FlowController destroy!");
PROFILER_LOG_INFO(LOG_CORE, "FlowController destroy!");
}
int FlowController::SetWriter(const WriterStructPtr& writer)
@ -124,7 +124,7 @@ bool FlowController::CreateRawDataReaders()
bool FlowController::CreatePagedMemoryPool()
{
HILOG_INFO(LOG_CORE, "create memory pool, buffer_size_kb = %u", bufferSizeKb_);
PROFILER_LOG_INFO(LOG_CORE, "create memory pool, buffer_size_kb = %u", bufferSizeKb_);
size_t bufferSizePages = bufferSizeKb_ / KB_PER_PAGE;
size_t pagesPerBlock = bufferSizePages / static_cast<size_t>(platformCpuNum_);
if (pagesPerBlock < MIN_BLOCK_SIZE_PAGES) {
@ -182,7 +182,7 @@ bool FlowController::ParseBasicData()
CHECK_NOTNULL(ctx, false, "%s: get RandomWriteCtx FAILED!", __func__);
auto traceResult = std::make_unique<ProtoEncoder::TracePluginResult>(ctx);
if (!ReportClockTimes(traceResult)) {
HILOG_ERROR(LOG_CORE, "report clock times FAILED!");
PROFILER_LOG_ERROR(LOG_CORE, "report clock times FAILED!");
}
int32_t msgSize = traceResult->Finish();
resultWriter_->finishReport(resultWriter_, msgSize);
@ -201,7 +201,7 @@ bool FlowController::ParseBasicData()
CHECK_NOTNULL(ctx, false, "%s: get RandomWriteCtx FAILED!", __func__);
auto traceResult = std::make_unique<ProtoEncoder::TracePluginResult>(ctx);
if (!ParseKernelSymbols(traceResult)) {
HILOG_ERROR(LOG_CORE, "parse kernel symbols FAILED!");
PROFILER_LOG_ERROR(LOG_CORE, "parse kernel symbols FAILED!");
}
int32_t msgSize = traceResult->Finish();
resultWriter_->finishReport(resultWriter_, msgSize);
@ -219,7 +219,7 @@ bool FlowController::ParseBasicData()
CHECK_NOTNULL(ctx, false, "%s: get RandomWriteCtx FAILED!", __func__);
auto traceResult = std::make_unique<ProtoEncoder::TracePluginResult>(ctx);
if (!ParsePerCpuStatus(traceResult, TRACE_START)) {
HILOG_ERROR(LOG_CORE, "parse TRACE_START stats failed!");
PROFILER_LOG_ERROR(LOG_CORE, "parse TRACE_START stats failed!");
}
int32_t msgSize = traceResult->Finish();
resultWriter_->finishReport(resultWriter_, msgSize);
@ -246,7 +246,7 @@ std::string FlowController::ReloadTraceArgs()
if (bufferSizeKb_ > 0) {
args += (" bufferSize:" + std::to_string(bufferSizeKb_));
}
HILOG_INFO(LOG_CORE, "trace args: %s", args.c_str());
PROFILER_LOG_INFO(LOG_CORE, "trace args: %s", args.c_str());
return args;
}
@ -271,7 +271,7 @@ int FlowController::StartCapture(void)
uint32_t savedCmdlinesSize = platformCpuNum_ < OCTA_CORE_CPU ? SAVED_CMDLINE_SIZE_SMALL : SAVED_CMDLINE_SIZE_LARGE;
if (!FtraceFsOps::GetInstance().SetSavedCmdLinesSize(savedCmdlinesSize)) {
HILOG_ERROR(LOG_CORE, "SetSavedCmdLinesSize %u fail.", savedCmdlinesSize);
PROFILER_LOG_ERROR(LOG_CORE, "SetSavedCmdLinesSize %u fail.", savedCmdlinesSize);
}
// enable additional record options
@ -287,14 +287,14 @@ int FlowController::StartCapture(void)
CHECK_TRUE(CreateRawDataCaches(), -1, "create raw data caches failed!");
pollThread_ = std::thread(&FlowController::CaptureWorkOnDelayMode, this);
} else {
HILOG_ERROR(LOG_CORE, "ParseMode is Illegal parameter!");
PROFILER_LOG_ERROR(LOG_CORE, "ParseMode is Illegal parameter!");
return -1;
}
// set trace_clock and enable all tag categories with hiview::TraceCollector
auto openRet = traceCollector_->OpenRecording(ReloadTraceArgs());
if (openRet.retCode != OHOS::HiviewDFX::UCollect::UcError::SUCCESS) {
HILOG_ERROR(LOG_CORE, "Enable tag categories failed, trace error code is %d!", openRet.retCode);
PROFILER_LOG_ERROR(LOG_CORE, "Enable tag categories failed, trace error code is %d!", openRet.retCode);
return -1;
}
EnableTraceEvents();
@ -304,7 +304,7 @@ int FlowController::StartCapture(void)
void FlowController::CaptureWorkOnNomalModeInner()
{
pthread_setname_np(pthread_self(), "TraceReader");
HILOG_INFO(LOG_CORE, "FlowController::CaptureWorkOnNomalMode start!");
PROFILER_LOG_INFO(LOG_CORE, "FlowController::CaptureWorkOnNomalMode start!");
auto tracePeriod = std::chrono::milliseconds(tracePeriodMs_);
std::vector<long> rawDataBytes(platformCpuNum_, 0);
@ -315,7 +315,7 @@ void FlowController::CaptureWorkOnNomalModeInner()
// read data from percpu trace_pipe_raw, consume kernel ring buffers
for (size_t i = 0; i < rawDataBytes.size(); i++) {
if (flushCacheData_ && !keepRunning_) {
HILOG_INFO(LOG_CORE, "flushCacheData_ is true, return");
PROFILER_LOG_INFO(LOG_CORE, "flushCacheData_ is true, return");
return;
}
long nbytes = ReadEventData(i);
@ -328,11 +328,11 @@ void FlowController::CaptureWorkOnNomalModeInner()
// parse ftrace percpu event data
for (size_t i = 0; i < rawDataBytes.size(); i++) {
if (flushCacheData_ && !keepRunning_) {
HILOG_INFO(LOG_CORE, "flushCacheData_ is true, return");
PROFILER_LOG_INFO(LOG_CORE, "flushCacheData_ is true, return");
return;
}
if (rawDataBytes[i] == 0) {
HILOG_INFO(LOG_CORE, "Get raw data from CPU%zu is 0 bytes.", i);
PROFILER_LOG_INFO(LOG_CORE, "Get raw data from CPU%zu is 0 bytes.", i);
continue;
}
CHECK_TRUE(ParseEventDataOnNomalMode(i, rawDataBytes[i]), NO_RETVAL, "ParseEventData failed!");
@ -345,7 +345,7 @@ void FlowController::CaptureWorkOnNomalModeInner()
}
tansporter_->Flush();
HILOG_DEBUG(LOG_CORE, "FlowController::CaptureWorkOnNomalMode done!");
PROFILER_LOG_DEBUG(LOG_CORE, "FlowController::CaptureWorkOnNomalMode done!");
}
long FlowController::HmReadEventData()
@ -362,7 +362,8 @@ long FlowController::HmReadEventData()
rest -= nbytes;
}
if (used == bufferSize) {
HILOG_WARN(LOG_CORE, "hm trace raw data may overwrite. current buffer size = %u.", (unsigned int)bufferSize);
PROFILER_LOG_WARN(LOG_CORE, "hm trace raw data may overwrite. current buffer size = %u.",
(unsigned int)bufferSize);
}
return used;
}
@ -370,13 +371,13 @@ long FlowController::HmReadEventData()
void FlowController::HmCaptureWorkOnNomalModeInner()
{
pthread_setname_np(pthread_self(), "HmTraceReader");
HILOG_INFO(LOG_CORE, "FlowController::HmCaptureWorkOnNomalMode start!");
PROFILER_LOG_INFO(LOG_CORE, "FlowController::HmCaptureWorkOnNomalMode start!");
auto tracePeriod = std::chrono::milliseconds(tracePeriodMs_);
while (keepRunning_) {
std::this_thread::sleep_for(tracePeriod);
if (flushCacheData_ && !keepRunning_) {
HILOG_INFO(LOG_CORE, "flushCacheData_ is true, return");
PROFILER_LOG_INFO(LOG_CORE, "flushCacheData_ is true, return");
return;
}
@ -385,11 +386,11 @@ void FlowController::HmCaptureWorkOnNomalModeInner()
ftraceParser_->ParseSavedCmdlines(FtraceFsOps::GetInstance().GetSavedCmdLines());
if (flushCacheData_ && !keepRunning_) {
HILOG_INFO(LOG_CORE, "flushCacheData_ is true, return");
PROFILER_LOG_INFO(LOG_CORE, "flushCacheData_ is true, return");
return;
}
if (rawDataBytes == 0) {
HILOG_INFO(LOG_CORE, "Get hm raw data is 0 bytes.");
PROFILER_LOG_INFO(LOG_CORE, "Get hm raw data is 0 bytes.");
continue;
}
@ -397,7 +398,7 @@ void FlowController::HmCaptureWorkOnNomalModeInner()
}
tansporter_->Flush();
HILOG_DEBUG(LOG_CORE, "FlowController::HmCaptureWorkOnNomalMode done!");
PROFILER_LOG_DEBUG(LOG_CORE, "FlowController::HmCaptureWorkOnNomalMode done!");
}
void FlowController::CaptureWorkOnNomalMode()
@ -412,7 +413,7 @@ void FlowController::CaptureWorkOnNomalMode()
void FlowController::CaptureWorkOnDelayMode()
{
pthread_setname_np(pthread_self(), "TraceReader");
HILOG_INFO(LOG_CORE, "FlowController::CaptureWorkOnDelayMode start!");
PROFILER_LOG_INFO(LOG_CORE, "FlowController::CaptureWorkOnDelayMode start!");
auto tracePeriod = std::chrono::milliseconds(tracePeriodMs_);
int writeDataCount = 0;
@ -422,12 +423,12 @@ void FlowController::CaptureWorkOnDelayMode()
// read data from percpu trace_pipe_raw, consume kernel ring buffers
for (int cpuIdx = 0; cpuIdx < platformCpuNum_; cpuIdx++) {
if (flushCacheData_ && !keepRunning_) {
HILOG_INFO(LOG_CORE, "flushCacheData_ is true, return");
PROFILER_LOG_INFO(LOG_CORE, "flushCacheData_ is true, return");
return;
}
long nbytes = ReadEventData(cpuIdx);
if (nbytes == 0) {
HILOG_INFO(LOG_CORE, "Get raw data from CPU%d is 0 bytes.", cpuIdx);
PROFILER_LOG_INFO(LOG_CORE, "Get raw data from CPU%d is 0 bytes.", cpuIdx);
continue;
}
fwrite(&cpuIdx, sizeof(uint8_t), 1, rawDataFile_.get());
@ -444,7 +445,7 @@ void FlowController::CaptureWorkOnDelayMode()
CHECK_TRUE(ParseEventDataOnDelayMode(), NO_RETVAL, "ParseEventData failed!");
tansporter_->Flush();
HILOG_DEBUG(LOG_CORE, "FlowController::CaptureWorkOnDelayMode done!");
PROFILER_LOG_DEBUG(LOG_CORE, "FlowController::CaptureWorkOnDelayMode done!");
}
static inline int RmqEntryTotalSize(unsigned int size)
@ -512,7 +513,7 @@ bool FlowController::HmParseEventDataOnNomalMode(long dataSize)
traceResult.Reset(ctx, &msgPool);
ProtoEncoder::FtraceEvent* event = nullptr;
if (!HmParseEventData(&traceResult, data, event)) {
HILOG_ERROR(LOG_CORE, "hm parse raw data failed!");
PROFILER_LOG_ERROR(LOG_CORE, "hm parse raw data failed!");
}
int32_t msgSize = traceResult.Finish();
resultWriter_->finishReport(resultWriter_, msgSize);
@ -539,7 +540,7 @@ long FlowController::ReadEventData(int cpuid)
}
if (used == bufferSize) {
HILOG_INFO(LOG_CORE,
PROFILER_LOG_INFO(LOG_CORE,
"used(%ld) equals bufferSize(%ld), please expand buffer_size_kb, otherwise the kernel may lose data\n",
used, bufferSize);
}
@ -563,7 +564,7 @@ bool FlowController::ParseEventData(int cpuid, uint8_t* page)
traceResult.Reset(ctx, &msgPool);
ProtoEncoder::FtraceEvent* event = nullptr; // Used to distinguish between SubEventParser instance types.
if (!ParseFtraceEvent(&traceResult, cpuid, page, event)) {
HILOG_ERROR(LOG_CORE, "parse raw event for cpu-%d failed!", cpuid);
PROFILER_LOG_ERROR(LOG_CORE, "parse raw event for cpu-%d failed!", cpuid);
}
int32_t msgSize = traceResult.Finish();
resultWriter_->finishReport(resultWriter_, msgSize);
@ -615,9 +616,9 @@ int FlowController::StopCapture(void)
// stop ftrace event data polling thread
keepRunning_ = false;
if (pollThread_.joinable()) {
HILOG_INFO(LOG_CORE, "join thread start!\n");
PROFILER_LOG_INFO(LOG_CORE, "join thread start!\n");
pollThread_.join();
HILOG_INFO(LOG_CORE, "join thread done!\n");
PROFILER_LOG_INFO(LOG_CORE, "join thread done!\n");
}
// parse per cpu stats
@ -630,7 +631,7 @@ int FlowController::StopCapture(void)
CHECK_NOTNULL(ctx, -1, "%s: get RandomWriteCtx FAILED!", __func__);
auto traceResult = std::make_unique<ProtoEncoder::TracePluginResult>(ctx);
if (!ParsePerCpuStatus(traceResult, TRACE_END)) {
HILOG_ERROR(LOG_CORE, "parse TRACE_END stats FAILED!");
PROFILER_LOG_ERROR(LOG_CORE, "parse TRACE_END stats FAILED!");
}
int32_t msgSize = traceResult->Finish();
resultWriter_->finishReport(resultWriter_, msgSize);
@ -669,7 +670,7 @@ template <typename T> bool FlowController::ParsePerCpuStatus(T& tracePluginResul
}
for (int i = 0; i < platformCpuNum_; i++) {
HILOG_INFO(LOG_CORE, "[%d] ParsePerCpuStatus %d!", i, stage);
PROFILER_LOG_INFO(LOG_CORE, "[%d] ParsePerCpuStatus %d!", i, stage);
PerCpuStats stats = {};
stats.cpuIndex = i;
ftraceParser_->ParsePerCpuStatus(stats, FtraceFsOps::GetInstance().GetPerCpuStats(i));
@ -728,7 +729,7 @@ template <typename T> bool FlowController::ParseKernelSymbols(T& tracePluginResu
symbolDetail->set_symbol_addr(symbol.addr);
symbolDetail->set_symbol_name(symbol.name);
});
HILOG_INFO(LOG_CORE, "parse kernel symbol message done!");
PROFILER_LOG_INFO(LOG_CORE, "parse kernel symbol message done!");
return true;
}
@ -748,7 +749,7 @@ bool FlowController::AddPlatformEventsToParser(void)
{
CHECK_TRUE(ftraceSupported_, false, "current kernel not support ftrace!");
HILOG_INFO(LOG_CORE, "Add platform events to parser start!");
PROFILER_LOG_INFO(LOG_CORE, "Add platform events to parser start!");
for (auto& typeName : FtraceFsOps::GetInstance().GetPlatformEvents()) {
std::string type = typeName.first;
std::string name = typeName.second;
@ -756,7 +757,7 @@ bool FlowController::AddPlatformEventsToParser(void)
supportedEvents_.push_back(typeName);
}
}
HILOG_INFO(LOG_CORE, "Add platform events to parser done, events: %zu!", supportedEvents_.size());
PROFILER_LOG_INFO(LOG_CORE, "Add platform events to parser done, events: %zu!", supportedEvents_.size());
return true;
}

View File

@ -31,7 +31,7 @@ FtraceDataReader::FtraceDataReader(const std::string& path) : path_(path), readF
char realPath[PATH_MAX + 1] = {0};
if ((path.length() >= PATH_MAX) || (realpath(path.c_str(), realPath) == nullptr)) {
HILOG_ERROR(LOG_CORE, "%s:so filename invalid, errno=%d", __func__, errno);
PROFILER_LOG_ERROR(LOG_CORE, "%s:so filename invalid, errno=%d", __func__, errno);
}
readFd_ = open(realPath, O_CLOEXEC | O_NONBLOCK);
CHECK_TRUE(readFd_ >= 0, NO_RETVAL, "open %s failed, %d", realPath, errno);

View File

@ -32,12 +32,12 @@ FtraceFsOps& FtraceFsOps::GetInstance()
FtraceFsOps::FtraceFsOps() : ftraceRoot_(GetFtraceRoot()), hmTraceDir_(GetHmTraceDir())
{
HILOG_INFO(LOG_CORE, "FtraceFsOps create!");
PROFILER_LOG_INFO(LOG_CORE, "FtraceFsOps create!");
}
FtraceFsOps::~FtraceFsOps()
{
HILOG_INFO(LOG_CORE, "FtraceFsOps destroy!");
PROFILER_LOG_INFO(LOG_CORE, "FtraceFsOps destroy!");
}
std::string FtraceFsOps::GetFtraceRoot()
@ -299,7 +299,7 @@ std::vector<std::pair<std::string, std::string>> FtraceFsOps::GetPlatformEvents(
AddPlatformEvents(eventSet, ftraceRoot_ + hmTraceDir_ + "/events");
}
AddPlatformEvents(eventSet, ftraceRoot_ + "/events");
HILOG_INFO(LOG_CORE, "get platform event formats done, types: %zu!", eventSet.size());
PROFILER_LOG_INFO(LOG_CORE, "get platform event formats done, types: %zu!", eventSet.size());
return {eventSet.begin(), eventSet.end()};
}

View File

@ -34,7 +34,7 @@ int TracePluginRegisterWriter(const WriterStruct* writer)
g_mainController = std::make_unique<FTRACE_NS::FlowController>();
int result = g_mainController->SetWriter(const_cast<WriterStructPtr>(writer));
HILOG_INFO(LOG_CORE, "%s: %d", __func__, __LINE__);
PROFILER_LOG_INFO(LOG_CORE, "%s: %d", __func__, __LINE__);
return result;
}
@ -43,13 +43,13 @@ int TracePluginStartSession(const uint8_t configData[], const uint32_t configSiz
std::unique_lock<std::mutex> lock(g_mutex);
CHECK_NOTNULL(g_mainController, -1, "%s: no FlowController created!", __func__);
HILOG_INFO(LOG_CORE, "%s: %d", __func__, __LINE__);
PROFILER_LOG_INFO(LOG_CORE, "%s: %d", __func__, __LINE__);
int retval = g_mainController->LoadConfig(configData, configSize);
CHECK_TRUE(retval == 0, retval, "LoadConfig failed!");
HILOG_INFO(LOG_CORE, "%s: %d", __func__, __LINE__);
PROFILER_LOG_INFO(LOG_CORE, "%s: %d", __func__, __LINE__);
int result = g_mainController->StartCapture();
HILOG_INFO(LOG_CORE, "%s: %d", __func__, __LINE__);
PROFILER_LOG_INFO(LOG_CORE, "%s: %d", __func__, __LINE__);
return result;
}
@ -58,9 +58,9 @@ int TracePluginReportBasicData()
std::unique_lock<std::mutex> lock(g_mutex);
CHECK_NOTNULL(g_mainController, -1, "%s: no FlowController created!", __func__);
HILOG_INFO(LOG_CORE, "%s: %d", __func__, __LINE__);
PROFILER_LOG_INFO(LOG_CORE, "%s: %d", __func__, __LINE__);
g_mainController->SetReportBasicData(true);
HILOG_INFO(LOG_CORE, "%s: %d", __func__, __LINE__);
PROFILER_LOG_INFO(LOG_CORE, "%s: %d", __func__, __LINE__);
return 0;
}
@ -69,9 +69,9 @@ int TracePluginStopSession()
std::unique_lock<std::mutex> lock(g_mutex);
CHECK_NOTNULL(g_mainController, -1, "%s: no FlowController created!", __func__);
HILOG_INFO(LOG_CORE, "%s: %d", __func__, __LINE__);
PROFILER_LOG_INFO(LOG_CORE, "%s: %d", __func__, __LINE__);
int result = g_mainController->StopCapture();
HILOG_INFO(LOG_CORE, "%s: %d", __func__, __LINE__);
PROFILER_LOG_INFO(LOG_CORE, "%s: %d", __func__, __LINE__);
g_mainController.reset();
return result;

View File

@ -35,7 +35,7 @@
#define HILOG_DEBUG(LOG_CORE, fmt, ...) \
if (debugOn_) { \
HILOG_INFO(LOG_CORE, ":DEBUG: " fmt, ##__VA_ARGS__); \
PROFILER_LOG_INFO(LOG_CORE, ":DEBUG: " fmt, ##__VA_ARGS__); \
}
namespace {
@ -58,7 +58,7 @@ inline uint64_t GetTimestampIncrements(uint64_t ext)
FTRACE_NS_BEGIN
FtraceParser::FtraceParser()
{
HILOG_INFO(LOG_CORE, "FtraceParser create!");
PROFILER_LOG_INFO(LOG_CORE, "FtraceParser create!");
}
bool FtraceParser::Init()
@ -77,7 +77,7 @@ bool FtraceParser::Init()
FtraceParser::~FtraceParser()
{
HILOG_INFO(LOG_CORE, "FtraceParser destroy!");
PROFILER_LOG_INFO(LOG_CORE, "FtraceParser destroy!");
}
bool FtraceParser::SetupEvent(const std::string& type, const std::string& name)
@ -142,7 +142,7 @@ bool FtraceParser::ParseHeaderPageFormat(const std::string& formatDesc)
}
}
HILOG_INFO(LOG_CORE, "page header info:");
PROFILER_LOG_INFO(LOG_CORE, "page header info:");
PrintFieldInfo(pageHeaderFormat_.timestamp);
PrintFieldInfo(pageHeaderFormat_.commit);
PrintFieldInfo(pageHeaderFormat_.overwrite);
@ -228,10 +228,10 @@ void FtraceParser::PrintFieldInfo(const FieldFormat& info)
{
UNUSED_PARAMETER(GetProtoTypeName);
UNUSED_PARAMETER(GetFieldTypeName);
HILOG_DEBUG(LOG_CORE,
"FieldFormat { offset: %u, size:%u, sign: %u fieldType: %s, protoType:%s, typeName: %s, name: %s}",
info.offset, info.size, info.isSigned, GetFieldTypeName(info.filedType).c_str(),
GetProtoTypeName(info.protoType).c_str(), info.typeName.c_str(), info.name.c_str());
PROFILER_LOG_INFO(LOG_CORE,
"FieldFormat { offset: %u, size:%u, sign: %u fieldType: %s, protoType:%s, typeName: %s, name: %s}",
info.offset, info.size, info.isSigned, GetFieldTypeName(info.filedType).c_str(),
GetProtoTypeName(info.protoType).c_str(), info.typeName.c_str(), info.name.c_str());
}
static std::string SplitNameFromTypeName(const std::string& typeName)
@ -561,7 +561,7 @@ bool FtraceParser::ParseSavedTgid(const std::string& savedTgid)
}
if (tgidDict_.size() == 0) {
HILOG_WARN(LOG_CORE, "ParseSavedTgid: parsed tigds: %zu", tgidDict_.size());
PROFILER_LOG_WARN(LOG_CORE, "ParseSavedTgid: parsed tigds: %zu", tgidDict_.size());
}
return true;
}
@ -587,7 +587,7 @@ bool FtraceParser::ParseSavedCmdlines(const std::string& savedCmdlines)
}
if (commDict_.size() == 0) {
HILOG_WARN(LOG_CORE, "ParseSavedCmdlines: parsed cmdlines: %zu", commDict_.size());
PROFILER_LOG_WARN(LOG_CORE, "ParseSavedCmdlines: parsed cmdlines: %zu", commDict_.size());
}
return retval;
}
@ -611,7 +611,7 @@ bool FtraceParser::ParseTimeExtend(const FtraceEventHeader& eventHeader)
CHECK_TRUE(ReadInc(&cur_, endOfData_, &deltaExt, sizeof(deltaExt)), false, "read time delta failed!");
timestamp_ += GetTimestampIncrements(deltaExt);
HILOG_INFO(LOG_CORE, "ParseTimeExtend: update ts with %u to %" PRIu64, deltaExt, timestamp_);
PROFILER_LOG_INFO(LOG_CORE, "ParseTimeExtend: update ts with %u to %" PRIu64, deltaExt, timestamp_);
return true;
}
@ -622,7 +622,7 @@ bool FtraceParser::ParseTimeStamp(const FtraceEventHeader& eventHeader)
// refers kernel function rb_update_write_stamp in ring_buffer.c
timestamp_ = eventHeader.timeDelta + GetTimestampIncrements(deltaExt);
HILOG_INFO(LOG_CORE, "ParseTimeStamp: update ts with %u to %" PRIu64, deltaExt, timestamp_);
PROFILER_LOG_INFO(LOG_CORE, "ParseTimeStamp: update ts with %u to %" PRIu64, deltaExt, timestamp_);
return true;
}
@ -645,6 +645,6 @@ bool FtraceParser::IsValidIndex(int idx)
void FtraceParser::SetDebugOn(bool value)
{
debugOn_ = value;
HILOG_INFO(LOG_CORE, "debugOption: %s", debugOn_ ? "true" : "false");
PROFILER_LOG_INFO(LOG_CORE, "debugOption: %s", debugOn_ ? "true" : "false");
}
FTRACE_NS_END

View File

@ -30,12 +30,12 @@ constexpr int MAX_BUFFER_SIZE = 10 * 1000;
FTRACE_NS_BEGIN
KernelSymbolsParser::KernelSymbolsParser()
{
HILOG_INFO(LOG_CORE, "KernelSymbolsParser create!");
PROFILER_LOG_INFO(LOG_CORE, "KernelSymbolsParser create!");
}
KernelSymbolsParser::~KernelSymbolsParser()
{
HILOG_INFO(LOG_CORE, "KernelSymbolsParser destroy!");
PROFILER_LOG_INFO(LOG_CORE, "KernelSymbolsParser destroy!");
}
void KernelSymbolsParser::Accept(const std::function<void(const KernelSymbol&)>& visitor)

View File

@ -30,7 +30,7 @@ FTRACE_NS_BEGIN
PagedMemPool::PagedMemPool(size_t pagePerBlock, size_t maxCacheSize)
: blockSize_(pagePerBlock * PAGE_SIZE), maxCacheSize_(maxCacheSize)
{
HILOG_INFO(LOG_CORE, "PagedMemPool init with %zu ppb, %zu slots!", pagePerBlock, maxCacheSize);
PROFILER_LOG_INFO(LOG_CORE, "PagedMemPool init with %zu ppb, %zu slots!", pagePerBlock, maxCacheSize);
}
PagedMemPool::~PagedMemPool()
@ -40,7 +40,7 @@ PagedMemPool::~PagedMemPool()
Free(*it);
it = blockSet_.erase(it);
}
HILOG_INFO(LOG_CORE, "PagedMemPool deinit!");
PROFILER_LOG_INFO(LOG_CORE, "PagedMemPool deinit!");
}
size_t PagedMemPool::GetBlockSize() const
@ -60,7 +60,7 @@ void* PagedMemPool::Allocate()
block = mmap(nullptr, blockSize_, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
CHECK_NOTNULL(block, nullptr, "mmap failed, %d", errno);
blockSet_.insert(block);
HILOG_INFO(LOG_CORE, "PagedMemPool::Allocate %zuB block done!", blockSize_);
PROFILER_LOG_INFO(LOG_CORE, "PagedMemPool::Allocate %zuB block done!", blockSize_);
return block;
}

View File

@ -33,12 +33,12 @@ PrintkFormatsParser& PrintkFormatsParser::GetInstance()
PrintkFormatsParser::PrintkFormatsParser()
{
HILOG_INFO(LOG_CORE, "PrintkFormatsParser create!");
PROFILER_LOG_INFO(LOG_CORE, "PrintkFormatsParser create!");
}
PrintkFormatsParser::~PrintkFormatsParser()
{
HILOG_INFO(LOG_CORE, "PrintkFormatsParser destroy!");
PROFILER_LOG_INFO(LOG_CORE, "PrintkFormatsParser destroy!");
}
std::string PrintkFormatsParser::GetSymbol(uint64_t addr)

View File

@ -51,7 +51,7 @@ private:
int Init()
{
handler_ = signal(sig_, &PipedSigHandler::SigHandler);
HILOG_INFO(LOG_CORE, "set signal handler for sig %d done!", sig_);
PROFILER_LOG_INFO(LOG_CORE, "set signal handler for sig %d done!", sig_);
CHECK_TRUE(pipe(pipe_) != -1, -1, "create pipe failed, %d", errno);
CHECK_TRUE(fcntl(pipe_[RD], F_SETFL, O_NONBLOCK) != -1, -1, "set non block to pipe[WR] failed!");
@ -63,7 +63,7 @@ private:
CHECK_TRUE(close(pipe_[RD]) != -1, -1, "close pipe_[RD] failed, %d", errno);
CHECK_TRUE(close(pipe_[WR]) != -1, -1, "close pipe_[WR] failed, %d", errno);
signal(sig_, nullptr);
HILOG_INFO(LOG_CORE, "restore signal handler for sig %d done!", sig_);
PROFILER_LOG_INFO(LOG_CORE, "restore signal handler for sig %d done!", sig_);
return 0;
}
@ -90,7 +90,7 @@ struct Poller {
pfd.events = events;
pollSet_.push_back(pfd);
callbacks_[fd] = onEvent;
HILOG_INFO(LOG_CORE, "Add fd %d to poll set done!", fd);
PROFILER_LOG_INFO(LOG_CORE, "Add fd %d to poll set done!", fd);
}
int PollEvents(int timeout)
@ -98,7 +98,7 @@ struct Poller {
int nready = poll(pollSet_.data(), pollSet_.size(), timeout);
CHECK_TRUE(nready >= 0, -1, "poll failed, %d", errno);
if (nready == 0) {
HILOG_INFO(LOG_CORE, "poll %dms timeout!", timeout);
PROFILER_LOG_INFO(LOG_CORE, "poll %dms timeout!", timeout);
return 0;
}
return nready;
@ -177,14 +177,14 @@ static std::string ReceiveOutputAndSigchld(int pipeFd, const PipedSigHandler& ha
childExit = true;
int sig = 0;
read(handler.GetNotifyFd(), &sig, sizeof(sig));
HILOG_INFO(LOG_CORE, "sig %d received!", sig);
PROFILER_LOG_INFO(LOG_CORE, "sig %d received!", sig);
});
while (!childExit) {
int timeout = 1000;
int events = poller.PollEvents(timeout);
if (events < 0) {
HILOG_INFO(LOG_CORE, "poll failed!");
PROFILER_LOG_INFO(LOG_CORE, "poll failed!");
break;
}
poller.DispatchEvents(events);
@ -203,13 +203,13 @@ static int GetProcessExitCode(int pid)
int retval = 0;
if (WIFEXITED(wstatus)) {
retval = WEXITSTATUS(wstatus);
HILOG_INFO(LOG_CORE, "process %d exited with status %d", pid, retval);
PROFILER_LOG_INFO(LOG_CORE, "process %d exited with status %d", pid, retval);
} else if (WIFSIGNALED(wstatus)) {
retval = -1;
HILOG_INFO(LOG_CORE, "process %d killed by signal %d\n", pid, WTERMSIG(wstatus));
PROFILER_LOG_INFO(LOG_CORE, "process %d killed by signal %d\n", pid, WTERMSIG(wstatus));
} else {
retval = -1;
HILOG_WARN(LOG_CORE, "process %d exited with unknow status!", pid);
PROFILER_LOG_WARN(LOG_CORE, "process %d exited with unknow status!", pid);
}
return retval;
}
@ -224,7 +224,7 @@ int ProcessUtils::Execute(const ExecuteArgs& args, std::string& output)
CHECK_TRUE(fcntl(pipeFds[RD], F_SETFL, O_NONBLOCK) != -1, -1, "set non block to pipe[WR] failed!");
std::string cmdline = StringUtils::Join(args.argv_, " ");
HILOG_INFO(LOG_CORE, "ExecuteCommand(%s): prepare ...", cmdline.c_str());
PROFILER_LOG_INFO(LOG_CORE, "ExecuteCommand(%s): prepare ...", cmdline.c_str());
PipedSigHandler sigChldHandler(SIGCHLD);
pid_t pid = fork();
@ -240,17 +240,17 @@ int ProcessUtils::Execute(const ExecuteArgs& args, std::string& output)
output = ReceiveOutputAndSigchld(pipeFds[RD], sigChldHandler);
auto lines = StringUtils::Split(output, "\n");
HILOG_INFO(LOG_CORE, "ExecuteCommand(%s): output %zuB, %zuLn", cmdline.c_str(), output.size(), lines.size());
PROFILER_LOG_INFO(LOG_CORE, "ExecuteCommand(%s): output %zuB, %zuLn", cmdline.c_str(), output.size(), lines.size());
int retval = GetProcessExitCode(pid);
// close pipe fds
CHECK_TRUE(close(pipeFds[RD]) != -1, -1, "close pipe[RD] failed, %d", errno);
if (retval != 0 && cmdline != "hitrace -l") {
HILOG_ERROR(LOG_CORE, "ExecuteCommand(%s): exit with %d, hitrace output is %s", cmdline.c_str(),
PROFILER_LOG_ERROR(LOG_CORE, "ExecuteCommand(%s): exit with %d, hitrace output is %s", cmdline.c_str(),
retval, output.c_str());
} else {
HILOG_INFO(LOG_CORE, "ExecuteCommand(%s): exit with %d", cmdline.c_str(), retval);
PROFILER_LOG_INFO(LOG_CORE, "ExecuteCommand(%s): exit with %d", cmdline.c_str(), retval);
}
return retval;
}

View File

@ -35,18 +35,18 @@ ResultTransporter::ResultTransporter(const std::string& name, WriterStructPtr wr
ResultTransporter::~ResultTransporter(void)
{
HILOG_INFO(LOG_CORE, "ResultTransporter destroy!");
PROFILER_LOG_INFO(LOG_CORE, "ResultTransporter destroy!");
}
void ResultTransporter::SetFlushInterval(int ms)
{
HILOG_INFO(LOG_CORE, "ResultTransporter set flush interval to %d", ms);
PROFILER_LOG_INFO(LOG_CORE, "ResultTransporter set flush interval to %d", ms);
flushInterval_ = std::chrono::milliseconds(ms);
}
void ResultTransporter::SetFlushThreshold(uint32_t nbytes)
{
HILOG_INFO(LOG_CORE, "ResultTransporter set flush threshold to %u", nbytes);
PROFILER_LOG_INFO(LOG_CORE, "ResultTransporter set flush threshold to %u", nbytes);
flushThreshold_ = nbytes;
}
@ -91,7 +91,7 @@ void ResultTransporter::Flush()
auto count = bytesCount_.load();
auto pending = bytesPending_.load();
bytesPending_ = 0;
HILOG_DEBUG(LOG_CORE, "ResultTransporter TX stats B: %" PRIu64 ", P: %u", count, pending);
PROFILER_LOG_DEBUG(LOG_CORE, "ResultTransporter TX stats B: %" PRIu64 ", P: %u", count, pending);
}
bool ResultTransporter::Submit(ResultPtr&& packet)
@ -99,7 +99,7 @@ bool ResultTransporter::Submit(ResultPtr&& packet)
std::unique_lock<std::mutex> lock(mutex_);
long nbytes = Write(std::move(packet));
if (nbytes < 0) {
HILOG_ERROR(LOG_CORE, "send result FAILED!");
PROFILER_LOG_ERROR(LOG_CORE, "send result FAILED!");
lock.unlock();
return false;
}

View File

@ -70,7 +70,7 @@ std::vector<std::string> TraceOps::ListCategories()
CHECK_TRUE(PrepareListCategoriesCmd(), result, "prepare list categories command failed!");
int retval = ExecuteCommand(true, true);
HILOG_INFO(LOG_CORE, "exec %s exit %d!", bin_.c_str(), retval);
PROFILER_LOG_INFO(LOG_CORE, "exec %s exit %d!", bin_.c_str(), retval);
std::string line;
std::stringstream stream(output_);
@ -116,7 +116,7 @@ bool TraceOps::EnableCategories(const std::vector<std::string>& categories, int
if (HasCategory(category)) {
targetCategories_.push_back(category);
} else {
HILOG_ERROR(LOG_CORE, "\"%s\" is not support category on this device", category.c_str());
PROFILER_LOG_ERROR(LOG_CORE, "\"%s\" is not support category on this device", category.c_str());
}
}
@ -128,7 +128,7 @@ bool TraceOps::EnableCategories(const std::vector<std::string>& categories, int
CHECK_TRUE(PrepareEnableCategoriesCmd(traceTime), false, "prepare enable categories failed!");
int retval = ExecuteCommand();
HILOG_INFO(LOG_CORE, "exec %s exit %d!", bin_.c_str(), retval);
PROFILER_LOG_INFO(LOG_CORE, "exec %s exit %d!", bin_.c_str(), retval);
CHECK_TRUE(retval == 0, false, "exec %s failed with %d", bin_.c_str(), retval);
return true;
}
@ -139,7 +139,7 @@ bool TraceOps::DisableCategories()
CHECK_TRUE(PrepareDisableCategoriesCmd(), false, "prepare enable categories failed!");
int retval = ExecuteCommand();
HILOG_INFO(LOG_CORE, "exec %s exit %d!", bin_.c_str(), retval);
PROFILER_LOG_INFO(LOG_CORE, "exec %s exit %d!", bin_.c_str(), retval);
targetCategories_.clear();
CHECK_TRUE(retval == 0, false, "exec %s failed with %d", bin_.c_str(), retval);

View File

@ -175,7 +175,7 @@ HWTEST_F(PrintkFormatsParserTest, PrintkFormatsParserNormal, TestSize.Level1)
for (auto& entry : PrintkFormatsParser::GetInstance().printkFormats_) {
uint64_t addr = entry.first;
std::string symbol = entry.second;
HILOG_INFO(LOG_CORE, "%" PRIx64 " : %s", addr, symbol.c_str());
PROFILER_LOG_INFO(LOG_CORE, "%" PRIx64 " : %s", addr, symbol.c_str());
}
std::string symbol = PrintkFormatsParser::GetInstance().GetSymbol(CPU_ON_ADDR);
EXPECT_EQ(symbol, CPU_ON_STR);

View File

@ -32,7 +32,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1,
"binder_alloc_lru_end: proc=%d page_index=%" PRIu64 "", msg.proc(), msg.page_index());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(binder_alloc_lru_end) msg had be cut off in outfile");
}
return std::string(buffer);
@ -47,7 +47,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1,
"binder_alloc_lru_start: proc=%d page_index=%" PRIu64 "", msg.proc(), msg.page_index());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(binder_alloc_lru_start) msg had be cut off in outfile");
}
return std::string(buffer);
@ -62,7 +62,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1,
"binder_alloc_page_end: proc=%d page_index=%" PRIu64 "", msg.proc(), msg.page_index());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(binder_alloc_page_end) msg had be cut off in outfile");
}
return std::string(buffer);
@ -77,7 +77,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1,
"binder_alloc_page_start: proc=%d page_index=%" PRIu64 "", msg.proc(), msg.page_index());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(binder_alloc_page_start) msg had be cut off in outfile");
}
return std::string(buffer);
@ -91,7 +91,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "binder_command: cmd=0x%x", msg.cmd());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(binder_command) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(binder_command) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -105,7 +106,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1,
"binder_free_lru_end: proc=%d page_index=%" PRIu64 "", msg.proc(), msg.page_index());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(binder_free_lru_end) msg had be cut off in outfile");
}
return std::string(buffer);
@ -120,7 +121,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1,
"binder_free_lru_start: proc=%d page_index=%" PRIu64 "", msg.proc(), msg.page_index());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(binder_free_lru_start) msg had be cut off in outfile");
}
return std::string(buffer);
@ -135,7 +136,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(
buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "binder_ioctl: cmd=0x%x arg=0x%" PRIx64 "", msg.cmd(), msg.arg());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(binder_ioctl) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(binder_ioctl) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -148,7 +150,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "binder_ioctl_done: ret=%d", msg.ret());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(binder_ioctl_done) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(binder_ioctl_done) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -161,7 +164,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "binder_lock: tag=%s", msg.tag().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(binder_lock) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(binder_lock) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -174,7 +178,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "binder_locked: tag=%s", msg.tag().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(binder_locked) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(binder_locked) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -187,7 +192,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "binder_read_done: ret=%d", msg.ret());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(binder_read_done) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(binder_read_done) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -200,7 +206,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "binder_return: cmd=0x%x", msg.cmd());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(binder_return) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(binder_return) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -215,7 +222,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"binder_transaction: transaction=%d dest_node=%d dest_proc=%d dest_thread=%d reply=%d flags=0x%x code=0x%x",
msg.debug_id(), msg.target_node(), msg.to_proc(), msg.to_thread(), msg.reply(), msg.flags(), msg.code());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(binder_transaction) msg had be cut off in outfile");
}
return std::string(buffer);
@ -232,7 +239,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
" extra_buffers_size=%" PRIu64 "",
msg.debug_id(), msg.data_size(), msg.offsets_size(), msg.extra_buffers_size());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(binder_transaction_alloc_buf) msg had be cut off in outfile");
}
return std::string(buffer);
@ -249,7 +256,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
" extra_buffers_size=%" PRIu64 "",
msg.debug_id(), msg.data_size(), msg.offsets_size(), msg.extra_buffers_size());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(binder_transaction_buffer_release) msg had be cut off in outfile");
}
return std::string(buffer);
@ -268,7 +275,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
" extra_buffers_size=%" PRIu64 "",
msg.debug_id(), msg.data_size(), msg.offsets_size(), msg.extra_buffers_size());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(binder_transaction_failed_buffer_release) msg had be cut off in "
"outfile");
}
@ -285,7 +292,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"binder_transaction_node_to_ref: transaction=%d node=%d src_ptr=0x%016llx ==> dest_ref=%d dest_desc=%d",
msg.debug_id(), msg.node_debug_id(), (u64)msg.node_ptr(), msg.ref_debug_id(), msg.ref_desc());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(binder_transaction_node_to_ref) msg had be cut off in outfile");
}
return std::string(buffer);
@ -300,7 +307,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(
buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "binder_transaction_received: transaction=%d", msg.debug_id());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(binder_transaction_received) msg had be cut off in outfile");
}
return std::string(buffer);
@ -316,7 +323,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"binder_transaction_ref_to_node: transaction=%d node=%d src_ref=%d src_desc=%d ==> dest_ptr=0x%016llx",
msg.debug_id(), msg.node_debug_id(), msg.ref_debug_id(), msg.ref_desc(), (u64)msg.node_ptr());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(binder_transaction_ref_to_node) msg had be cut off in outfile");
}
return std::string(buffer);
@ -333,7 +340,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.debug_id(), msg.node_debug_id(), msg.src_ref_debug_id(), msg.src_ref_desc(), msg.dest_ref_debug_id(),
msg.dest_ref_desc());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(binder_transaction_ref_to_ref) msg had be cut off in outfile");
}
return std::string(buffer);
@ -347,7 +354,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "binder_unlock: tag=%s", msg.tag().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(binder_unlock) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(binder_unlock) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -361,7 +369,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1,
"binder_unmap_kernel_end: proc=%d page_index=%" PRIu64 "", msg.proc(), msg.page_index());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(binder_unmap_kernel_end) msg had be cut off in outfile");
}
return std::string(buffer);
@ -376,7 +384,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1,
"binder_unmap_kernel_start: proc=%d page_index=%" PRIu64 "", msg.proc(), msg.page_index());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(binder_unmap_kernel_start) msg had be cut off in outfile");
}
return std::string(buffer);
@ -391,7 +399,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1,
"binder_unmap_user_end: proc=%d page_index=%" PRIu64 "", msg.proc(), msg.page_index());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(binder_unmap_user_end) msg had be cut off in outfile");
}
return std::string(buffer);
@ -406,7 +414,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1,
"binder_unmap_user_start: proc=%d page_index=%" PRIu64 "", msg.proc(), msg.page_index());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(binder_unmap_user_start) msg had be cut off in outfile");
}
return std::string(buffer);
@ -422,7 +430,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"binder_update_page_range: proc=%d allocate=%d offset=%" PRIu64 " size=%" PRIu64 "", msg.proc(),
msg.allocate(), msg.offset(), msg.size());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(binder_update_page_range) msg had be cut off in outfile");
}
return std::string(buffer);
@ -438,7 +446,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"binder_wait_for_work: proc_work=%d transaction_stack=%d thread_todo=%d", msg.proc_work(),
msg.transaction_stack(), msg.thread_todo());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(binder_wait_for_work) msg had be cut off in outfile");
}
return std::string(buffer);
@ -452,7 +460,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "binder_write_done: ret=%d", msg.ret());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(binder_write_done) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(binder_write_done) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -33,7 +33,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))),
msg.rwbs().c_str(), msg.sector(), msg.nr_sector(), msg.comm().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(block_bio_backmerge) msg had be cut off in outfile");
}
return std::string(buffer);
@ -49,7 +49,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.rwbs().c_str(),
msg.sector(), msg.nr_sector(), msg.comm().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(block_bio_bounce) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(block_bio_bounce) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -64,7 +65,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.rwbs().c_str(),
msg.sector(), msg.nr_sector(), msg.error());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(block_bio_complete) msg had be cut off in outfile");
}
return std::string(buffer);
@ -81,7 +82,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))),
msg.rwbs().c_str(), msg.sector(), msg.nr_sector(), msg.comm().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(block_bio_frontmerge) msg had be cut off in outfile");
}
return std::string(buffer);
@ -97,7 +98,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.rwbs().c_str(),
msg.sector(), msg.nr_sector(), msg.comm().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(block_bio_queue) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(block_bio_queue) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -114,7 +116,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.old_dev()) >> 20)), ((unsigned int)((msg.old_dev()) & ((1U << 20) - 1))),
msg.old_sector());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(block_bio_remap) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(block_bio_remap) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -129,7 +132,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"block_dirty_buffer: %d,%d sector=%" PRIu64 " size=%" PRIu64 "", ((unsigned int)((msg.dev()) >> 20)),
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.sector(), msg.size());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(block_dirty_buffer) msg had be cut off in outfile");
}
return std::string(buffer);
@ -145,7 +148,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.rwbs().c_str(),
msg.sector(), msg.nr_sector(), msg.comm().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(block_getrq) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(block_getrq) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -158,7 +162,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "block_plug: [%s]", msg.comm().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(block_plug) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(block_plug) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -174,7 +178,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))),
msg.rwbs().c_str(), msg.cmd().c_str(), msg.sector(), msg.nr_sector(), msg.error());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(block_rq_complete) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(block_rq_complete) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -190,7 +195,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))),
msg.rwbs().c_str(), msg.bytes(), msg.cmd().c_str(), msg.sector(), msg.nr_sector(), msg.comm().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(block_rq_insert) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(block_rq_insert) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -206,7 +212,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))),
msg.rwbs().c_str(), msg.bytes(), msg.cmd().c_str(), msg.sector(), msg.nr_sector(), msg.comm().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(block_rq_issue) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(block_rq_issue) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -223,7 +230,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.old_dev()) >> 20)), ((unsigned int)((msg.old_dev()) & ((1U << 20) - 1))),
msg.old_sector(), msg.nr_bios());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(block_rq_remap) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(block_rq_remap) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -239,7 +247,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))),
msg.rwbs().c_str(), msg.cmd().c_str(), msg.sector(), msg.nr_sector(), 0);
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(block_rq_requeue) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(block_rq_requeue) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -254,7 +263,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.rwbs().c_str(),
msg.sector(), msg.nr_sector(), msg.comm().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(block_sleeprq) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(block_sleeprq) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -270,7 +280,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))),
msg.rwbs().c_str(), msg.sector(), msg.new_sector(), msg.comm().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(block_split) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(block_split) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -285,7 +296,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"block_touch_buffer: %d,%d sector=%" PRIu64 " size=%" PRIu64 "", ((unsigned int)((msg.dev()) >> 20)),
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.sector(), msg.size());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(block_touch_buffer) msg had be cut off in outfile");
}
return std::string(buffer);
@ -300,7 +311,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len =
snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "block_unplug: [%s] %d", msg.comm().c_str(), msg.nr_rq());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(block_unplug) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(block_unplug) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -32,7 +32,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"cgroup_attach_task: dst_root=%d dst_id=%d dst_level=%d dst_path=%s pid=%d comm=%s", msg.dst_root(),
msg.dst_id(), msg.dst_level(), msg.dst_path().c_str(), msg.pid(), msg.comm().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(cgroup_attach_task) msg had be cut off in outfile");
}
return std::string(buffer);
@ -47,7 +47,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cgroup_destroy_root: root=%d ss_mask=%#x name=%s",
msg.root(), msg.ss_mask(), msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(cgroup_destroy_root) msg had be cut off in outfile");
}
return std::string(buffer);
@ -62,7 +62,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cgroup_freeze: root=%d id=%d level=%d path=%s",
msg.root(), msg.id(), msg.level(), msg.path().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(cgroup_freeze) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(cgroup_freeze) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -76,7 +77,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cgroup_mkdir: root=%d id=%d level=%d path=%s",
msg.root(), msg.id(), msg.level(), msg.path().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(cgroup_mkdir) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(cgroup_mkdir) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -91,7 +93,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"cgroup_notify_frozen: root=%d id=%d level=%d path=%s val=%d", msg.root(), msg.id(), msg.level(),
msg.path().c_str(), msg.val());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(cgroup_notify_frozen) msg had be cut off in outfile");
}
return std::string(buffer);
@ -107,7 +109,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"cgroup_notify_populated: root=%d id=%d level=%d path=%s val=%d", msg.root(), msg.id(), msg.level(),
msg.path().c_str(), msg.val());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(cgroup_notify_populated) msg had be cut off in outfile");
}
return std::string(buffer);
@ -122,7 +124,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cgroup_release: root=%d id=%d level=%d path=%s",
msg.root(), msg.id(), msg.level(), msg.path().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(cgroup_release) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(cgroup_release) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -136,7 +139,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cgroup_remount: root=%d ss_mask=%#x name=%s",
msg.root(), msg.ss_mask(), msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(cgroup_remount) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(cgroup_remount) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -150,7 +154,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cgroup_rename: root=%d id=%d level=%d path=%s",
msg.root(), msg.id(), msg.level(), msg.path().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(cgroup_rename) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(cgroup_rename) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -164,7 +169,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cgroup_rmdir: root=%d id=%d level=%d path=%s",
msg.root(), msg.id(), msg.level(), msg.path().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(cgroup_rmdir) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(cgroup_rmdir) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -178,7 +184,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cgroup_setup_root: root=%d ss_mask=%#x name=%s",
msg.root(), msg.ss_mask(), msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(cgroup_setup_root) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(cgroup_setup_root) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -193,7 +200,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"cgroup_transfer_tasks: dst_root=%d dst_id=%d dst_level=%d dst_path=%s pid=%d comm=%s", msg.dst_root(),
msg.dst_id(), msg.dst_level(), msg.dst_path().c_str(), msg.pid(), msg.comm().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(cgroup_transfer_tasks) msg had be cut off in outfile");
}
return std::string(buffer);
@ -208,7 +215,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cgroup_unfreeze: root=%d id=%d level=%d path=%s",
msg.root(), msg.id(), msg.level(), msg.path().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(cgroup_unfreeze) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(cgroup_unfreeze) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -30,7 +30,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_disable: %s", msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(clk_disable) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(clk_disable) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -43,7 +44,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_disable_complete: %s", msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(clk_disable_complete) msg had be cut off in outfile");
}
return std::string(buffer);
@ -57,7 +58,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_enable: %s", msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(clk_enable) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(clk_enable) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -70,7 +71,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_enable_complete: %s", msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(clk_enable_complete) msg had be cut off in outfile");
}
return std::string(buffer);
@ -84,7 +85,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_prepare: %s", msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(clk_prepare) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(clk_prepare) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -97,7 +99,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_prepare_complete: %s", msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(clk_prepare_complete) msg had be cut off in outfile");
}
return std::string(buffer);
@ -112,7 +114,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(
buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_set_parent: %s %s", msg.name().c_str(), msg.pname().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(clk_set_parent) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(clk_set_parent) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -126,7 +129,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_set_parent_complete: %s %s", msg.name().c_str(),
msg.pname().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(clk_set_parent_complete) msg had be cut off in outfile");
}
return std::string(buffer);
@ -141,7 +144,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(
buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_set_phase: %s %d", msg.name().c_str(), (int)msg.phase());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(clk_set_phase) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(clk_set_phase) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -155,7 +159,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_set_phase_complete: %s %d", msg.name().c_str(),
(int)msg.phase());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(clk_set_phase_complete) msg had be cut off in outfile");
}
return std::string(buffer);
@ -170,7 +174,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_set_rate: %s %lu", msg.name().c_str(),
(unsigned long)msg.rate());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(clk_set_rate) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(clk_set_rate) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -184,7 +189,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_set_rate_complete: %s %lu", msg.name().c_str(),
(unsigned long)msg.rate());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(clk_set_rate_complete) msg had be cut off in outfile");
}
return std::string(buffer);
@ -198,7 +203,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_unprepare: %s", msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(clk_unprepare) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(clk_unprepare) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -211,7 +217,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_unprepare_complete: %s", msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(clk_unprepare_complete) msg had be cut off in outfile");
}
return std::string(buffer);

View File

@ -34,7 +34,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
" nr_taken==0x%" PRIu64 "",
msg.start_pfn(), msg.end_pfn(), msg.nr_scanned(), msg.nr_taken());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(mm_compaction_isolate_freepages) msg had be cut off in outfile");
}
return std::string(buffer);
@ -51,7 +51,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
" nr_taken==0x%" PRIu64 "",
msg.start_pfn(), msg.end_pfn(), msg.nr_scanned(), msg.nr_taken());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(mm_compaction_isolate_migratepages) msg had be cut off in outfile");
}
return std::string(buffer);

View File

@ -42,7 +42,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.cpu(), msg.target(), msg.idx(), msg.fun());
}
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(cpuhp_enter) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(cpuhp_enter) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -56,7 +57,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1,
"cpuhp_exit: cpu: %04u state: %3d step: %3d ret: %d", msg.cpu(), msg.state(), msg.idx(), msg.ret());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(cpuhp_exit) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(cpuhp_exit) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -83,7 +84,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.fun());
}
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(cpuhp_multi_enter) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(cpuhp_multi_enter) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -32,7 +32,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"dma_fence_destroy: driver=%s timeline=%s context=%u seqno=%u", msg.driver().c_str(),
msg.timeline().c_str(), msg.context(), msg.seqno());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(dma_fence_destroy) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(dma_fence_destroy) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -47,7 +48,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"dma_fence_emit: driver=%s timeline=%s context=%u seqno=%u", msg.driver().c_str(), msg.timeline().c_str(),
msg.context(), msg.seqno());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(dma_fence_emit) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(dma_fence_emit) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -62,7 +64,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"dma_fence_enable_signal: driver=%s timeline=%s context=%u seqno=%u", msg.driver().c_str(),
msg.timeline().c_str(), msg.context(), msg.seqno());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(dma_fence_enable_signal) msg had be cut off in outfile");
}
return std::string(buffer);
@ -78,7 +80,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"dma_fence_init: driver=%s timeline=%s context=%u seqno=%u", msg.driver().c_str(), msg.timeline().c_str(),
msg.context(), msg.seqno());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(dma_fence_init) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(dma_fence_init) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -93,7 +96,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"dma_fence_signaled: driver=%s timeline=%s context=%u seqno=%u", msg.driver().c_str(),
msg.timeline().c_str(), msg.context(), msg.seqno());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(dma_fence_signaled) msg had be cut off in outfile");
}
return std::string(buffer);
@ -109,7 +112,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"dma_fence_wait_end: driver=%s timeline=%s context=%u seqno=%u", msg.driver().c_str(),
msg.timeline().c_str(), msg.context(), msg.seqno());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(dma_fence_wait_end) msg had be cut off in outfile");
}
return std::string(buffer);
@ -125,7 +128,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"dma_fence_wait_start: driver=%s timeline=%s context=%u seqno=%u", msg.driver().c_str(),
msg.timeline().c_str(), msg.context(), msg.seqno());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(dma_fence_wait_start) msg had be cut off in outfile");
}
return std::string(buffer);

View File

@ -33,8 +33,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.data_blocks());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_alloc_da_blocks) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_alloc_da_blocks) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -56,8 +56,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{0x4000, "STRICT_CHECK"}),
msg.len(), msg.block(), msg.logical(), msg.goal(), msg.lleft(), msg.lright(), msg.pleft(), msg.pright());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_allocate_blocks) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_allocate_blocks) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -73,8 +73,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), msg.dir(),
msg.mode());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_allocate_inode) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_allocate_inode) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -90,8 +90,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.new_size());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_begin_ordered_truncate) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_begin_ordered_truncate) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -107,8 +107,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.offset(), msg.len());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_collapse_range) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_collapse_range) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -125,8 +125,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.mode(), msg.i_blocks(), msg.freed_blocks(), msg.reserved_data_blocks());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_da_release_space) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_da_release_space) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -142,8 +142,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.mode(), msg.i_blocks(), msg.reserved_data_blocks());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_da_reserve_space) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_da_reserve_space) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -160,8 +160,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.mode(), msg.i_blocks(), msg.used_blocks(), msg.reserved_data_blocks(), msg.quota_claim());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_da_update_reserve_space) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_da_update_reserve_space) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -177,8 +177,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), msg.pos(),
msg.len(), msg.flags());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_da_write_begin) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_da_write_begin) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -194,7 +194,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), msg.pos(),
msg.len(), msg.copied());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_da_write_end) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_da_write_end) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -211,8 +211,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.first_page(), msg.nr_to_write(), msg.sync_mode());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_da_write_pages) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_da_write_pages) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -230,8 +230,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
__print_flags(msg.flags(), "", {((((1UL))) << (5)), "N"}, {((((1UL))) << (4)), "M"},
{((((1UL))) << (11)), "U"}, {((((1UL))) << (9)), "B"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_da_write_pages_extent) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_da_write_pages_extent) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -247,8 +247,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), msg.pos(),
msg.len(), msg.rw());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_direct_IO_enter) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_direct_IO_enter) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -264,8 +264,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), msg.pos(),
msg.len(), msg.rw(), msg.ret());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_direct_IO_exit) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_direct_IO_exit) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -280,8 +280,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"ext4_discard_blocks: dev %d,%d blk %" PRIu64 " count %" PRIu64 "", ((unsigned int)((msg.dev()) >> 20)),
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.blk(), msg.count());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_discard_blocks) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_discard_blocks) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -296,8 +296,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_discard_preallocations: dev %d,%d ino %" PRIu64 "",
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_discard_preallocations) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_discard_preallocations) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -312,7 +312,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.drop());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_drop_inode) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_drop_inode) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -330,8 +330,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
__print_flags(
msg.status(), "", {(1 << 0), "W"}, {(1 << 1), "U"}, {(1 << 2), "D"}, {(1 << 3), "H"}, {(1 << 4), "R"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_es_cache_extent) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_es_cache_extent) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -349,8 +349,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
__print_flags(
msg.status(), "", {(1 << 0), "W"}, {(1 << 1), "U"}, {(1 << 2), "D"}, {(1 << 3), "H"}, {(1 << 4), "R"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_es_insert_extent) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_es_insert_extent) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -365,8 +365,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"ext4_es_lookup_extent_enter: dev %d,%d ino %" PRIu64 " lblk %u", ((unsigned int)((msg.dev()) >> 20)),
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), msg.lblk());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_es_lookup_extent_enter) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_es_lookup_extent_enter) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -384,8 +384,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
__print_flags(msg.found() ? msg.status() : 0, "", {(1 << 0), "W"}, {(1 << 1), "U"}, {(1 << 2), "D"},
{(1 << 3), "H"}, {(1 << 4), "R"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_es_lookup_extent_exit) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_es_lookup_extent_exit) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -401,8 +401,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.lblk(), msg.len());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_es_remove_extent) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_es_remove_extent) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -418,7 +418,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.nr_shrunk(),
msg.scan_time(), msg.nr_skipped(), msg.retried());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_es_shrink) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_es_shrink) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -433,8 +433,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"ext4_es_shrink_count: dev %d,%d nr_to_scan %d cache_cnt %d", ((unsigned int)((msg.dev()) >> 20)),
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.nr_to_scan(), msg.cache_cnt());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_es_shrink_count) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_es_shrink_count) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -449,8 +449,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"ext4_es_shrink_scan_enter: dev %d,%d nr_to_scan %d cache_cnt %d", ((unsigned int)((msg.dev()) >> 20)),
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.nr_to_scan(), msg.cache_cnt());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_es_shrink_scan_enter) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_es_shrink_scan_enter) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -465,8 +465,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"ext4_es_shrink_scan_exit: dev %d,%d nr_shrunk %d cache_cnt %d", ((unsigned int)((msg.dev()) >> 20)),
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.nr_shrunk(), msg.cache_cnt());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_es_shrink_scan_exit) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_es_shrink_scan_exit) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -481,7 +481,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"ext4_evict_inode: dev %d,%d ino %" PRIu64 " nlink %d", ((unsigned int)((msg.dev()) >> 20)),
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), msg.nlink());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_evict_inode) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_evict_inode) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -500,8 +500,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.m_lblk(), msg.m_len(), msg.u_lblk(), msg.u_len(), msg.u_pblk());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_ext_convert_to_initialized_enter) msg had be cut off in "
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_ext_convert_to_initialized_enter) msg had be cut off in "
"outfile");
}
return std::string(buffer);
@ -522,8 +522,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.m_lblk(), msg.m_len(), msg.u_lblk(), msg.u_len(), msg.u_pblk(), msg.i_lblk(), msg.i_len(),
msg.i_pblk());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_ext_convert_to_initialized_fastpath) msg had be cut off in "
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_ext_convert_to_initialized_fastpath) msg had be cut off in "
"outfile");
}
return std::string(buffer);
@ -545,8 +545,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{0x0100, "CONVERT_UNWRITTEN"}, {0x0200, "ZERO"}, {0x0400, "IO_SUBMIT"}, {0x40000000, "EX_NOCACHE"}),
(unsigned int)msg.allocated(), msg.newblk());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_ext_handle_unwritten_extents) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_ext_handle_unwritten_extents) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -561,7 +561,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"ext4_ext_in_cache: dev %d,%d ino %" PRIu64 " lblk %u ret %d", ((unsigned int)((msg.dev()) >> 20)),
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), (unsigned)msg.lblk(), msg.ret());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_ext_in_cache) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_ext_in_cache) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -577,8 +577,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.lblk(), msg.pblk());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_ext_load_extent) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_ext_load_extent) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -597,8 +597,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{0x0008, "PRE_IO"}, {0x0010, "CONVERT"}, {0x0020, "METADATA_NOFAIL"}, {0x0040, "NO_NORMALIZE"},
{0x0100, "CONVERT_UNWRITTEN"}, {0x0200, "ZERO"}, {0x0400, "IO_SUBMIT"}, {0x40000000, "EX_NOCACHE"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_ext_map_blocks_enter) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_ext_map_blocks_enter) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -621,8 +621,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{((((1UL))) << (11)), "U"}, {((((1UL))) << (9)), "B"}),
msg.ret());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_ext_map_blocks_exit) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_ext_map_blocks_exit) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -638,8 +638,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
(unsigned)msg.lblk(), msg.len(), msg.start());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_ext_put_in_cache) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_ext_put_in_cache) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -655,8 +655,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
(unsigned)msg.start(), (unsigned)msg.end(), msg.depth());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_ext_remove_space) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_ext_remove_space) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -673,8 +673,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
(unsigned)msg.start(), (unsigned)msg.end(), msg.depth(), msg.partial(), (unsigned short)msg.eh_entries());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_ext_remove_space_done) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_ext_remove_space_done) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -689,7 +689,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"ext4_ext_rm_idx: dev %d,%d ino %" PRIu64 " index_pblk %" PRIu64 "", ((unsigned int)((msg.dev()) >> 20)),
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), msg.pblk());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_ext_rm_idx) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_ext_rm_idx) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -706,7 +706,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
(unsigned)msg.start(), (unsigned)msg.ee_lblk(), msg.ee_pblk(), (unsigned short)msg.ee_len(), msg.partial());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_ext_rm_leaf) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_ext_rm_leaf) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -722,8 +722,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
(unsigned)msg.lblk(), msg.pblk(), (unsigned short)msg.len());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_ext_show_extent) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_ext_show_extent) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -741,8 +741,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
__print_flags(msg.mode(), "|", {0x01, "KEEP_SIZE"}, {0x02, "PUNCH_HOLE"}, {0x04, "NO_HIDE_STALE"},
{0x08, "COLLAPSE_RANGE"}, {0x10, "ZERO_RANGE"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_fallocate_enter) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_fallocate_enter) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -758,8 +758,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), msg.pos(),
msg.blocks(), msg.ret());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_fallocate_exit) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_fallocate_exit) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -775,8 +775,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
(unsigned)msg.from(), (unsigned)msg.to(), msg.reverse(), msg.found(), (unsigned)msg.found_blk());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_find_delalloc_range) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_find_delalloc_range) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -792,7 +792,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.mode(), msg.is_metadata(), msg.block());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_forget) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_forget) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -810,7 +810,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
__print_flags(msg.flags(), "|", {0x0001, "METADATA"}, {0x0002, "FORGET"}, {0x0004, "VALIDATED"},
{0x0008, "NO_QUOTA"}, {0x0010, "1ST_CLUSTER"}, {0x0020, "LAST_CLUSTER"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_free_blocks) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_free_blocks) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -826,7 +826,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.mode(), msg.uid(), msg.gid(), msg.blocks());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_free_inode) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_free_inode) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -847,8 +847,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{((((1UL))) << (11)), "U"}, {((((1UL))) << (9)), "B"}),
msg.ret());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_get_implied_cluster_alloc_exit) msg had be cut off in "
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_get_implied_cluster_alloc_exit) msg had be cut off in "
"outfile");
}
return std::string(buffer);
@ -865,8 +865,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
(unsigned)msg.lblk(), msg.len());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_get_reserved_cluster_alloc) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_get_reserved_cluster_alloc) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -885,8 +885,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{0x0008, "PRE_IO"}, {0x0010, "CONVERT"}, {0x0020, "METADATA_NOFAIL"}, {0x0040, "NO_NORMALIZE"},
{0x0100, "CONVERT_UNWRITTEN"}, {0x0200, "ZERO"}, {0x0400, "IO_SUBMIT"}, {0x40000000, "EX_NOCACHE"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_ind_map_blocks_enter) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_ind_map_blocks_enter) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -909,8 +909,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{((((1UL))) << (11)), "U"}, {((((1UL))) << (9)), "B"}),
msg.ret());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_ind_map_blocks_exit) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_ind_map_blocks_exit) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -926,7 +926,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.offset(), msg.len());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_insert_range) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_insert_range) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -942,8 +942,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.index(), msg.offset(), msg.length());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_invalidatepage) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_invalidatepage) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -958,8 +958,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"ext4_journal_start: dev %d,%d blocks %d, rsv_blocks %d, caller %p", ((unsigned int)((msg.dev()) >> 20)),
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.blocks(), msg.rsv_blocks(), (void*)msg.ip());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_journal_start) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_journal_start) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -974,8 +974,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"ext4_journal_start_reserved: dev %d,%d blocks, %d caller %p", ((unsigned int)((msg.dev()) >> 20)),
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.blocks(), (void*)msg.ip());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_journal_start_reserved) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_journal_start_reserved) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -991,8 +991,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.index(), msg.offset(), msg.length());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_journalled_invalidatepage) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_journalled_invalidatepage) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1008,8 +1008,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), msg.pos(),
msg.len(), msg.copied());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_journalled_write_end) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_journalled_write_end) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1023,7 +1023,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_load_inode: dev %d,%d ino %" PRIu64 "",
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_load_inode) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_load_inode) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1037,8 +1037,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_load_inode_bitmap: dev %d,%d group %u",
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.group());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_load_inode_bitmap) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_load_inode_bitmap) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1053,8 +1053,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"ext4_mark_inode_dirty: dev %d,%d ino %" PRIu64 " caller %p", ((unsigned int)((msg.dev()) >> 20)),
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), (void*)msg.ip());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_mark_inode_dirty) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_mark_inode_dirty) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1068,8 +1068,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_mb_bitmap_load: dev %d,%d group %u",
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.group());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_mb_bitmap_load) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_mb_bitmap_load) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1083,8 +1083,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_mb_buddy_bitmap_load: dev %d,%d group %u",
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.group());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_mb_buddy_bitmap_load) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_mb_buddy_bitmap_load) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1099,8 +1099,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_mb_discard_preallocations: dev %d,%d needed %d",
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.needed());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_mb_discard_preallocations) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_mb_discard_preallocations) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1116,8 +1116,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.pa_pstart(), msg.pa_len(), msg.pa_lstart());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_mb_new_group_pa) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_mb_new_group_pa) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1133,8 +1133,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.pa_pstart(), msg.pa_len(), msg.pa_lstart());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_mb_new_inode_pa) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_mb_new_inode_pa) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1149,8 +1149,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"ext4_mb_release_group_pa: dev %d,%d pstart %" PRIu64 " len %u", ((unsigned int)((msg.dev()) >> 20)),
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.pa_pstart(), msg.pa_len());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_mb_release_group_pa) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_mb_release_group_pa) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1166,8 +1166,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.block(), msg.count());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_mb_release_inode_pa) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_mb_release_inode_pa) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1192,8 +1192,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{0x4000, "STRICT_CHECK"}),
msg.tail(), msg.buddy() ? 1 << msg.buddy() : 0);
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_mballoc_alloc) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_mballoc_alloc) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1209,8 +1209,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), msg.result_group(), msg.result_start(),
msg.result_len());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_mballoc_discard) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_mballoc_discard) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1226,7 +1226,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), msg.result_group(), msg.result_start(),
msg.result_len());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_mballoc_free) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_mballoc_free) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1243,8 +1243,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.orig_group(), msg.orig_start(), msg.orig_len(), msg.orig_logical(), msg.result_group(),
msg.result_start(), msg.result_len(), msg.result_logical());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_mballoc_prealloc) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_mballoc_prealloc) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1260,8 +1260,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.orig_ino(),
msg.ino(), msg.mode(), msg.uid(), msg.gid());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_other_inode_update_time) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_other_inode_update_time) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1279,7 +1279,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
__print_flags(msg.mode(), "|", {0x01, "KEEP_SIZE"}, {0x02, "PUNCH_HOLE"}, {0x04, "NO_HIDE_STALE"},
{0x08, "COLLAPSE_RANGE"}, {0x10, "ZERO_RANGE"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_punch_hole) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_punch_hole) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1293,8 +1293,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_read_block_bitmap_load: dev %d,%d group %u",
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.group());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(ext4_read_block_bitmap_load) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(ext4_read_block_bitmap_load) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1309,7 +1309,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"ext4_readpage: dev %d,%d ino %" PRIu64 " page_index %" PRIu64 "", ((unsigned int)((msg.dev()) >> 20)),
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), msg.index());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_readpage) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_readpage) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1324,7 +1324,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"ext4_releasepage: dev %d,%d ino %" PRIu64 " page_index %" PRIu64 "", ((unsigned int)((msg.dev()) >> 20)),
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), msg.index());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_releasepage) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_releasepage) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1342,8 +1342,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
(unsigned)msg.ee_lblk(), msg.ee_pblk(), (unsigned short)msg.ee_len(), (unsigned)msg.from(),
(unsigned)msg.to(), msg.partial());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_remove_blocks) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_remove_blocks) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1365,8 +1365,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{0x4000, "STRICT_CHECK"}),
msg.len(), msg.logical(), msg.goal(), msg.lleft(), msg.lright(), msg.pleft(), msg.pright());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_request_blocks) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_request_blocks) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1381,8 +1381,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"ext4_request_inode: dev %d,%d dir %" PRIu64 " mode 0%o", ((unsigned int)((msg.dev()) >> 20)),
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.dir(), msg.mode());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_request_inode) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_request_inode) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1398,8 +1398,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.parent(), msg.datasync());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_sync_file_enter) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_sync_file_enter) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1414,8 +1414,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"ext4_sync_file_exit: dev %d,%d ino %" PRIu64 " ret %d", ((unsigned int)((msg.dev()) >> 20)),
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), msg.ret());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_sync_file_exit) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_sync_file_exit) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1429,7 +1429,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_sync_fs: dev %d,%d wait %d",
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.wait());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_sync_fs) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_sync_fs) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1444,8 +1444,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_trim_all_free: dev %d,%d group %u, start %d, len %d",
msg.dev_major(), msg.dev_minor(), msg.group(), msg.start(), msg.len());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_trim_all_free) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_trim_all_free) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1460,7 +1460,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_trim_extent: dev %d,%d group %u, start %d, len %d",
msg.dev_major(), msg.dev_minor(), msg.group(), msg.start(), msg.len());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_trim_extent) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_trim_extent) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1475,8 +1475,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"ext4_truncate_enter: dev %d,%d ino %" PRIu64 " blocks %" PRIu64 "", ((unsigned int)((msg.dev()) >> 20)),
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), msg.blocks());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_truncate_enter) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_truncate_enter) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1491,8 +1491,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"ext4_truncate_exit: dev %d,%d ino %" PRIu64 " blocks %" PRIu64 "", ((unsigned int)((msg.dev()) >> 20)),
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), msg.blocks());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_truncate_exit) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_truncate_exit) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1508,7 +1508,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.size(), msg.parent());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_unlink_enter) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_unlink_enter) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1523,7 +1523,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(),
msg.ret());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_unlink_exit) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_unlink_exit) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1539,7 +1539,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), msg.pos(),
msg.len(), msg.flags());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_write_begin) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_write_begin) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1555,7 +1555,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), msg.pos(),
msg.len(), msg.copied());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_write_end) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_write_end) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1570,7 +1570,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"ext4_writepage: dev %d,%d ino %" PRIu64 " page_index %" PRIu64 "", ((unsigned int)((msg.dev()) >> 20)),
((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), msg.index());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_writepage) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_writepage) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1589,7 +1589,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.nr_to_write(), msg.pages_skipped(), msg.range_start(), msg.range_end(), msg.sync_mode(),
msg.for_kupdate(), msg.range_cyclic(), msg.writeback_index());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_writepages) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_writepages) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1606,8 +1606,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), msg.ret(),
msg.pages_written(), msg.pages_skipped(), msg.sync_mode(), msg.writeback_index());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(ext4_writepages_result) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(ext4_writepages_result) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -1625,7 +1625,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
__print_flags(msg.mode(), "|", {0x01, "KEEP_SIZE"}, {0x02, "PUNCH_HOLE"}, {0x04, "NO_HIDE_STALE"},
{0x08, "COLLAPSE_RANGE"}, {0x10, "ZERO_RANGE"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ext4_zero_range) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(ext4_zero_range) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -36,7 +36,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
(unsigned long)msg.ino(), (unsigned long)msg.pino(), msg.mode(), msg.size(), (unsigned int)msg.nlink(),
msg.blocks(), (unsigned char)msg.advise());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(f2fs_sync_file_enter) msg had be cut off in outfile");
}
return std::string(buffer);
@ -59,7 +59,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{CP_SPEC_LOG_NUM, "log type is 2"}, {CP_RECOVER_DIR, "dir needs recovery"}),
msg.datasync(), msg.ret());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(f2fs_sync_file_exit) msg had be cut off in outfile");
}
return std::string(buffer);
@ -76,7 +76,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))),
(unsigned long)msg.ino(), msg.pos(), msg.len(), msg.flags());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(f2fs_write_begin) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(f2fs_write_begin) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -92,7 +93,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))),
(unsigned long)msg.ino(), msg.pos(), msg.len(), msg.copied());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(f2fs_write_end) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(f2fs_write_end) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -39,7 +39,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
__print_symbolic(msg.fl_type(), {0, "F_RDLCK"}, {1, "F_WRLCK"}, {2, "F_UNLCK"}), msg.fl_break_time(),
msg.fl_downgrade_time());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(break_lease_block) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(break_lease_block) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -61,8 +61,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
__print_symbolic(msg.fl_type(), {0, "F_RDLCK"}, {1, "F_WRLCK"}, {2, "F_UNLCK"}), msg.fl_break_time(),
msg.fl_downgrade_time());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(break_lease_noblock) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(break_lease_noblock) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -84,8 +84,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
__print_symbolic(msg.fl_type(), {0, "F_RDLCK"}, {1, "F_WRLCK"}, {2, "F_UNLCK"}), msg.fl_break_time(),
msg.fl_downgrade_time());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(break_lease_unblock) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(break_lease_unblock) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -106,7 +106,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{512, "FL_UNLOCK_PENDING"}, {1024, "FL_OFDLCK"}),
__print_symbolic(msg.fl_type(), {0, "F_RDLCK"}, {1, "F_WRLCK"}, {2, "F_UNLCK"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(generic_add_lease) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(generic_add_lease) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -128,8 +128,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
__print_symbolic(msg.fl_type(), {0, "F_RDLCK"}, {1, "F_WRLCK"}, {2, "F_UNLCK"}), msg.fl_break_time(),
msg.fl_downgrade_time());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(generic_delete_lease) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(generic_delete_lease) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -151,7 +151,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
__print_symbolic(msg.fl_type(), {0, "F_RDLCK"}, {1, "F_WRLCK"}, {2, "F_UNLCK"}), msg.fl_break_time(),
msg.fl_downgrade_time());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(time_out_leases) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(time_out_leases) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -33,7 +33,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
((unsigned int)((msg.s_dev()) >> 20)), ((unsigned int)((msg.s_dev()) & ((1U << 20) - 1))), msg.i_ino(),
msg.old(), msg.seq_new());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(file_check_and_advance_wb_err) msg had be cut off in outfile");
}
return std::string(buffer);
@ -49,7 +49,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"filemap_set_wb_err: dev=%d:%d ino=0x%" PRIx64 " errseq=0x%x", ((unsigned int)((msg.s_dev()) >> 20)),
((unsigned int)((msg.s_dev()) & ((1U << 20) - 1))), msg.i_ino(), msg.errseq());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(filemap_set_wb_err) msg had be cut off in outfile");
}
return std::string(buffer);
@ -66,7 +66,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
(((msg.s_dev()) >> 20)), (((msg.s_dev()) & ((1U << 20) - 1))), msg.i_ino(), "0000000000000000", msg.pfn(),
msg.index() << 12);
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(mm_filemap_add_to_page_cache) msg had be cut off in outfile");
}
return std::string(buffer);
@ -84,7 +84,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
(((msg.s_dev()) >> 20)), (((msg.s_dev()) & ((1U << 20) - 1))), msg.i_ino(), "0000000000000000", msg.pfn(),
msg.index() << 12);
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
PROFILER_LOG_WARN(LOG_CORE,
"maybe, the contents of print event(mm_filemap_delete_from_page_cache) msg had be cut off in outfile");
}
return std::string(buffer);

View File

@ -41,7 +41,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "bputs: %p: %s", (void*)msg.ip(), msg.str().c_str());
}
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(bputs) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(bputs) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -55,7 +55,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "branch: %u:%s:%s (%u)%s", msg.line(),
msg.func().c_str(), msg.file().c_str(), msg.correct(), msg.constant() ? " CONSTANT" : "");
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(branch) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(branch) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -70,7 +70,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.prev_pid(), msg.prev_prio(), msg.prev_state(), msg.next_pid(), msg.next_prio(), msg.next_state(),
msg.next_cpu());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(context_switch) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(context_switch) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -95,7 +95,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "funcgraph_entry: --> %p (%d)", (void*)msg.func(), msg.depth());
}
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(funcgraph_entry) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(funcgraph_entry) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -122,7 +122,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.depth(), msg.calltime(), msg.rettime(), msg.depth());
}
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(funcgraph_exit) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(funcgraph_exit) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -147,7 +147,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "function: %p <-- %p", (void*)msg.ip(), (void*)msg.parent_ip());
}
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(function) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(function) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -182,7 +182,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
(void*)msg.caller()[4], (void*)msg.caller()[5], (void*)msg.caller()[6], (void*)msg.caller()[7]);
}
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(kernel_stack) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(kernel_stack) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -197,7 +197,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "mmiotrace_map: %" PRIx64 " %" PRIx64 " %" PRIx64 " %d %x",
msg.phys(), msg.virt(), msg.len(), msg.map_id(), msg.opcode());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(mmiotrace_map) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(mmiotrace_map) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -212,7 +212,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"mmiotrace_rw: %" PRIx64 " %" PRIx64 " %" PRIx64 " %d %x %x", msg.phys(), msg.value(), msg.pc(),
msg.map_id(), msg.opcode(), msg.width());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(mmiotrace_rw) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(mmiotrace_rw) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -229,7 +229,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
}
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "print: %s", fieldBuf.c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(print) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(print) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -264,7 +264,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
(void*)msg.caller()[4], (void*)msg.caller()[5], (void*)msg.caller()[6], (void*)msg.caller()[7]);
}
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(user_stack) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(user_stack) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -279,7 +279,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "wakeup: %u:%u:%u ==+ %u:%u:%u [%03u]", msg.prev_pid(),
msg.prev_prio(), msg.prev_state(), msg.next_pid(), msg.next_prio(), msg.next_state(), msg.next_cpu());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(wakeup) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(wakeup) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -31,7 +31,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "gpio_direction: %u %3s (%d)", msg.gpio(),
msg.in() ? "in" : "out", msg.err());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(gpio_direction) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(gpio_direction) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -45,7 +45,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "gpio_value: %u %3s %d", msg.gpio(),
msg.get() ? "get" : "set", msg.value());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(gpio_value) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(gpio_value) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -31,7 +31,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "gpu_mem_total: gpu_id=%u pid=%u size=%" PRIu64 "",
msg.gpu_id(), msg.pid(), msg.size());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(gpu_mem_total) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(gpu_mem_total) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -31,7 +31,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "i2c_read: i2c-%d #%u a=%03x f=%04x l=%u",
msg.adapter_nr(), msg.msg_nr(), msg.addr(), msg.flags(), msg.len());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(i2c_read) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(i2c_read) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -46,7 +46,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"i2c_reply: i2c-%d #%u a=%03x f=%04x l=%" PRId32 " [%" PRId32 "]", msg.adapter_nr(), msg.msg_nr(),
msg.addr(), msg.flags(), msg.len(), msg.buf());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(i2c_reply) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(i2c_reply) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -60,7 +60,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "i2c_result: i2c-%d n=%u ret=%d", msg.adapter_nr(),
msg.nr_msgs(), msg.ret());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(i2c_result) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(i2c_result) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -75,7 +75,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"i2c_write: i2c-%d #%u a=%03x f=%04x l=%" PRId32 " [%" PRId32 "]", msg.adapter_nr(), msg.msg_nr(),
msg.addr(), msg.flags(), msg.len(), msg.buf());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(i2c_write) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(i2c_write) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -30,7 +30,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ipi_entry: (%s)", msg.reason().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ipi_entry) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(ipi_entry) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -43,7 +43,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ipi_exit: (%s)", msg.reason().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ipi_exit) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(ipi_exit) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -57,7 +57,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ipi_raise: target_mask=%" PRIu64 " (%s)",
msg.target_cpus(), msg.reason().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(ipi_raise) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(ipi_raise) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -31,7 +31,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(
buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "irq_handler_entry: irq=%d name=%s", msg.irq(), msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(irq_handler_entry) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(irq_handler_entry) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -45,7 +45,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "irq_handler_exit: irq=%d ret=%s", msg.irq(),
msg.ret() ? "handled" : "unhandled");
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(irq_handler_exit) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(irq_handler_exit) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -60,7 +60,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
__print_symbolic(msg.vec(), {0, "HI"}, {1, "TIMER"}, {2, "NET_TX"}, {3, "NET_RX"}, {4, "BLOCK"},
{5, "IRQ_POLL"}, {6, "TASKLET"}, {7, "SCHED"}, {8, "HRTIMER"}, {9, "RCU"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(softirq_entry) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(softirq_entry) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -75,7 +75,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
__print_symbolic(msg.vec(), {0, "HI"}, {1, "TIMER"}, {2, "NET_TX"}, {3, "NET_RX"}, {4, "BLOCK"},
{5, "IRQ_POLL"}, {6, "TASKLET"}, {7, "SCHED"}, {8, "HRTIMER"}, {9, "RCU"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(softirq_exit) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(softirq_exit) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -90,7 +90,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
__print_symbolic(msg.vec(), {0, "HI"}, {1, "TIMER"}, {2, "NET_TX"}, {3, "NET_RX"}, {4, "BLOCK"},
{5, "IRQ_POLL"}, {6, "TASKLET"}, {7, "SCHED"}, {8, "HRTIMER"}, {9, "RCU"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(softirq_raise) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(softirq_raise) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -32,7 +32,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len =
snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "kfree: call_site=%p ptr=%p", msg.call_site(), msg.ptr());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(kfree) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(kfree) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -104,7 +104,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{(unsigned long)((gfp_t)0x800u), "__GFP_KSWAPD_RECLAIM"})
: "none");
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(kmalloc) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(kmalloc) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -177,7 +177,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
: "none",
msg.node());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(kmalloc_node) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(kmalloc_node) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -249,7 +249,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{(unsigned long)((gfp_t)0x800u), "__GFP_KSWAPD_RECLAIM"})
: "none");
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(kmem_cache_alloc) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(kmem_cache_alloc) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -323,8 +323,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
: "none",
msg.node());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(kmem_cache_alloc_node) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(kmem_cache_alloc_node) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -338,7 +338,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(
buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "kmem_cache_free: call_site=%p ptr=%p", msg.call_site(), msg.ptr());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(kmem_cache_free) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(kmem_cache_free) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -410,7 +410,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{(unsigned long)((gfp_t)0x800u), "__GFP_KSWAPD_RECLAIM"})
: "none");
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(mm_page_alloc) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(mm_page_alloc) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -428,8 +428,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"0000000000000000", msg.pfn(), msg.alloc_order(), msg.fallback_order(), (11 - 1), msg.alloc_migratetype(),
msg.fallback_migratetype(), msg.fallback_order() < (11 - 1), msg.change_ownership());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(mm_page_alloc_extfrag) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(mm_page_alloc_extfrag) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -444,8 +444,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"mm_page_alloc_zone_locked: page=%s pfn=%" PRIu64 " order=%u migratetype=%d percpu_refill=%d",
"0000000000000000", msg.pfn() != -1UL ? msg.pfn() : 0, msg.order(), msg.migratetype(), msg.order() == 0);
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(mm_page_alloc_zone_locked) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(mm_page_alloc_zone_locked) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -459,7 +459,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "mm_page_free: page=%s pfn=%" PRIu64 " order=%d",
"0000000000000000", msg.pfn(), msg.order());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(mm_page_free) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(mm_page_free) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -473,8 +473,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1,
"mm_page_free_batched: page=%s pfn=%" PRIu64 " order=0", "0000000000000000", msg.pfn());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(mm_page_free_batched) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(mm_page_free_batched) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -489,8 +489,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"mm_page_pcpu_drain: page=%s pfn=%" PRIu64 " order=%d migratetype=%d", "0000000000000000", msg.pfn(),
msg.order(), msg.migratetype());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(mm_page_pcpu_drain) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(mm_page_pcpu_drain) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -505,7 +505,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "rss_stat: mm_id=%u curr=%d member=%d size=%" PRIu64 "B",
msg.mm_id(), msg.curr(), msg.member(), msg.size());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(rss_stat) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(rss_stat) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -40,7 +40,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.sbc_retries(), msg.bytes_xfered(), msg.data_err(), msg.tag(), msg.can_retune(), msg.doing_retune(),
msg.retune_now(), msg.need_retune(), msg.hold_retune(), msg.retune_period());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(mmc_request_done) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(mmc_request_done) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -62,7 +62,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.can_retune(), msg.doing_retune(), msg.retune_now(), msg.need_retune(), msg.hold_retune(),
msg.retune_period());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(mmc_request_start) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(mmc_request_start) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -36,8 +36,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.vlan_tci(), msg.protocol(), msg.ip_summed(), msg.hash(), msg.l4_hash(), msg.len(), msg.data_len(),
msg.truesize(), msg.mac_header_valid(), msg.mac_header(), msg.nr_frags(), msg.gso_size(), msg.gso_type());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(napi_gro_frags_entry) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(napi_gro_frags_entry) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -56,8 +56,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.vlan_tci(), msg.protocol(), msg.ip_summed(), msg.hash(), msg.l4_hash(), msg.len(), msg.data_len(),
msg.truesize(), msg.mac_header_valid(), msg.mac_header(), msg.nr_frags(), msg.gso_size(), msg.gso_type());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(napi_gro_receive_entry) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(napi_gro_receive_entry) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -71,7 +71,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "net_dev_queue: dev=%s skbaddr=%p len=%u",
msg.name().c_str(), msg.skbaddr(), msg.len());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(net_dev_queue) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(net_dev_queue) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -91,8 +91,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.transport_offset_valid(), msg.transport_offset(), msg.tx_flags(), msg.gso_size(), msg.gso_segs(),
msg.gso_type());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(net_dev_start_xmit) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(net_dev_start_xmit) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -106,7 +106,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "net_dev_xmit: dev=%s skbaddr=%p len=%u rc=%d",
msg.name().c_str(), msg.skbaddr(), msg.len(), msg.rc());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(net_dev_xmit) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(net_dev_xmit) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -120,7 +120,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "netif_receive_skb: dev=%s skbaddr=%p len=%u",
msg.name().c_str(), msg.skbaddr(), msg.len());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(netif_receive_skb) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(netif_receive_skb) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -139,8 +139,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.vlan_tci(), msg.protocol(), msg.ip_summed(), msg.hash(), msg.l4_hash(), msg.len(), msg.data_len(),
msg.truesize(), msg.mac_header_valid(), msg.mac_header(), msg.nr_frags(), msg.gso_size(), msg.gso_type());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(netif_receive_skb_entry) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(netif_receive_skb_entry) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -154,7 +154,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "netif_rx: dev=%s skbaddr=%p len=%u",
msg.name().c_str(), msg.skbaddr(), msg.len());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(netif_rx) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(netif_rx) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -173,7 +173,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.vlan_tci(), msg.protocol(), msg.ip_summed(), msg.hash(), msg.l4_hash(), msg.len(), msg.data_len(),
msg.truesize(), msg.mac_header_valid(), msg.mac_header(), msg.nr_frags(), msg.gso_size(), msg.gso_type());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(netif_rx_entry) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(netif_rx_entry) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -192,7 +192,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.vlan_tci(), msg.protocol(), msg.ip_summed(), msg.hash(), msg.l4_hash(), msg.len(), msg.data_len(),
msg.truesize(), msg.mac_header_valid(), msg.mac_header(), msg.nr_frags(), msg.gso_size(), msg.gso_type());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(netif_rx_ni_entry) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(netif_rx_ni_entry) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -32,7 +32,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"oom_score_adj_update: pid=%d comm=%s oom_score_adj=%" PRId32 "", msg.pid(), msg.comm().c_str(),
msg.oom_score_adj());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
PROFILER_LOG_WARN(
LOG_CORE, "maybe, the contents of print event(oom_score_adj_update) msg had be cut off in outfile");
}
return std::string(buffer);

View File

@ -31,7 +31,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(
buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "mm_lru_activate: page=%p pfn=%" PRIu64 "", msg.page(), msg.pfn());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(mm_lru_activate) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(mm_lru_activate) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -47,7 +47,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.flags() & 0x0001u ? "M" : " ", msg.flags() & 0x0002u ? "a" : "f", msg.flags() & 0x0008u ? "s" : " ",
msg.flags() & 0x0010u ? "b" : " ", msg.flags() & 0x0020u ? "d" : " ", msg.flags() & 0x0040u ? "B" : " ");
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(mm_lru_insertion) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(mm_lru_insertion) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -32,7 +32,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clock_disable: %s state=%lu cpu_id=%lu",
msg.name().c_str(), (unsigned long)msg.state(), (unsigned long)msg.cpu_id());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(clock_disable) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(clock_disable) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -46,7 +46,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clock_enable: %s state=%lu cpu_id=%lu",
msg.name().c_str(), (unsigned long)msg.state(), (unsigned long)msg.cpu_id());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(clock_enable) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(clock_enable) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -60,7 +60,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clock_set_rate: %s state=%lu cpu_id=%lu",
msg.name().c_str(), (unsigned long)msg.state(), (unsigned long)msg.cpu_id());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(clock_set_rate) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(clock_set_rate) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -74,7 +74,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cpu_frequency: state=%lu cpu_id=%lu",
(unsigned long)msg.state(), (unsigned long)msg.cpu_id());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(cpu_frequency) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(cpu_frequency) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -88,8 +88,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cpu_frequency_limits: min=%lu max=%lu cpu_id=%lu",
(unsigned long)msg.min_freq(), (unsigned long)msg.max_freq(), (unsigned long)msg.cpu_id());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(cpu_frequency_limits) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(cpu_frequency_limits) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -103,7 +103,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cpu_idle: state=%lu cpu_id=%lu",
(unsigned long)msg.state(), (unsigned long)msg.cpu_id());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(cpu_idle) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(cpu_idle) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -120,8 +120,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{DEV_PM_QOS_FLAGS, "DEV_PM_QOS_FLAGS"}),
msg.new_value());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(dev_pm_qos_add_request) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(dev_pm_qos_add_request) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -138,8 +138,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{DEV_PM_QOS_FLAGS, "DEV_PM_QOS_FLAGS"}),
msg.new_value());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(dev_pm_qos_remove_request) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(dev_pm_qos_remove_request) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -156,8 +156,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{DEV_PM_QOS_FLAGS, "DEV_PM_QOS_FLAGS"}),
msg.new_value());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(dev_pm_qos_update_request) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(dev_pm_qos_update_request) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -171,8 +171,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "device_pm_callback_end: %s %s, err=%d",
msg.driver().c_str(), msg.device().c_str(), msg.error());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(device_pm_callback_end) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(device_pm_callback_end) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -190,8 +190,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{0x0008, "quiesce"}, {0x0004, "hibernate"}, {0x0020, "thaw"}, {0x0040, "restore"},
{0x0080, "recover"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(device_pm_callback_start) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(device_pm_callback_start) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -205,8 +205,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(
buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "pm_qos_add_request: CPU_DMA_LATENCY value=%d", msg.value());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(pm_qos_add_request) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(pm_qos_add_request) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -220,8 +220,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(
buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "pm_qos_remove_request: CPU_DMA_LATENCY value=%d", msg.value());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(pm_qos_remove_request) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(pm_qos_remove_request) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -238,8 +238,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{PM_QOS_REMOVE_REQ, "REMOVE_REQ"}),
msg.prev_value(), msg.curr_value());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(pm_qos_update_flags) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(pm_qos_update_flags) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -253,8 +253,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(
buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "pm_qos_update_request: CPU_DMA_LATENCY value=%d", msg.value());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(pm_qos_update_request) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(pm_qos_update_request) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -271,8 +271,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{PM_QOS_REMOVE_REQ, "REMOVE_REQ"}),
msg.prev_value(), msg.curr_value());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(pm_qos_update_target) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(pm_qos_update_target) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -286,8 +286,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "power_domain_target: %s state=%lu cpu_id=%lu",
msg.name().c_str(), (unsigned long)msg.state(), (unsigned long)msg.cpu_id());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(power_domain_target) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(power_domain_target) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -305,7 +305,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
(unsigned long)msg.to(), msg.mperf(), msg.aperf(), msg.tsc(), (unsigned long)msg.freq(),
(unsigned long)msg.io_boost());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(pstate_sample) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(pstate_sample) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -319,7 +319,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "suspend_resume: %s[%u] %s", msg.action().c_str(),
(unsigned int)msg.val(), (msg.start()) ? "begin" : "end");
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(suspend_resume) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(suspend_resume) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -333,8 +333,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "wakeup_source_activate: %s state=0x%" PRIx64 "",
msg.name().c_str(), msg.state());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(wakeup_source_activate) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(wakeup_source_activate) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -348,8 +348,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "wakeup_source_deactivate: %s state=0x%" PRIx64 "",
msg.name().c_str(), msg.state());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(wakeup_source_deactivate) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(wakeup_source_deactivate) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -30,7 +30,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "console: %s", msg.msg().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(console) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(console) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -32,7 +32,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"sys_enter: NR %" PRIu64 " (%" PRIx64 ", %" PRIx64 ", %" PRIx64 ", %" PRIx64 ", %" PRIx64 ", %" PRIx64 ")",
msg.id(), msg.args()[0], msg.args()[1], msg.args()[2], msg.args()[3], msg.args()[4], msg.args()[5]);
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(sys_enter) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(sys_enter) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -46,7 +46,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(
buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sys_exit: NR %" PRIu64 " = %" PRIu64 "", msg.id(), msg.ret());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(sys_exit) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(sys_exit) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -30,7 +30,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "rcu_utilization: %s", msg.s().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(rcu_utilization) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(rcu_utilization) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -31,8 +31,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len =
snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_bypass_disable: name=%s", msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(regulator_bypass_disable) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(regulator_bypass_disable) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -46,8 +46,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(
buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_bypass_disable_complete: name=%s", msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(regulator_bypass_disable_complete) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(regulator_bypass_disable_complete) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -61,8 +61,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len =
snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_bypass_enable: name=%s", msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(regulator_bypass_enable) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(regulator_bypass_enable) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -76,8 +76,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(
buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_bypass_enable_complete: name=%s", msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(regulator_bypass_enable_complete) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(regulator_bypass_enable_complete) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -90,7 +90,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_disable: name=%s", msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(regulator_disable) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(regulator_disable) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -104,8 +104,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len =
snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_disable_complete: name=%s", msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(regulator_disable_complete) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(regulator_disable_complete) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -118,7 +118,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_enable: name=%s", msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(regulator_enable) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(regulator_enable) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -132,8 +132,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len =
snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_enable_complete: name=%s", msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(regulator_enable_complete) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(regulator_enable_complete) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -147,8 +147,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len =
snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_enable_delay: name=%s", msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(regulator_enable_delay) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(regulator_enable_delay) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -162,8 +162,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_set_voltage: name=%s (%d-%d)",
msg.name().c_str(), (int)msg.min(), (int)msg.max());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(regulator_set_voltage) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(regulator_set_voltage) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -177,8 +177,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_set_voltage_complete: name=%s, val=%u",
msg.name().c_str(), (int)msg.val());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(regulator_set_voltage_complete) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(regulator_set_voltage_complete) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -31,8 +31,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_blocked_reason: pid=%d iowait=%d caller=%p",
msg.pid(), msg.io_wait(), msg.caller());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(sched_blocked_reason) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(sched_blocked_reason) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -46,8 +46,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(
buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_kthread_stop: comm=%s pid=%d", msg.comm().c_str(), msg.pid());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(sched_kthread_stop) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(sched_kthread_stop) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -60,8 +60,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_kthread_stop_ret: ret=%d", msg.ret());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(sched_kthread_stop_ret) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(sched_kthread_stop_ret) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -76,8 +76,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"sched_migrate_task: comm=%s pid=%d prio=%d orig_cpu=%d dest_cpu=%d", msg.comm().c_str(), msg.pid(),
msg.prio(), msg.orig_cpu(), msg.dest_cpu());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(sched_migrate_task) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(sched_migrate_task) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -92,7 +92,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"sched_move_numa: pid=%d tgid=%d ngid=%d src_cpu=%d src_nid=%d dst_cpu=%d dst_nid=%d", msg.pid(),
msg.tgid(), msg.ngid(), msg.src_cpu(), msg.src_nid(), msg.dst_cpu(), msg.dst_nid());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(sched_move_numa) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(sched_move_numa) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -107,7 +107,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_pi_setprio: comm=%s pid=%d oldprio=%d newprio=%d",
msg.comm().c_str(), msg.pid(), msg.oldprio(), msg.newprio());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(sched_pi_setprio) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(sched_pi_setprio) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -121,8 +121,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_process_exec: filename=%s pid=%d old_pid=%d",
msg.filename().c_str(), msg.pid(), msg.old_pid());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(sched_process_exec) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(sched_process_exec) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -136,8 +136,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_process_exit: comm=%s pid=%d prio=%d",
msg.comm().c_str(), msg.pid(), msg.prio());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(sched_process_exit) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(sched_process_exit) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -152,8 +152,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"sched_process_fork: comm=%s pid=%d child_comm=%s child_pid=%d", msg.parent_comm().c_str(),
msg.parent_pid(), msg.child_comm().c_str(), msg.child_pid());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(sched_process_fork) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(sched_process_fork) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -167,8 +167,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_process_free: comm=%s pid=%d prio=%d",
msg.comm().c_str(), msg.pid(), msg.prio());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(sched_process_free) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(sched_process_free) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -182,8 +182,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_process_wait: comm=%s pid=%d prio=%d",
msg.comm().c_str(), msg.pid(), msg.prio());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(sched_process_wait) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(sched_process_wait) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -197,8 +197,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1,
"sched_stat_blocked: comm=%s pid=%d delay=%" PRIu64 " [ns]", msg.comm().c_str(), msg.pid(), msg.delay());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(sched_stat_blocked) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(sched_stat_blocked) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -212,7 +212,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1,
"sched_stat_iowait: comm=%s pid=%d delay=%" PRIu64 " [ns]", msg.comm().c_str(), msg.pid(), msg.delay());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(sched_stat_iowait) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(sched_stat_iowait) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -227,8 +227,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"sched_stat_runtime: comm=%s pid=%d runtime=%" PRIu64 " [ns] vruntime=%" PRIu64 " [ns]", msg.comm().c_str(),
msg.pid(), msg.runtime(), msg.vruntime());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(sched_stat_runtime) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(sched_stat_runtime) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -242,7 +242,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1,
"sched_stat_sleep: comm=%s pid=%d delay=%" PRIu64 " [ns]", msg.comm().c_str(), msg.pid(), msg.delay());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(sched_stat_sleep) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(sched_stat_sleep) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -256,7 +256,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1,
"sched_stat_wait: comm=%s pid=%d delay=%" PRIu64 " [ns]", msg.comm().c_str(), msg.pid(), msg.delay());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(sched_stat_wait) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(sched_stat_wait) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -273,7 +273,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.pid(), msg.tgid(), msg.ngid(), msg.src_cpu(), msg.src_nid(), msg.pid(), msg.tgid(), msg.ngid(),
msg.dst_cpu(), msg.dst_nid());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(sched_stick_numa) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(sched_stick_numa) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -290,7 +290,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.src_pid(), msg.src_tgid(), msg.src_ngid(), msg.src_cpu(), msg.src_nid(), msg.dst_pid(), msg.dst_tgid(),
msg.dst_ngid(), msg.dst_cpu(), msg.dst_nid());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(sched_swap_numa) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(sched_swap_numa) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -328,7 +328,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.next_comm().c_str(), msg.next_pid(), msg.next_prio());
}
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(sched_switch) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(sched_switch) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -342,7 +342,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_wait_task: comm=%s pid=%d prio=%d",
msg.comm().c_str(), msg.pid(), msg.prio());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(sched_wait_task) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(sched_wait_task) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -355,8 +355,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_wake_idle_without_ipi: cpu=%d", msg.cpu());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(sched_wake_idle_without_ipi) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(sched_wake_idle_without_ipi) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -371,7 +371,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_wakeup: comm=%s pid=%d prio=%d target_cpu=%03d",
msg.comm().c_str(), msg.pid(), msg.prio(), msg.target_cpu());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(sched_wakeup) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(sched_wakeup) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -386,7 +386,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_wakeup_new: comm=%s pid=%d prio=%d target_cpu=%03d",
msg.comm().c_str(), msg.pid(), msg.prio(), msg.target_cpu());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(sched_wakeup_new) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(sched_wakeup_new) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -401,7 +401,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_waking: comm=%s pid=%d prio=%d target_cpu=%03d",
msg.comm().c_str(), msg.pid(), msg.prio(), msg.target_cpu());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(sched_waking) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(sched_waking) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -32,7 +32,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"signal_deliver: sig=%d errno=%d code=%d sa_handler=%" PRIx64 " sa_flags=%" PRIx64 "", msg.sig(),
msg.error_code(), msg.code(), msg.sig_handler(), msg.sig_flags());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(signal_deliver) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(signal_deliver) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -47,7 +47,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"signal_generate: sig=%d errno=%d code=%d comm=%s pid=%d grp=%d res=%d", msg.sig(), msg.error_code(),
msg.code(), msg.comm().c_str(), msg.pid(), msg.group(), msg.result());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(signal_generate) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(signal_generate) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -31,7 +31,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "rpc_call_status: task:%u@%u status=%d",
msg.task_id(), msg.client_id(), msg.status());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(rpc_call_status) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(rpc_call_status) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -45,8 +45,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "rpc_connect_status: task:%u@%u status=%d",
msg.task_id(), msg.client_id(), msg.status());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(rpc_connect_status) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(rpc_connect_status) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -67,7 +67,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{5, "FIN_WAIT2"}, {6, "TIME_WAIT"}, {7, "CLOSE"}, {8, "CLOSE_WAIT"}, {9, "LAST_ACK"}, {10, "LISTEN"},
{11, "CLOSING"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(rpc_socket_close) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(rpc_socket_close) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -88,8 +88,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{5, "FIN_WAIT2"}, {6, "TIME_WAIT"}, {7, "CLOSE"}, {8, "CLOSE_WAIT"}, {9, "LAST_ACK"}, {10, "LISTEN"},
{11, "CLOSING"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(rpc_socket_connect) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(rpc_socket_connect) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -110,7 +110,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{5, "FIN_WAIT2"}, {6, "TIME_WAIT"}, {7, "CLOSE"}, {8, "CLOSE_WAIT"}, {9, "LAST_ACK"}, {10, "LISTEN"},
{11, "CLOSING"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(rpc_socket_error) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(rpc_socket_error) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -131,8 +131,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{5, "FIN_WAIT2"}, {6, "TIME_WAIT"}, {7, "CLOSE"}, {8, "CLOSE_WAIT"}, {9, "LAST_ACK"}, {10, "LISTEN"},
{11, "CLOSING"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(rpc_socket_reset_connection) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(rpc_socket_reset_connection) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -153,8 +153,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{5, "FIN_WAIT2"}, {6, "TIME_WAIT"}, {7, "CLOSE"}, {8, "CLOSE_WAIT"}, {9, "LAST_ACK"}, {10, "LISTEN"},
{11, "CLOSING"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(rpc_socket_shutdown) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(rpc_socket_shutdown) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -175,8 +175,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{5, "FIN_WAIT2"}, {6, "TIME_WAIT"}, {7, "CLOSE"}, {8, "CLOSE_WAIT"}, {9, "LAST_ACK"}, {10, "LISTEN"},
{11, "CLOSING"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(rpc_socket_state_change) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(rpc_socket_state_change) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -217,7 +217,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.status(), msg.action());
}
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(rpc_task_begin) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(rpc_task_begin) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -260,7 +260,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.status(), msg.action());
}
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(rpc_task_complete) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(rpc_task_complete) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -303,8 +303,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.status(), msg.action());
}
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(rpc_task_run_action) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(rpc_task_run_action) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -327,7 +327,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{(1UL << 6), "SIGNALLED"}),
msg.status(), msg.timeout(), msg.q_name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(rpc_task_sleep) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(rpc_task_sleep) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -350,7 +350,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{(1UL << 6), "SIGNALLED"}),
msg.status(), msg.timeout(), msg.q_name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(rpc_task_wakeup) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(rpc_task_wakeup) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -369,7 +369,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{(1UL << 10), "XPT_LISTENER"}, {(1UL << 11), "XPT_CACHE_AUTH"}, {(1UL << 12), "XPT_LOCAL"},
{(1UL << 13), "XPT_KILL_TEMP"}, {(1UL << 14), "XPT_CONG_CTRL"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(svc_handle_xprt) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(svc_handle_xprt) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -384,7 +384,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"svc_process: addr=%s xid=0x%08x service=%s vers=%u proc=%u", msg.addr().c_str(), msg.xid(),
msg.service().c_str(), msg.vers(), msg.proc());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(svc_process) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(svc_process) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -402,7 +402,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{((((1UL))) << ((4))), "SPLICE_OK"}, {((((1UL))) << ((5))), "VICTIM"}, {((((1UL))) << ((6))), "BUSY"},
{((((1UL))) << ((7))), "DATA"}, {((((1UL))) << ((8))), "AUTHERR"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(svc_recv) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(svc_recv) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -420,7 +420,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{((((1UL))) << ((4))), "SPLICE_OK"}, {((((1UL))) << ((5))), "VICTIM"}, {((((1UL))) << ((6))), "BUSY"},
{((((1UL))) << ((7))), "DATA"}, {((((1UL))) << ((8))), "AUTHERR"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(svc_send) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(svc_send) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -433,7 +433,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "svc_wake_up: pid=%d", msg.pid());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(svc_wake_up) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(svc_wake_up) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -453,7 +453,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{(1UL << 13), "XPT_KILL_TEMP"}, {(1UL << 14), "XPT_CONG_CTRL"}),
msg.wakeup());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(svc_xprt_dequeue) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(svc_xprt_dequeue) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -472,8 +472,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{(1UL << 10), "XPT_LISTENER"}, {(1UL << 11), "XPT_CACHE_AUTH"}, {(1UL << 12), "XPT_LOCAL"},
{(1UL << 13), "XPT_KILL_TEMP"}, {(1UL << 14), "XPT_CONG_CTRL"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(svc_xprt_do_enqueue) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(svc_xprt_do_enqueue) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -488,7 +488,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "xprt_lookup_rqst: peer=[%s]:%s xid=0x%08x status=%d",
msg.addr().c_str(), msg.port().c_str(), msg.xid(), msg.status());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(xprt_lookup_rqst) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(xprt_lookup_rqst) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -502,7 +502,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(
buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "xprt_transmit: xid=0x%08x status=%d", msg.xid(), msg.status());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(xprt_transmit) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(xprt_transmit) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -32,7 +32,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"task_newtask: pid=%d comm=%s clone_flags=%" PRIx64 " oom_score_adj=%d", msg.pid(), msg.comm().c_str(),
msg.clone_flags(), msg.oom_score_adj());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(task_newtask) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(task_newtask) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -47,7 +47,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"task_rename: pid=%d oldcomm=%s newcomm=%s oom_score_adj=%d", msg.pid(), msg.oldcomm().c_str(),
msg.newcomm().c_str(), msg.oom_score_adj());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(task_rename) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(task_rename) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -31,7 +31,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "hrtimer_cancel: hrtimer=%p", msg.hrtimer());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(hrtimer_cancel) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(hrtimer_cancel) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -58,8 +58,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.now());
}
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(hrtimer_expire_entry) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(hrtimer_expire_entry) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -72,8 +72,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "hrtimer_expire_exit: hrtimer=%p", msg.hrtimer());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(hrtimer_expire_exit) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(hrtimer_expire_exit) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -93,7 +93,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{HRTIMER_MODE_ABS_SOFT, "ABS|SOFT"}, {HRTIMER_MODE_REL_SOFT, "REL|SOFT"},
{HRTIMER_MODE_ABS_PINNED_SOFT, "ABS|PINNED|SOFT"}, {HRTIMER_MODE_REL_PINNED_SOFT, "REL|PINNED|SOFT"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(hrtimer_init) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(hrtimer_init) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -130,7 +130,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{HRTIMER_MODE_REL_PINNED_SOFT, "REL|PINNED|SOFT"}));
}
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(hrtimer_start) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(hrtimer_start) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -144,7 +144,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "itimer_expire: which=%d pid=%d now=%" PRIu64 "",
msg.which(), (int)msg.pid(), msg.now());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(itimer_expire) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(itimer_expire) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -159,7 +159,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"itimer_state: which=%d expires=%" PRIu64 " it_value=%" PRIu64 "it_interval=%" PRIu64 "", msg.which(),
msg.expires(), msg.value_sec(), msg.interval_sec());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(itimer_state) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(itimer_state) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -172,7 +172,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "timer_cancel: timer=%p", msg.timer());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(timer_cancel) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(timer_cancel) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -198,8 +198,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"timer_expire_entry: timer=%p function=%p now=%" PRIu64 "", msg.timer(), msg.function(), msg.now());
}
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(timer_expire_entry) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(timer_expire_entry) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -212,7 +212,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "timer_expire_exit: timer=%p", msg.timer());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(timer_expire_exit) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(timer_expire_exit) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -225,7 +225,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "timer_init: timer=%p", msg.timer());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(timer_init) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(timer_init) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -258,7 +258,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{0x00080000, "D"}, {0x00100000, "P"}, {0x00200000, "I"}));
}
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(timer_start) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(timer_start) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -54,7 +54,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.timecode_userbits0(), msg.timecode_userbits1(), msg.timecode_userbits2(), msg.timecode_userbits3(),
msg.sequence());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(v4l2_dqbuf) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(v4l2_dqbuf) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -90,7 +90,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.timecode_userbits0(), msg.timecode_userbits1(), msg.timecode_userbits2(), msg.timecode_userbits3(),
msg.sequence());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(v4l2_qbuf) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(v4l2_qbuf) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -121,7 +121,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.timecode_userbits0(), msg.timecode_userbits1(), msg.timecode_userbits2(), msg.timecode_userbits3(),
msg.sequence());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(vb2_v4l2_buf_done) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(vb2_v4l2_buf_done) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -152,8 +152,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.timecode_userbits0(), msg.timecode_userbits1(), msg.timecode_userbits2(), msg.timecode_userbits3(),
msg.sequence());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(vb2_v4l2_buf_queue) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(vb2_v4l2_buf_queue) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -184,7 +184,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.timecode_userbits0(), msg.timecode_userbits1(), msg.timecode_userbits2(), msg.timecode_userbits3(),
msg.sequence());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(vb2_v4l2_dqbuf) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(vb2_v4l2_dqbuf) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -215,7 +215,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.timecode_userbits0(), msg.timecode_userbits1(), msg.timecode_userbits2(), msg.timecode_userbits3(),
msg.sequence());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(vb2_v4l2_qbuf) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(vb2_v4l2_qbuf) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -34,8 +34,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
" total_scan %" PRIu64 " last shrinker return val %d",
msg.shrink(), msg.shr(), msg.nid(), msg.unused_scan(), msg.new_scan(), msg.total_scan(), msg.retval());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(mm_shrink_slab_end) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(mm_shrink_slab_end) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -109,8 +109,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
: "none",
msg.cache_items(), msg.delta(), msg.total_scan(), msg.priority());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(mm_shrink_slab_start) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(mm_shrink_slab_start) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -181,8 +181,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{(unsigned long)((gfp_t)0x800u), "__GFP_KSWAPD_RECLAIM"})
: "none");
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(mm_vmscan_direct_reclaim_begin) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(mm_vmscan_direct_reclaim_begin) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -196,8 +196,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1,
"mm_vmscan_direct_reclaim_end: nr_reclaimed=%" PRIu64 "", msg.nr_reclaimed());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(mm_vmscan_direct_reclaim_end) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(mm_vmscan_direct_reclaim_end) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -210,8 +210,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "mm_vmscan_kswapd_sleep: nid=%d", msg.nid());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(mm_vmscan_kswapd_sleep) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(mm_vmscan_kswapd_sleep) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -225,8 +225,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(
buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "mm_vmscan_kswapd_wake: nid=%d order=%d", msg.nid(), msg.order());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(mm_vmscan_kswapd_wake) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(mm_vmscan_kswapd_wake) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -245,8 +245,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
__print_symbolic(msg.lru(), {0, "inactive_anon"}, {1, "active_anon"}, {2, "inactive_file"},
{3, "active_file"}, {4, "unevictable"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(mm_vmscan_lru_isolate) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(mm_vmscan_lru_isolate) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -268,8 +268,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{0x0010u, "RECLAIM_WB_MIXED"}, {0x0004u, "RECLAIM_WB_SYNC"}, {0x0008u, "RECLAIM_WB_ASYNC"})
: "RECLAIM_WB_NONE");
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(mm_vmscan_lru_shrink_inactive) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(mm_vmscan_lru_shrink_inactive) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -340,8 +340,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{(unsigned long)((gfp_t)0x800u), "__GFP_KSWAPD_RECLAIM"})
: "none");
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(mm_vmscan_wakeup_kswapd) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(mm_vmscan_wakeup_kswapd) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -359,8 +359,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{0x0010u, "RECLAIM_WB_MIXED"}, {0x0004u, "RECLAIM_WB_SYNC"}, {0x0008u, "RECLAIM_WB_ASYNC"})
: "RECLAIM_WB_NONE");
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(mm_vmscan_writepage) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(mm_vmscan_writepage) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -31,8 +31,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len =
snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "workqueue_activate_work: work struct %p", msg.work());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(workqueue_activate_work) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(workqueue_activate_work) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -45,8 +45,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "workqueue_execute_end: work struct %p", msg.work());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(workqueue_execute_end) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(workqueue_execute_end) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -71,8 +71,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"workqueue_execute_start: work struct %p: function %p", msg.work(), msg.function());
}
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(workqueue_execute_start) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(workqueue_execute_start) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -99,8 +99,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.function(), msg.workqueue(), msg.req_cpu(), msg.cpu());
}
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(workqueue_queue_work) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(workqueue_queue_work) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -38,8 +38,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.dirty_ratelimit(), msg.task_ratelimit(), msg.dirtied(), msg.dirtied_pause(), msg.paused(), msg.pause(),
msg.period(), msg.think(), msg.cgroup_ino());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(balance_dirty_pages) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(balance_dirty_pages) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -57,8 +57,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.bdi().c_str(), msg.write_bw(), msg.avg_write_bw(), msg.dirty_rate(), msg.dirty_ratelimit(),
msg.task_ratelimit(), msg.balanced_dirty_ratelimit(), msg.cgroup_ino());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(bdi_dirty_ratelimit) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(bdi_dirty_ratelimit) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -75,8 +75,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.nr_dirty(), msg.nr_writeback(), msg.background_thresh(), msg.dirty_thresh(), msg.dirty_limit(),
msg.nr_dirtied(), msg.nr_written());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(global_dirty_state) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(global_dirty_state) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -94,7 +94,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.for_background(), msg.for_reclaim(), msg.range_cyclic(), msg.range_start(), msg.range_end(),
msg.cgroup_ino());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(wbc_writepage) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(wbc_writepage) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -108,8 +108,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len =
snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "writeback_bdi_register: bdi %s", msg.name().c_str());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(writeback_bdi_register) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(writeback_bdi_register) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -123,8 +123,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1,
"writeback_congestion_wait: usec_timeout=%u usec_delayed=%u", msg.usec_timeout(), msg.usec_delayed());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(writeback_congestion_wait) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(writeback_congestion_wait) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -144,8 +144,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{(1 << 2), "I_DIRTY_PAGES"}, {(1 << 3), "I_NEW"}, {(1 << 4), "I_WILL_FREE"}, {(1 << 5), "I_FREEING"},
{(1 << 6), "I_CLEAR"}, {(1 << 7), "I_SYNC"}, {(1 << 11), "I_DIRTY_TIME"}, {(1 << 8), "I_REFERENCED"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(writeback_dirty_inode) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(writeback_dirty_inode) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -165,8 +165,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{(1 << 6), "I_CLEAR"}, {(1 << 7), "I_SYNC"}, {(1 << 11), "I_DIRTY_TIME"}, {(1 << 8), "I_REFERENCED"}),
msg.mode());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(writeback_dirty_inode_enqueue) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(writeback_dirty_inode_enqueue) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -186,8 +186,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{(1 << 2), "I_DIRTY_PAGES"}, {(1 << 3), "I_NEW"}, {(1 << 4), "I_WILL_FREE"}, {(1 << 5), "I_FREEING"},
{(1 << 6), "I_CLEAR"}, {(1 << 7), "I_SYNC"}, {(1 << 11), "I_DIRTY_TIME"}, {(1 << 8), "I_REFERENCED"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(writeback_dirty_inode_start) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(writeback_dirty_inode_start) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -202,8 +202,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"writeback_dirty_page: bdi %s: ino=%" PRIu64 " index=%" PRIu64 "", msg.name().c_str(), msg.ino(),
msg.index());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(writeback_dirty_page) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(writeback_dirty_page) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -224,7 +224,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{4, "laptop_timer"}, {5, "fs_free_space"}, {6, "forker_thread"}),
msg.cgroup_ino());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(writeback_exec) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(writeback_exec) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -244,8 +244,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{(1 << 6), "I_CLEAR"}, {(1 << 7), "I_SYNC"}, {(1 << 11), "I_DIRTY_TIME"}, {(1 << 8), "I_REFERENCED"}),
msg.mode());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(writeback_lazytime) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(writeback_lazytime) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -265,8 +265,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{(1 << 6), "I_CLEAR"}, {(1 << 7), "I_SYNC"}, {(1 << 11), "I_DIRTY_TIME"}, {(1 << 8), "I_REFERENCED"}),
msg.mode());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(writeback_lazytime_iput) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(writeback_lazytime_iput) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -286,8 +286,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{(1 << 2), "I_DIRTY_PAGES"}, {(1 << 3), "I_NEW"}, {(1 << 4), "I_WILL_FREE"}, {(1 << 5), "I_FREEING"},
{(1 << 6), "I_CLEAR"}, {(1 << 7), "I_SYNC"}, {(1 << 11), "I_DIRTY_TIME"}, {(1 << 8), "I_REFERENCED"}));
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(writeback_mark_inode_dirty) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(writeback_mark_inode_dirty) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -300,8 +300,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
char buffer[BUFFER_SIZE];
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "writeback_pages_written: %" PRIu64 "", msg.pages());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(writeback_pages_written) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(writeback_pages_written) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -322,7 +322,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{4, "laptop_timer"}, {5, "fs_free_space"}, {6, "forker_thread"}),
msg.cgroup_ino());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(writeback_queue) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(writeback_queue) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -340,8 +340,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{4, "laptop_timer"}, {5, "fs_free_space"}, {6, "forker_thread"}),
msg.cgroup_ino());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(writeback_queue_io) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(writeback_queue_io) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -361,8 +361,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{(1 << 6), "I_CLEAR"}, {(1 << 7), "I_SYNC"}, {(1 << 11), "I_DIRTY_TIME"}, {(1 << 8), "I_REFERENCED"}),
msg.dirtied_when(), (jiffies - msg.dirtied_when()) / 300, msg.cgroup_ino());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(writeback_sb_inodes_requeue) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(writeback_sb_inodes_requeue) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -383,8 +383,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.dirtied_when(), (jiffies - msg.dirtied_when()) / 300, msg.writeback_index(), msg.nr_to_write(),
msg.wrote(), msg.cgroup_ino());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(writeback_single_inode) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(writeback_single_inode) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -405,8 +405,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
msg.dirtied_when(), (jiffies - msg.dirtied_when()) / 300, msg.writeback_index(), msg.nr_to_write(),
msg.wrote(), msg.cgroup_ino());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(writeback_single_inode_start) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(writeback_single_inode_start) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -427,7 +427,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{4, "laptop_timer"}, {5, "fs_free_space"}, {6, "forker_thread"}),
msg.cgroup_ino());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(writeback_start) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(writeback_start) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -448,7 +448,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{4, "laptop_timer"}, {5, "fs_free_space"}, {6, "forker_thread"}),
msg.cgroup_ino());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(writeback_wait) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(writeback_wait) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -462,8 +462,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1,
"writeback_wait_iff_congested: usec_timeout=%u usec_delayed=%u", msg.usec_timeout(), msg.usec_delayed());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(writeback_wait_iff_congested) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(writeback_wait_iff_congested) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -477,8 +477,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1,
"writeback_wake_background: bdi %s: cgroup_ino=%" PRId32 "", msg.name().c_str(), msg.cgroup_ino());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(writeback_wake_background) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(writeback_wake_background) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -493,8 +493,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"writeback_write_inode: bdi %s: ino=%" PRIu64 " sync_mode=%d cgroup_ino=%" PRId32 "", msg.name().c_str(),
msg.ino(), msg.sync_mode(), msg.cgroup_ino());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(
LOG_CORE, "maybe, the contents of print event(writeback_write_inode) msg had be cut off in outfile");
PROFILER_LOG_WARN(
LOG_CORE, "the contents of print event(writeback_write_inode) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -509,8 +509,8 @@ REGISTER_FTRACE_EVENT_FORMATTER(
"writeback_write_inode_start: bdi %s: ino=%" PRIu64 " sync_mode=%d cgroup_ino=%" PRId32 "",
msg.name().c_str(), msg.ino(), msg.sync_mode(), msg.cgroup_ino());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE,
"maybe, the contents of print event(writeback_write_inode_start) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE,
"the contents of print event(writeback_write_inode_start) msg had be cut off in outfile");
}
return std::string(buffer);
});
@ -531,7 +531,7 @@ REGISTER_FTRACE_EVENT_FORMATTER(
{4, "laptop_timer"}, {5, "fs_free_space"}, {6, "forker_thread"}),
msg.cgroup_ino());
if (len >= BUFFER_SIZE - 1) {
HILOG_WARN(LOG_CORE, "maybe, the contents of print event(writeback_written) msg had be cut off in outfile");
PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(writeback_written) msg had be cut off in outfile");
}
return std::string(buffer);
});

View File

@ -725,7 +725,7 @@ class EventFormatterCodeGenerator(FtraceEventCodeGenerator):
f.write(" if (len >= BUFFER_SIZE - 1) {\n")
f.write(
' HILOG_WARN(LOG_CORE, "maybe, the contents of print event({}) msg had be cut off '
' PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event({}) msg had be cut off '
'in outfile");\n'.format(event.name)
)
f.write(" }\n")

View File

@ -33,10 +33,10 @@ int GpuDataPlugin::Start(const uint8_t* configData, uint32_t configSize)
file_.open(GPU_PATH);
if (!file_.is_open()) {
HILOG_ERROR(LOG_CORE, "%s:failed to open(%s)", __func__, GPU_PATH.c_str());
PROFILER_LOG_ERROR(LOG_CORE, "%s:failed to open(%s)", __func__, GPU_PATH.c_str());
return RET_FAIL;
}
HILOG_INFO(LOG_CORE, "%s:start success!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:start success!", __func__);
return RET_SUCC;
}
@ -67,7 +67,7 @@ int GpuDataPlugin::Report(uint8_t* data, uint32_t dataSize)
int GpuDataPlugin::Stop()
{
file_.close();
HILOG_INFO(LOG_CORE, "%s:stop success!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:stop success!", __func__);
return 0;
}
@ -79,7 +79,7 @@ int GpuDataPlugin::ReadFile()
std::getline(file_, line);
for (char charac : line) {
if (!isdigit(charac)) {
HILOG_ERROR(LOG_CORE, "invalid file content for (%s)", GPU_PATH.c_str());
PROFILER_LOG_ERROR(LOG_CORE, "invalid file content for (%s)", GPU_PATH.c_str());
return RET_FAIL;
}
}

View File

@ -48,7 +48,7 @@ HidumpPlugin::HidumpPlugin() : fp_(nullptr, nullptr) {}
HidumpPlugin::~HidumpPlugin()
{
HILOG_INFO(LOG_CORE, "%s: ready!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s: ready!", __func__);
std::unique_lock<std::mutex> locker(mutex_);
if (running_) {
running_ = false;
@ -61,12 +61,12 @@ HidumpPlugin::~HidumpPlugin()
if (fp_ != nullptr) {
fp_.reset();
}
HILOG_INFO(LOG_CORE, "%s: success!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s: success!", __func__);
}
int HidumpPlugin::Start(const uint8_t* configData, uint32_t configSize)
{
HILOG_INFO(LOG_CORE, "HidumpPlugin:Start ----> !");
PROFILER_LOG_INFO(LOG_CORE, "HidumpPlugin:Start ----> !");
CHECK_TRUE(protoConfig_.ParseFromArray(configData, configSize) > 0, -1, "HidumpPlugin: ParseFromArray failed");
fp_ = std::unique_ptr<FILE, int (*)(FILE*)>(CustomPopen(g_fpsFormat, "r"), CustomPclose);
@ -74,7 +74,7 @@ int HidumpPlugin::Start(const uint8_t* configData, uint32_t configSize)
const int bufSize = 256;
char buf[bufSize] = {0};
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "HidumpPlugin: CustomPopen(%s) Failed, errno(%d:%s)", g_fpsFormat, errno, buf);
PROFILER_LOG_ERROR(LOG_CORE, "HidumpPlugin: CustomPopen(%s) Failed, errno(%d:%s)", g_fpsFormat, errno, buf);
return -1;
}
CHECK_NOTNULL(resultWriter_, -1, "HidumpPlugin: Writer is no set!");
@ -84,7 +84,7 @@ int HidumpPlugin::Start(const uint8_t* configData, uint32_t configSize)
running_ = true;
writeThread_ = std::thread(&HidumpPlugin::Loop, this);
HILOG_INFO(LOG_CORE, "HidumpPlugin: ---> Start success!");
PROFILER_LOG_INFO(LOG_CORE, "HidumpPlugin: ---> Start success!");
return 0;
}
@ -96,11 +96,11 @@ int HidumpPlugin::Stop()
if (writeThread_.joinable()) {
writeThread_.join();
}
HILOG_INFO(LOG_CORE, "HidumpPlugin:stop thread success!");
PROFILER_LOG_INFO(LOG_CORE, "HidumpPlugin:stop thread success!");
if (fp_ != nullptr) {
fp_.reset();
}
HILOG_INFO(LOG_CORE, "HidumpPlugin: stop success!");
PROFILER_LOG_INFO(LOG_CORE, "HidumpPlugin: stop success!");
return 0;
}
@ -112,7 +112,7 @@ int HidumpPlugin::SetWriter(WriterStruct* writer)
void HidumpPlugin::Loop(void)
{
HILOG_INFO(LOG_CORE, "HidumpPlugin: Loop start");
PROFILER_LOG_INFO(LOG_CORE, "HidumpPlugin: Loop start");
CHECK_NOTNULL(resultWriter_, NO_RETVAL, "%s: resultWriter_ nullptr", __func__);
fcntl(fileno(fp_.get()), F_SETFL, O_NONBLOCK);
@ -137,7 +137,7 @@ void HidumpPlugin::Loop(void)
} else {
ProtoEncoder::HidumpInfo hidumpInfo(resultWriter_->startReport(resultWriter_));
if (!ParseHidumpInfo(hidumpInfo, buf)) {
HILOG_ERROR(LOG_CORE, "parse hidump info failed!");
PROFILER_LOG_ERROR(LOG_CORE, "parse hidump info failed!");
}
int messageLen = hidumpInfo.Finish();
resultWriter_->finishReport(resultWriter_, messageLen);
@ -145,7 +145,7 @@ void HidumpPlugin::Loop(void)
}
}
HILOG_INFO(LOG_CORE, "HidumpPlugin: Loop exit");
PROFILER_LOG_INFO(LOG_CORE, "HidumpPlugin: Loop exit");
}
template <typename T>
@ -154,9 +154,9 @@ bool HidumpPlugin::ParseHidumpInfo(T& hidumpInfoProto, char *buf)
// format: fps:123|1501960484673
if (strncmp(buf, "fps:", strlen("fps:")) != 0) {
if (strstr(buf, "inaccessible or not found") != nullptr) {
HILOG_ERROR(LOG_CORE, "HidumpPlugin: fps command not found!");
PROFILER_LOG_ERROR(LOG_CORE, "HidumpPlugin: fps command not found!");
} else {
HILOG_ERROR(LOG_CORE, "format error. %s", buf);
PROFILER_LOG_ERROR(LOG_CORE, "format error. %s", buf);
}
return false;
}
@ -235,7 +235,7 @@ int HidumpPlugin::CustomPclose(FILE* fp)
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "HidumpPlugin:%s fclose failed! errno(%d:%s)", __func__, errno, buf);
PROFILER_LOG_ERROR(LOG_CORE, "HidumpPlugin:%s fclose failed! errno(%d:%s)", __func__, errno, buf);
return -1;
}
kill(g_child, SIGKILL);

View File

@ -71,12 +71,12 @@ bool PluginStart(HidumpPlugin& plugin, HidumpConfig& config)
std::vector<uint8_t> configData(size);
int ret = config.SerializeToArray(configData.data(), configData.size());
CHECK_TRUE(ret > 0, false, "HidumpPluginUnittest: SerializeToArray fail!!!");
HILOG_INFO(LOG_CORE, "HidumpPluginUnittest: SerializeToArray success");
PROFILER_LOG_INFO(LOG_CORE, "HidumpPluginUnittest: SerializeToArray success");
// start
ret = plugin.Start(configData.data(), configData.size());
CHECK_TRUE(ret == 0, false, "HidumpPluginUnittest: start plugin fail!!!");
HILOG_INFO(LOG_CORE, "HidumpPluginUnittest: Start success");
PROFILER_LOG_INFO(LOG_CORE, "HidumpPluginUnittest: Start success");
return true;
}
@ -221,14 +221,14 @@ bool RecordFileExist(std::string& file)
std::string cmd = "cat " + file;
std::unique_ptr<FILE, int (*)(FILE*)> fp(popen(cmd.c_str(), "r"), pclose);
if (!fp) {
HILOG_ERROR(LOG_CORE, "%s:: popen error", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s:: popen error", __func__);
return false;
}
char buff[BUF_MAX_LEN] = {0};
char* pRet = fgets(buff, BUF_MAX_LEN - 1, fp.get());
if (pRet == nullptr) {
HILOG_ERROR(LOG_CORE, "%s: fgets Failed, errno(%d)", __func__, errno);
PROFILER_LOG_ERROR(LOG_CORE, "%s: fgets Failed, errno(%d)", __func__, errno);
return false;
}
buff[BUF_MAX_LEN - 1] = '\0';

View File

@ -38,7 +38,7 @@ void RunCmd(std::string& cmd)
{
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd.c_str(), "r"), pclose);
if (pipe == nullptr) {
HILOG_ERROR(LOG_CORE, "HiebpfPlugin::RunCmd: create popen FAILED!");
PROFILER_LOG_ERROR(LOG_CORE, "HiebpfPlugin::RunCmd: create popen FAILED!");
return;
}
constexpr uint32_t readBufferSize = 4096;
@ -47,7 +47,7 @@ void RunCmd(std::string& cmd)
while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr) {
result += buffer.data();
}
HILOG_INFO(LOG_CORE, "HiebpfPlugin::run command result: %s", result.c_str());
PROFILER_LOG_INFO(LOG_CORE, "HiebpfPlugin::run command result: %s", result.c_str());
}
} // namespace
@ -55,9 +55,9 @@ static int32_t HiebpfSessionStart(const uint8_t* configData, uint32_t configSize
{
std::lock_guard<std::mutex> guard(g_taskMutex);
CHECK_TRUE(!g_releaseResources, 0, "%s: hiebpf released resources, return", __func__);
HILOG_DEBUG(LOG_CORE, "enter");
PROFILER_LOG_DEBUG(LOG_CORE, "enter");
if (configData == nullptr || configSize < 0) {
HILOG_ERROR(LOG_CORE, "Parameter error");
PROFILER_LOG_ERROR(LOG_CORE, "Parameter error");
return RET_ERR;
}
@ -80,7 +80,7 @@ static int32_t HiebpfSessionStart(const uint8_t* configData, uint32_t configSize
std::string cmd = g_config.cmd_line();
cmd += " --start true --output_file " + g_config.outfile_name();
RunCmd(cmd);
HILOG_DEBUG(LOG_CORE, "leave");
PROFILER_LOG_DEBUG(LOG_CORE, "leave");
return RET_OK;
}
@ -88,7 +88,7 @@ static int32_t HiebpfSessionStop()
{
std::lock_guard<std::mutex> guard(g_taskMutex);
CHECK_TRUE(!g_releaseResources, 0, "%s: hiebpf released resources, return", __func__);
HILOG_DEBUG(LOG_CORE, "enter");
PROFILER_LOG_DEBUG(LOG_CORE, "enter");
if (!g_config.split_outfile_name().empty()) {
CHECK_NOTNULL(g_splitTraceWriter, -1, "%s: writer is nullptr, SetDurationTime failed", __func__);
@ -106,7 +106,7 @@ static int32_t HiebpfSessionStop()
g_splitTraceWriter.reset();
g_splitTraceWriter = nullptr;
}
HILOG_DEBUG(LOG_CORE, "leave");
PROFILER_LOG_DEBUG(LOG_CORE, "leave");
return RET_OK;
}

View File

@ -17,7 +17,7 @@
FileCache::FileCache(const std::string& path) : path_(path), fp_(nullptr)
{
HILOG_INFO(LOG_CORE, "FileCache: path(%s)!", path_.c_str());
PROFILER_LOG_INFO(LOG_CORE, "FileCache: path(%s)!", path_.c_str());
}
FileCache::~FileCache()

View File

@ -49,7 +49,7 @@ HilogPlugin::HilogPlugin() : fp_(nullptr, nullptr) {}
HilogPlugin::~HilogPlugin()
{
HILOG_INFO(LOG_CORE, "%s: ready!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s: ready!", __func__);
std::unique_lock<std::mutex> locker(mutex_);
if (running_) {
running_ = false;
@ -65,7 +65,7 @@ HilogPlugin::~HilogPlugin()
if (fp_ != nullptr) {
fp_.reset();
}
HILOG_INFO(LOG_CORE, "%s: success!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s: success!", __func__);
}
int HilogPlugin::Start(const uint8_t* configData, uint32_t configSize)
@ -105,7 +105,7 @@ int HilogPlugin::Start(const uint8_t* configData, uint32_t configSize)
int oldPipeSize = fcntl(fileno(fp_.get()), F_GETPIPE_SZ);
fcntl(fileno(fp_.get()), F_SETPIPE_SZ, oldPipeSize * PIPE_SIZE_RATIO);
int pipeSize = fcntl(fileno(fp_.get()), F_GETPIPE_SZ);
HILOG_INFO(LOG_CORE, "{fp = %d, pipeSize=%d, oldPipeSize=%d}", fileno(fp_.get()), pipeSize, oldPipeSize);
PROFILER_LOG_INFO(LOG_CORE, "{fp = %d, pipeSize=%d, oldPipeSize=%d}", fileno(fp_.get()), pipeSize, oldPipeSize);
workThread_ = std::thread(&HilogPlugin::Run, this);
@ -114,7 +114,7 @@ int HilogPlugin::Start(const uint8_t* configData, uint32_t configSize)
int HilogPlugin::Stop()
{
HILOG_INFO(LOG_CORE, "HilogPlugin: ready stop thread!");
PROFILER_LOG_INFO(LOG_CORE, "HilogPlugin: ready stop thread!");
std::unique_lock<std::mutex> locker(mutex_);
running_ = false;
COMMON::CustomPUnblock(pipeFds_);
@ -126,13 +126,13 @@ int HilogPlugin::Stop()
g_fileCache.Write(dataBuffer_.data(), dataBuffer_.size());
dataBuffer_.erase(dataBuffer_.begin(), dataBuffer_.end());
}
HILOG_INFO(LOG_CORE, "HilogPlugin: stop thread success!");
PROFILER_LOG_INFO(LOG_CORE, "HilogPlugin: stop thread success!");
if (protoConfig_.need_record()) {
g_fileCache.Close();
}
fp_.reset();
HILOG_INFO(LOG_CORE, "HilogPlugin: stop success!");
PROFILER_LOG_INFO(LOG_CORE, "HilogPlugin: stop success!");
return 0;
}
@ -197,7 +197,7 @@ void HilogPlugin::InitHilogCmd()
void HilogPlugin::Run(void)
{
HILOG_INFO(LOG_CORE, "HilogPlugin::Run start!");
PROFILER_LOG_INFO(LOG_CORE, "HilogPlugin::Run start!");
std::unique_ptr<uint8_t[]> buffer = std::make_unique<uint8_t[]>(MAX_BUFFER_LEN);
std::unique_ptr<HilogInfo> dataProto = nullptr;
@ -214,7 +214,8 @@ void HilogPlugin::Run(void)
}
if ((strlen(reinterpret_cast<char*>(buffer.get())) + 1) == (MAX_BUFFER_LEN - 1)) {
HILOG_ERROR(LOG_CORE, "HilogPlugin:data length is greater than the MAX_BUFFER_LEN(%d)", MAX_BUFFER_LEN);
PROFILER_LOG_ERROR(LOG_CORE,
"HilogPlugin:data length is greater than the MAX_BUFFER_LEN(%d)", MAX_BUFFER_LEN);
}
auto cptr = reinterpret_cast<char*>(buffer.get());
@ -249,13 +250,13 @@ void HilogPlugin::Run(void)
FlushDataOptimize(hilogInfo.get());
hilogInfo.reset();
}
HILOG_INFO(LOG_CORE, "HilogPlugin::Run done!");
PROFILER_LOG_INFO(LOG_CORE, "HilogPlugin::Run done!");
}
template <typename T> void HilogPlugin::ParseLogLineInfo(const char* data, size_t len, T& hilogLineInfo)
{
if (data == nullptr || len < TIME_NS_WIDTH) {
HILOG_ERROR(LOG_CORE, "HilogPlugin:%s param invalid", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "HilogPlugin:%s param invalid", __func__);
return;
}
@ -332,7 +333,7 @@ template <typename T> bool HilogPlugin::SetHilogLineDetails(const char* data, T&
if (google::protobuf::internal::IsStructurallyValidUTF8(pTmp, strlen(pTmp) - 1)) {
hilogLineInfo.set_context(pTmp, strlen(pTmp) - 1); // - \n
} else {
HILOG_ERROR(LOG_CORE, "HilogPlugin: log context include invalid UTF-8 data");
PROFILER_LOG_ERROR(LOG_CORE, "HilogPlugin: log context include invalid UTF-8 data");
hilogLineInfo.set_context("");
}
@ -407,7 +408,7 @@ bool HilogPlugin::TimeStringToNS(const char* data, struct timespec *tsTime)
const int bufSize = 128;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "HilogPlugin: get localtime failed!, errno(%d:%s)", errno, buf);
PROFILER_LOG_ERROR(LOG_CORE, "HilogPlugin: get localtime failed!, errno(%d:%s)", errno, buf);
return false;
}
tmTime.tm_year = result.tm_year;
@ -415,7 +416,7 @@ bool HilogPlugin::TimeStringToNS(const char* data, struct timespec *tsTime)
pTmp = const_cast<char*>(data) + TIME_HOUR_WIDTH;
CHECK_TRUE(StringToL(pTmp, fixHour), false, "%s:strtol fixHour failed", __func__);
if (static_cast<int>(fixHour) != tmTime.tm_hour) { // hours since midnight - [0, 23]
HILOG_INFO(LOG_CORE, "HilogPlugin: hour(%d) <==> fix hour(%ld)!", tmTime.tm_hour, fixHour);
PROFILER_LOG_INFO(LOG_CORE, "HilogPlugin: hour(%d) <==> fix hour(%ld)!", tmTime.tm_hour, fixHour);
tmTime.tm_hour = fixHour;
}
pTmp = const_cast<char*>(data) + TIME_SEC_WIDTH;
@ -429,7 +430,7 @@ bool HilogPlugin::TimeStringToNS(const char* data, struct timespec *tsTime)
char buff[TIME_BUFF_LEN] = {0};
if (snprintf_s(buff, sizeof(buff), sizeof(buff) - 1, "%ld.%09u\n", timetTime, nsec) < 0) {
HILOG_ERROR(LOG_CORE, "%s:snprintf_s error", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s:snprintf_s error", __func__);
}
size_t buffSize = strlen(buff);
for (size_t i = 0; i < buffSize && protoConfig_.need_record(); i++) {
@ -453,13 +454,13 @@ int HilogPlugin::GetDateTime(char* psDateTime, uint32_t size)
const int bufSize = 128;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "HilogPlugin: get localtime failed!, errno(%d:%s)", errno, buf);
PROFILER_LOG_ERROR(LOG_CORE, "HilogPlugin: get localtime failed!, errno(%d:%s)", errno, buf);
return -1;
}
if (snprintf_s(psDateTime, size, size - 1, "%04d%02d%02d%02d%02d%02d", pTM->tm_year + BASE_YEAR, pTM->tm_mon + 1,
pTM->tm_mday, pTM->tm_hour, pTM->tm_min, pTM->tm_sec) < 0) {
HILOG_ERROR(LOG_CORE, "%s:snprintf_s error", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s:snprintf_s error", __func__);
}
return 0;

View File

@ -82,12 +82,12 @@ bool PluginStart(HilogPlugin& plugin, HilogConfig& config)
std::vector<uint8_t> configData(size);
int ret = config.SerializeToArray(configData.data(), configData.size());
CHECK_TRUE(ret > 0, false, "HilogPluginTest: SerializeToArray fail!!!");
HILOG_INFO(LOG_CORE, "HilogPluginTest: SerializeToArray success");
PROFILER_LOG_INFO(LOG_CORE, "HilogPluginTest: SerializeToArray success");
// start
ret = plugin.Start(configData.data(), configData.size());
CHECK_TRUE(ret == 0, false, "HilogPluginTest: start plugin fail!!!");
HILOG_INFO(LOG_CORE, "HilogPluginTest: Start success");
PROFILER_LOG_INFO(LOG_CORE, "HilogPluginTest: Start success");
return true;
}
@ -101,7 +101,7 @@ bool RecordFileExist(std::string& file)
nSeconds = time(nullptr);
pTM = localtime(&nSeconds);
if (snprintf_s(name, sizeof(name), sizeof(name) - 1, "%04d", pTM->tm_year + BASE_YEAR) < 0) {
HILOG_ERROR(LOG_CORE, "%s:snprintf_s error", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s:snprintf_s error", __func__);
}
if (access(DEFAULT_RECORD_FILE.c_str(), F_OK) != 0) {
return false;
@ -111,7 +111,7 @@ bool RecordFileExist(std::string& file)
char buff[BUF_MAX_LEN] = {0};
std::unique_ptr<FILE, int (*)(FILE*)> fp(popen(cmd.c_str(), "r"), pclose);
if (!fp) {
HILOG_ERROR(LOG_CORE, "%s:: popen error", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s:: popen error", __func__);
return false;
}
@ -132,7 +132,7 @@ uint64_t GetSec(HilogPlugin& plugin, const char* data)
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "GetSec: get time failed!, errno(%d:%s)", errno, buf);
PROFILER_LOG_ERROR(LOG_CORE, "GetSec: get time failed!, errno(%d:%s)", errno, buf);
return 0;
}
@ -141,7 +141,7 @@ uint64_t GetSec(HilogPlugin& plugin, const char* data)
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "GetSec: get localtime failed!, errno(%d:%s)", errno, buf);
PROFILER_LOG_ERROR(LOG_CORE, "GetSec: get localtime failed!, errno(%d:%s)", errno, buf);
return 0;
}
@ -152,7 +152,7 @@ uint64_t GetSec(HilogPlugin& plugin, const char* data)
long fixHour;
CHECK_TRUE(plugin.StringToL(pTmp, fixHour), 0, "%s:strtol fixHour failed", __func__);
if (static_cast<int>(fixHour) != tmTime.tm_hour) { // hours since midnight - [0, 23]
HILOG_INFO(LOG_CORE, "GetSec: hour(%d) <==> fix hour(%ld)!", tmTime.tm_hour, fixHour);
PROFILER_LOG_INFO(LOG_CORE, "GetSec: hour(%d) <==> fix hour(%ld)!", tmTime.tm_hour, fixHour);
tmTime.tm_hour = fixHour;
}

View File

@ -84,7 +84,7 @@ bool ParseConfigToCmd(const HiperfPluginConfig& config, std::vector<std::string>
bool RunCommand(const std::string& cmd)
{
HILOG_INFO(LOG_CORE, "run command: %s", cmd.c_str());
PROFILER_LOG_INFO(LOG_CORE, "run command: %s", cmd.c_str());
bool res = false;
std::vector<std::string> cmdArg;
COMMON::SplitString(cmd, " ", cmdArg);
@ -106,7 +106,7 @@ bool RunCommand(const std::string& cmd)
}
}
COMMON::CustomPclose(fp, pipeFds, childPid);
HILOG_INFO(LOG_CORE, "run command result: %s", result.c_str());
PROFILER_LOG_INFO(LOG_CORE, "run command result: %s", result.c_str());
CHECK_TRUE(res, false, "HiperfPlugin::RunCommand: execute command FAILED!");
return true;
}
@ -169,7 +169,7 @@ int HiperfPluginSessionStop(void)
int HiperfRegisterWriterStruct(const WriterStruct* writer)
{
HILOG_INFO(LOG_CORE, "%s:writer", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:writer", __func__);
return 0;
}

View File

@ -37,28 +37,28 @@ HisyseventPlugin::HisyseventPlugin() : fp_(nullptr, nullptr) {}
HisyseventPlugin::~HisyseventPlugin()
{
HILOG_INFO(LOG_CORE, "BEGN %s: ready!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "BEGN %s: ready!", __func__);
Stop();
HILOG_INFO(LOG_CORE, "END %s: success!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "END %s: success!", __func__);
}
int HisyseventPlugin::SetWriter(WriterStruct* writer)
{
resultWriter_ = writer;
HILOG_INFO(LOG_CORE, "END %s: success!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "END %s: success!", __func__);
return 0;
}
int HisyseventPlugin::Start(const uint8_t* configData, uint32_t configSize)
{
HILOG_INFO(LOG_CORE, "BEGN %s: ready!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "BEGN %s: ready!", __func__);
CHECK_NOTNULL(configData, -1, "NOTE %s: param invalid", __func__);
CHECK_TRUE(protoConfig_.ParseFromArray(configData, configSize) > 0, -1,
"NOTE HisyseventPlugin: ParseFromArray failed");
HILOG_DEBUG(LOG_CORE, "config sourse data:%s domain:%s event:%s", protoConfig_.msg().c_str(),
PROFILER_LOG_DEBUG(LOG_CORE, "config sourse data:%s domain:%s event:%s", protoConfig_.msg().c_str(),
protoConfig_.subscribe_domain().c_str(), protoConfig_.subscribe_event().c_str());
CHECK_TRUE(InitHisyseventCmd(), -1, "HisyseventPlugin: Init HisyseventCmd failed");
@ -76,13 +76,13 @@ int HisyseventPlugin::Start(const uint8_t* configData, uint32_t configSize)
running_ = true;
workThread_ = std::thread(&HisyseventPlugin::Run, this);
HILOG_INFO(LOG_CORE, "END %s: success!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "END %s: success!", __func__);
return 0;
}
int HisyseventPlugin::Stop()
{
HILOG_INFO(LOG_CORE, "BEGN %s: ready!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "BEGN %s: ready!", __func__);
running_ = false;
COMMON::CustomPUnblock(pipeFds_);
@ -94,20 +94,21 @@ int HisyseventPlugin::Stop()
fp_.reset();
}
HILOG_INFO(LOG_CORE, "END %s: success!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "END %s: success!", __func__);
return 0;
}
void HisyseventPlugin::Run(void)
{
HILOG_INFO(LOG_CORE, "BEGN %s: ready!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "BEGN %s: ready!", __func__);
std::unique_ptr<uint8_t[]> buffer = std::make_unique<uint8_t[]>(MAX_STRING_LEN);
HILOG_INFO(LOG_CORE, "NOTE hisysevent_plugin_result.proto->HisyseventInfo:dataProto;Ready to output the result!");
PROFILER_LOG_INFO(LOG_CORE,
"NOTE hisysevent_plugin_result.proto->HisyseventInfo:dataProto;Ready to output the result!");
fcntl(fileno(fp_.get()), F_SETPIPE_SZ, PIPE_SIZE);
int aPipeSize = fcntl(fileno(fp_.get()), F_GETPIPE_SZ);
HILOG_INFO(LOG_CORE, "{fp = %d, aPipeSize=%d, PIPE_SIZE=%d}", fileno(fp_.get()), aPipeSize, PIPE_SIZE);
PROFILER_LOG_INFO(LOG_CORE, "{fp = %d, aPipeSize=%d, PIPE_SIZE=%d}", fileno(fp_.get()), aPipeSize, PIPE_SIZE);
std::unique_ptr<HisyseventInfo> dataProto = nullptr;
std::unique_ptr<ProtoEncoder::HisyseventInfo> hisyseventInfo = nullptr;
@ -153,7 +154,7 @@ void HisyseventPlugin::Run(void)
hisyseventInfo.reset();
}
HILOG_INFO(LOG_CORE, "END %s: success!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "END %s: success!", __func__);
}
std::string HisyseventPlugin::GetFullCmd()
@ -172,9 +173,9 @@ std::string HisyseventPlugin::GetFullCmd()
inline bool HisyseventPlugin::InitHisyseventCmd()
{
HILOG_INFO(LOG_CORE, "BEGN %s: ready!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "BEGN %s: ready!", __func__);
if (!fullCmd_.empty()) {
HILOG_INFO(LOG_CORE, "fullCmd_ is dirty.Then clear().");
PROFILER_LOG_INFO(LOG_CORE, "fullCmd_ is dirty.Then clear().");
fullCmd_.clear();
}
@ -190,7 +191,7 @@ inline bool HisyseventPlugin::InitHisyseventCmd()
fullCmd_.emplace_back("-n");
fullCmd_.emplace_back(protoConfig_.subscribe_event());
}
HILOG_INFO(LOG_CORE, "END %s: success!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "END %s: success!", __func__);
return true;
}
@ -205,7 +206,7 @@ inline bool HisyseventPlugin::ParseSyseventLineInfo(const char* data, size_t len
info->set_context(data, strlen(data) - 1); // - \n
id_++;
} else {
HILOG_ERROR(LOG_CORE, "NOTE HisyseventPlugin: hisysevent context include invalid UTF-8 data");
PROFILER_LOG_ERROR(LOG_CORE, "NOTE HisyseventPlugin: hisysevent context include invalid UTF-8 data");
return false;
}

View File

@ -78,12 +78,12 @@ bool PluginStart(HisyseventPlugin& plugin, HisyseventConfig& config)
std::vector<uint8_t> configData(size);
int ret = config.SerializeToArray(configData.data(), configData.size());
CHECK_TRUE(ret > 0, false, "HisyseventPluginTest: SerializeToArray fail!!!");
HILOG_INFO(LOG_CORE, "HisyseventPluginTest: SerializeToArray success");
PROFILER_LOG_INFO(LOG_CORE, "HisyseventPluginTest: SerializeToArray success");
// start
ret = plugin.Start(configData.data(), configData.size());
CHECK_TRUE(ret == 0, false, "HisyseventPluginTest: start plugin fail!!!");
HILOG_INFO(LOG_CORE, "HisyseventPluginTest: Start success");
PROFILER_LOG_INFO(LOG_CORE, "HisyseventPluginTest: Start success");
return true;
}

View File

@ -62,7 +62,7 @@ MemoryDataPlugin::MemoryDataPlugin()
MemoryDataPlugin::~MemoryDataPlugin()
{
HILOG_INFO(LOG_CORE, "%s:~MemoryDataPlugin!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:~MemoryDataPlugin!", __func__);
buffer_ = nullptr;
@ -120,7 +120,7 @@ int MemoryDataPlugin::InitMemVmemFd()
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "%s:realpath failed, errno(%d:%s)", __func__, errno, buf);
PROFILER_LOG_ERROR(LOG_CORE, "%s:realpath failed, errno(%d:%s)", __func__, errno, buf);
return RET_FAIL;
}
meminfoFd_ = open(realPath, O_RDONLY | O_CLOEXEC);
@ -128,7 +128,7 @@ int MemoryDataPlugin::InitMemVmemFd()
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "%s:open failed, fileName, errno(%d:%s)", __func__, errno, buf);
PROFILER_LOG_ERROR(LOG_CORE, "%s:open failed, fileName, errno(%d:%s)", __func__, errno, buf);
return RET_FAIL;
}
}
@ -142,7 +142,7 @@ int MemoryDataPlugin::InitMemVmemFd()
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "%s:realpath failed, errno(%d:%s)", __func__, errno, buf);
PROFILER_LOG_ERROR(LOG_CORE, "%s:realpath failed, errno(%d:%s)", __func__, errno, buf);
return RET_FAIL;
}
vmstatFd_ = open(realPath, O_RDONLY | O_CLOEXEC);
@ -150,7 +150,7 @@ int MemoryDataPlugin::InitMemVmemFd()
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "%s:failed to open(/proc/vmstat), errno(%d:%s)", __func__, errno, buf);
PROFILER_LOG_ERROR(LOG_CORE, "%s:failed to open(/proc/vmstat), errno(%d:%s)", __func__, errno, buf);
return RET_FAIL;
}
}
@ -196,7 +196,7 @@ int MemoryDataPlugin::Start(const uint8_t* configData, uint32_t configSize)
}
}
HILOG_INFO(LOG_CORE, "%s:start success!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:start success!", __func__);
return RET_SUCC;
}
@ -318,7 +318,7 @@ template <typename T> bool MemoryDataPlugin::GetMemInfoByMemoryService(uint32_t
size_t ret = fread(buffer.get(), 1, BUF_MAX_LEN, fp.get());
if (ret == 0) {
HILOG_ERROR(LOG_CORE, "%s:fread failed", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s:fread failed", __func__);
}
buffer.get()[BUF_MAX_LEN - 1] = '\0';
@ -422,7 +422,7 @@ int MemoryDataPlugin::Stop()
}
}
}
HILOG_INFO(LOG_CORE, "%s:stop success!", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:stop success!", __func__);
return 0;
}
@ -453,7 +453,7 @@ int32_t MemoryDataPlugin::ReadFile(int fd)
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "%s:failed to read(%d), errno(%d:%s)", __func__, fd, errno, buf);
PROFILER_LOG_ERROR(LOG_CORE, "%s:failed to read(%d), errno(%d:%s)", __func__, fd, errno, buf);
err_ = errno;
return RET_FAIL;
}
@ -470,7 +470,7 @@ std::string MemoryDataPlugin::ReadFile(const std::string& path)
const int maxSize = 256;
char buf[maxSize] = { 0 };
strerror_r(errno, buf, maxSize);
HILOG_WARN(LOG_CORE, "open file %s FAILED: %s!", path.c_str(), buf);
PROFILER_LOG_WARN(LOG_CORE, "open file %s FAILED: %s!", path.c_str(), buf);
return "";
}
@ -501,20 +501,20 @@ std::vector<int> MemoryDataPlugin::OpenProcPidFiles(int32_t pid)
for (int i = 0; i < count; i++) {
if (snprintf_s(fileName, sizeof(fileName), sizeof(fileName) - 1,
"%s/%d/%s", testpath_, pid, procfdMapping[i].file) < 0) {
HILOG_ERROR(LOG_CORE, "%s:snprintf_s error", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s:snprintf_s error", __func__);
}
if (realpath(fileName, realPath) == nullptr) {
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "%s:realpath failed, errno(%d:%s)", __func__, errno, buf);
PROFILER_LOG_ERROR(LOG_CORE, "%s:realpath failed, errno(%d:%s)", __func__, errno, buf);
}
int fd = open(realPath, O_RDONLY | O_CLOEXEC);
if (fd == -1) {
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "%s:failed to open(%s), errno(%d:%s)", __func__, fileName, errno, buf);
PROFILER_LOG_ERROR(LOG_CORE, "%s:failed to open(%s), errno(%d:%s)", __func__, fileName, errno, buf);
}
profds.emplace(profds.begin() + i, fd);
}
@ -530,7 +530,7 @@ DIR* MemoryDataPlugin::OpenDestDir(const char* dirPath)
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "%s:failed to opendir(%s), errno(%d:%s)", __func__, dirPath, errno, buf);
PROFILER_LOG_ERROR(LOG_CORE, "%s:failed to opendir(%s), errno(%d:%s)", __func__, dirPath, errno, buf);
}
return destDir;
@ -564,7 +564,7 @@ int32_t MemoryDataPlugin::ReadProcPidFile(int32_t pid, const char* pFileName)
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "%s:realpath failed, errno(%d:%s)", __func__, errno, buf);
PROFILER_LOG_ERROR(LOG_CORE, "%s:realpath failed, errno(%d:%s)", __func__, errno, buf);
return RET_FAIL;
}
fd = open(realPath, O_RDONLY | O_CLOEXEC);
@ -572,12 +572,12 @@ int32_t MemoryDataPlugin::ReadProcPidFile(int32_t pid, const char* pFileName)
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_INFO(LOG_CORE, "%s:failed to open(%s), errno(%d:%s)", __func__, fileName, errno, buf);
PROFILER_LOG_INFO(LOG_CORE, "%s:failed to open(%s), errno(%d:%s)", __func__, fileName, errno, buf);
err_ = errno;
return RET_FAIL;
}
if (buffer_.get() == nullptr) {
HILOG_INFO(LOG_CORE, "%s:empty address, buffer_ is NULL", __func__);
PROFILER_LOG_INFO(LOG_CORE, "%s:empty address, buffer_ is NULL", __func__);
err_ = RET_NULL_ADDR;
close(fd);
return RET_FAIL;
@ -588,7 +588,7 @@ int32_t MemoryDataPlugin::ReadProcPidFile(int32_t pid, const char* pFileName)
const int bufSize = 256;
char buf[bufSize] = { 0 };
strerror_r(errno, buf, bufSize);
HILOG_INFO(LOG_CORE, "%s:failed to read(%s), errno(%d:%s)", __func__, fileName, errno, buf);
PROFILER_LOG_INFO(LOG_CORE, "%s:failed to read(%s), errno(%d:%s)", __func__, fileName, errno, buf);
err_ = errno;
return RET_FAIL;
}
@ -652,7 +652,7 @@ template <typename T> void MemoryDataPlugin::SetProcessInfo(T& processMemoryInfo
uint64_t value;
if ((key >= PRO_TGID && key <= PRO_PURGPIN && key != PRO_NAME) && !StringToUll(word, value)) {
HILOG_ERROR(LOG_CORE, "MemoryDataPlugin:%s, strtoull failed, key(%d), word(%s)", __func__, key, word);
PROFILER_LOG_ERROR(LOG_CORE, "MemoryDataPlugin:%s, strtoull failed, key(%d), word(%s)", __func__, key, word);
return;
}
@ -733,7 +733,7 @@ template <typename T> void MemoryDataPlugin::WriteOomInfo(T& processMemoryInfo,
return;
}
if (buffer_.get() == nullptr) {
HILOG_ERROR(LOG_CORE, "%s:invalid params, read buffer_ is NULL", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s:invalid params, read buffer_ is NULL", __func__);
return;
}
processMemoryInfo.set_oom_score_adj(static_cast<int64_t>(strtol(reinterpret_cast<char*>(buffer_.get()),
@ -836,7 +836,7 @@ template <typename T> void MemoryDataPlugin::WriteAshmemInfo(T& dataProto)
std::string file = path + "/purgeable_ashmem_trigger";
std::ifstream input(file, std::ios::in);
if (input.fail()) {
HILOG_ERROR(LOG_CORE, "%s:open %s failed, errno = %d", __func__, file.c_str(), errno);
PROFILER_LOG_ERROR(LOG_CORE, "%s:open %s failed, errno = %d", __func__, file.c_str(), errno);
return;
}
@ -927,7 +927,7 @@ template <typename T> void MemoryDataPlugin::WriteDmaInfo(T& dataProto)
std::string file = std::string(testpath_) + "/process_dmabuf_info";
std::ifstream input(file, std::ios::in);
if (input.fail()) {
HILOG_ERROR(LOG_CORE, "%s:open %s failed, errno = %d", __func__, file.c_str(), errno);
PROFILER_LOG_ERROR(LOG_CORE, "%s:open %s failed, errno = %d", __func__, file.c_str(), errno);
return;
}
@ -996,7 +996,7 @@ template <typename T> void MemoryDataPlugin::WriteGpuMemInfo(T& dataProto)
std::string file = path + "/gpu_memory";
std::ifstream input(file, std::ios::in);
if (input.fail()) {
HILOG_ERROR(LOG_CORE, "%s:open %s failed, errno = %d", __func__, file.c_str(), errno);
PROFILER_LOG_ERROR(LOG_CORE, "%s:open %s failed, errno = %d", __func__, file.c_str(), errno);
return;
}
@ -1042,7 +1042,7 @@ std::string MemoryDataPlugin::RunCommand(const std::string& cmd)
std::string ret = "";
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd.c_str(), "r"), pclose);
if (!pipe) {
HILOG_ERROR(LOG_CORE, "%s:popen(%s) error", __func__, cmd.c_str());
PROFILER_LOG_ERROR(LOG_CORE, "%s:popen(%s) error", __func__, cmd.c_str());
return ret;
}
@ -1239,7 +1239,7 @@ bool MemoryDataPlugin::GetRenderServiceGlSize(int32_t pid, GraphicsMemory& graph
bool ret = false;
sptr<IMemoryTrackerInterface> memtrack = IMemoryTrackerInterface::Get(true);
if (memtrack == nullptr) {
HILOG_ERROR(LOG_CORE, "%s: get IMemoryTrackerInterface failed", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s: get IMemoryTrackerInterface failed", __func__);
return ret;
}
@ -1373,7 +1373,7 @@ template <typename T> void MemoryDataPlugin::WriteProfileMemInfo(T& dataProto)
std::ifstream input(file, std::ios::in);
if (input.fail()) {
HILOG_ERROR(LOG_CORE, "%s:open %s failed, errno = %d", __func__, file.c_str(), errno);
PROFILER_LOG_ERROR(LOG_CORE, "%s:open %s failed, errno = %d", __func__, file.c_str(), errno);
return;
}

View File

@ -34,7 +34,7 @@ int main(int agrc, char* agrv[])
for (int i = 1; i < agrc; i++) {
size = atoi(agrv[i]);
if (size <= 0) {
HILOG_INFO(LOG_CORE, "ready malloc size(%zu)Mb invalid", size);
PROFILER_LOG_INFO(LOG_CORE, "ready malloc size(%zu)Mb invalid", size);
continue;
}
buf = (char *)malloc(size * MB_PER_BYTE);
@ -42,7 +42,7 @@ int main(int agrc, char* agrv[])
const int bufferSize = 256;
char buffer[bufferSize] = { 0 };
strerror_r(errno, buffer, bufferSize);
HILOG_ERROR(LOG_CORE, "malloc %zu fail, err(%s:%d)", size, buffer, errno);
PROFILER_LOG_ERROR(LOG_CORE, "malloc %zu fail, err(%s:%d)", size, buffer, errno);
continue;
}
cache.emplace(cache.begin() + i - 1, buf);

View File

@ -366,17 +366,17 @@ int GetPid(const std::string processName)
{
int pid = -1;
std::string findpid = "pidof " + processName;
HILOG_INFO(LOG_CORE, "find pid command : %s", findpid.c_str());
PROFILER_LOG_INFO(LOG_CORE, "find pid command : %s", findpid.c_str());
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(findpid.c_str(), "r"), pclose);
char line[LINE_SIZE];
do {
if (fgets(line, sizeof(line), pipe.get()) == nullptr) {
HILOG_INFO(LOG_CORE, "not find processName : %s", processName.c_str());
PROFILER_LOG_INFO(LOG_CORE, "not find processName : %s", processName.c_str());
return pid;
} else if (strlen(line) > 0 && isdigit(static_cast<unsigned char>(line[0]))) {
pid = atoi(line);
HILOG_INFO(LOG_CORE, "find processName : %s, pid: %d", processName.c_str(), pid);
PROFILER_LOG_INFO(LOG_CORE, "find processName : %s, pid: %d", processName.c_str(), pid);
break;
}
} while (1);
@ -862,7 +862,7 @@ void OutputData(uint8_t* data, uint32_t size)
MemoryData memoryData;
int ret = memoryData.ParseFromArray(data, size);
if (ret <= 0) {
HILOG_ERROR(LOG_CORE, "MemoryDataPluginTest, %s:parseFromArray failed!", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "MemoryDataPluginTest, %s:parseFromArray failed!", __func__);
return;
}
@ -906,7 +906,7 @@ HWTEST_F(MemoryDataPluginTest, TestProcessTreeRunTime, TestSize.Level1)
gettimeofday(&end, nullptr);
clock_t clockend = clock();
int timeuse = US_PER_S * (end.tv_sec - start.tv_sec) + end.tv_usec - start.tv_usec;
HILOG_INFO(LOG_CORE, "clock time=%.3fs, timeofday=%.3fs", (double)(clockend - clockstart) / CLOCKS_PER_SEC,
PROFILER_LOG_INFO(LOG_CORE, "clock time=%.3fs, timeofday=%.3fs", (double)(clockend - clockstart) / CLOCKS_PER_SEC,
(double)timeuse / US_PER_S);
EXPECT_EQ(plugin->callbacks->onPluginSessionStop(), 0);
}

View File

@ -109,7 +109,7 @@ private:
DebugLevel GetLogLevelByTag(const std::string &) const;
const std::string GetLogLevelName(DebugLevel) const;
int HiLog(std::string &buffer) const;
void HiLog(std::string &buffer) const;
static std::unique_ptr<DebugLogger> logInstance_;
std::string logFileBuffer_;

View File

@ -34,62 +34,9 @@
#ifndef CONFIG_NO_HILOG
#include "hilog/log.h"
#ifdef HIPERF_HILOGF
#undef HIPERF_HILOGF
#endif
#ifdef HIPERF_HILOGE
#undef HIPERF_HILOGE
#endif
#ifdef HIPERF_HILOGW
#undef HIPERF_HILOGW
#endif
#ifdef HIPERF_HILOGI
#undef HIPERF_HILOGI
#endif
#ifdef HIPERF_HILOGD
#undef HIPERF_HILOGD
#endif
// param of log interface, such as HIPERF_HILOGF.
enum HiperfModule {
MODULE_DEFAULT = 0,
MODULE_JS_NAPI,
MODULE_CPP_API,
};
static constexpr unsigned int BASE_HIPERF_DOMAIN_ID = 0xD000000;
static constexpr unsigned int HITRACE_TAG = 0xd03301;
static constexpr OHOS::HiviewDFX::HiLogLabel HIPERF_HILOG_LABLE[] = {
{LOG_CORE, HITRACE_TAG, "hiperf"},
{LOG_CORE, HITRACE_TAG, "HiperfJSNAPI"},
{LOG_CORE, HITRACE_TAG, "HiperfCPPAPI"},
};
// In order to improve performance, do not check the module range
#define HIPERF_HILOGF(module, ...) \
(void)OHOS::HiviewDFX::HiLog::Fatal(HIPERF_HILOG_LABLE[module], FORMATED(__VA_ARGS__))
#define HIPERF_HILOGE(module, ...) \
(void)OHOS::HiviewDFX::HiLog::Error(HIPERF_HILOG_LABLE[module], FORMATED(__VA_ARGS__))
#define HIPERF_HILOGW(module, ...) \
(void)OHOS::HiviewDFX::HiLog::Warn(HIPERF_HILOG_LABLE[module], FORMATED(__VA_ARGS__))
#define HIPERF_HILOGI(module, ...) \
(void)OHOS::HiviewDFX::HiLog::Info(HIPERF_HILOG_LABLE[module], FORMATED(__VA_ARGS__))
#define HIPERF_HILOGD(module, ...) \
(void)OHOS::HiviewDFX::HiLog::Debug(HIPERF_HILOG_LABLE[module], FORMATED(__VA_ARGS__))
#else
#define HIPERF_HILOGF(module, ...) printf(FORMATED(__VA_ARGS__))
#define HIPERF_HILOGE(module, ...) printf(FORMATED(__VA_ARGS__))
#define HIPERF_HILOGW(module, ...) printf(FORMATED(__VA_ARGS__))
#define HIPERF_HILOGI(module, ...) printf(FORMATED(__VA_ARGS__))
#define HIPERF_HILOGD(module, ...) printf(FORMATED(__VA_ARGS__))
#endif // CONFIG_NO_HILOG
#endif // HIPERF_HILOG

View File

@ -30,7 +30,7 @@ int32_t NativeMemoryProfilerSaClientManager::Start(std::shared_ptr<NativeMemoryP
CHECK_TRUE(CheckConfig(config), RET_ERR, "CheckConfig failed");
auto service = GetRemoteService();
if (service == nullptr) {
HILOG_ERROR(LOG_CORE, "NativeMemoryProfilerSaClientManager: start GetRemoteService failed");
PROFILER_LOG_ERROR(LOG_CORE, "NativeMemoryProfilerSaClientManager: start GetRemoteService failed");
return RET_ERR;
}
NativeMemoryProfilerSaProxy proxy(service);
@ -41,7 +41,7 @@ int32_t NativeMemoryProfilerSaClientManager::Start(NativeMemProfilerType type, u
uint32_t sampleIntervel)
{
if (pid == 0) {
HILOG_ERROR(LOG_CORE, "NativeMemoryProfilerSaClientManager: pid cannot be 0");
PROFILER_LOG_ERROR(LOG_CORE, "NativeMemoryProfilerSaClientManager: pid cannot be 0");
return RET_ERR;
}
auto config = std::make_shared<NativeMemoryProfilerSaConfig>();
@ -62,7 +62,7 @@ int32_t NativeMemoryProfilerSaClientManager::Stop(uint32_t pid)
CHECK_TRUE(pid != 0, RET_ERR, "NativeMemoryProfilerSaClientManager: pid is 0");
auto service = GetRemoteService();
if (service == nullptr) {
HILOG_ERROR(LOG_CORE, "NativeMemoryProfilerSaClientManager: stop GetRemoteService failed");
PROFILER_LOG_ERROR(LOG_CORE, "NativeMemoryProfilerSaClientManager: stop GetRemoteService failed");
return RET_ERR;
}
NativeMemoryProfilerSaProxy proxy(service);
@ -74,7 +74,7 @@ int32_t NativeMemoryProfilerSaClientManager::Stop(const std::string& name)
CHECK_TRUE(!name.empty(), RET_ERR, "NativeMemoryProfilerSaClientManager: name is empty");
auto service = GetRemoteService();
if (service == nullptr) {
HILOG_ERROR(LOG_CORE, "NativeMemoryProfilerSaClientManager: stop GetRemoteService failed");
PROFILER_LOG_ERROR(LOG_CORE, "NativeMemoryProfilerSaClientManager: stop GetRemoteService failed");
return RET_ERR;
}
NativeMemoryProfilerSaProxy proxy(service);
@ -89,7 +89,7 @@ int32_t NativeMemoryProfilerSaClientManager::DumpData(uint32_t fd,
CHECK_TRUE(CheckConfig(config), RET_ERR, "CheckConfig failed");
auto service = GetRemoteService();
if (service == nullptr) {
HILOG_ERROR(LOG_CORE, "NativeMemoryProfilerSaClientManager: stop GetRemoteService failed");
PROFILER_LOG_ERROR(LOG_CORE, "NativeMemoryProfilerSaClientManager: stop GetRemoteService failed");
return RET_ERR;
}
NativeMemoryProfilerSaProxy proxy(service);
@ -109,7 +109,7 @@ bool NativeMemoryProfilerSaClientManager::CheckConfig(const std::shared_ptr<Nati
{
CHECK_NOTNULL(config, false, "NativeMemoryProfilerSaClientManager: config is nullptr");
if (config->duration_ == 0) {
HILOG_ERROR(LOG_CORE, "NativeMemoryProfilerSaClientManager: duration cannot be 0");
PROFILER_LOG_ERROR(LOG_CORE, "NativeMemoryProfilerSaClientManager: duration cannot be 0");
return false;
}
if (config->shareMemorySize_ == 0) {

View File

@ -84,18 +84,20 @@ bool NativeMemoryProfilerSaConfig::Unmarshalling(Parcel& parcel, std::shared_ptr
void NativeMemoryProfilerSaConfig::PrintConfig(std::shared_ptr<NativeMemoryProfilerSaConfig>& config)
{
HILOG_DEBUG(LOG_CORE, "pid: %d, filePath: %s, duration: %d, filterSize: %d, shareMemorySize: %d, processName: %s",
PROFILER_LOG_DEBUG(LOG_CORE,
"pid: %d, filePath: %s, duration: %d, filterSize: %d, shareMemorySize: %d, processName: %s",
config->pid_, config->filePath_.c_str(), config->duration_, config->filterSize_, config->shareMemorySize_,
config->processName_.c_str());
HILOG_DEBUG(LOG_CORE, "maxStackDepth: %d, mallocDisable: %d, mmapDisable: %d, freeStackData: %d," \
PROFILER_LOG_DEBUG(LOG_CORE, "maxStackDepth: %d, mallocDisable: %d, mmapDisable: %d, freeStackData: %d," \
"munmapStackData: %d",
config->maxStackDepth_, config->mallocDisable_, config->mmapDisable_, config->freeStackData_,
config->munmapStackData_);
HILOG_DEBUG(LOG_CORE, "mallocFreeMatchingInterval: %d, mallocFreeMatchingCnt: %d, stringCompressed: %d," \
PROFILER_LOG_DEBUG(LOG_CORE, "mallocFreeMatchingInterval: %d, mallocFreeMatchingCnt: %d, stringCompressed: %d," \
"fpUnwind: %d, blocked: %d, recordAccurately: %d",
config->mallocFreeMatchingInterval_, config->mallocFreeMatchingCnt_, config->stringCompressed_,
config->fpUnwind_, config->blocked_, config->recordAccurately_);
HILOG_DEBUG(LOG_CORE, "startupMode: %d, memtraceEnable: %d, offlineSymbolization: %d, callframeCompress: %d," \
PROFILER_LOG_DEBUG(LOG_CORE,
"startupMode: %d, memtraceEnable: %d, offlineSymbolization: %d, callframeCompress: %d," \
"statisticsInterval: %d, clockId: %d",
config->startupMode_, config->memtraceEnable_, config->offlineSymbolization_, config->callframeCompress_,
config->statisticsInterval_, config->clockId_);

View File

@ -22,6 +22,6 @@ NativeMemoryProfilerSaDeathRecipient::NativeMemoryProfilerSaDeathRecipient() {}
void NativeMemoryProfilerSaDeathRecipient::OnRemoteDied(const OHOS::wptr<OHOS::IRemoteObject> &object)
{
HILOG_ERROR(LOG_CORE, "NativeMemoryProfiler SA has died");
PROFILER_LOG_ERROR(LOG_CORE, "NativeMemoryProfiler SA has died");
}
} // namespace OHOS::Developtools::NativeDaemon

View File

@ -26,7 +26,7 @@ int32_t NativeMemoryProfilerSaProxy::Start(std::shared_ptr<NativeMemoryProfilerS
{
MessageParcel data;
if (!data.WriteInterfaceToken(NativeMemoryProfilerSaProxy::GetDescriptor())) {
HILOG_ERROR(LOG_CORE, "Start failed to write descriptor");
PROFILER_LOG_ERROR(LOG_CORE, "Start failed to write descriptor");
return RET_ERR;
}
CHECK_TRUE(config->Marshalling(data), RET_ERR, "NativeMemoryProfilerSaConfig marshalling failed");
@ -38,7 +38,7 @@ int32_t NativeMemoryProfilerSaProxy::Start(std::shared_ptr<NativeMemoryProfilerS
int32_t ret = remote->SendRequest(static_cast<uint32_t>(NativeMemoryProfilerSaInterfaceCode::START),
data, reply, option);
if (ret != RET_OK) {
HILOG_ERROR(LOG_CORE, "Start failed");
PROFILER_LOG_ERROR(LOG_CORE, "Start failed");
return ret;
}
return RET_OK;
@ -48,11 +48,11 @@ int32_t NativeMemoryProfilerSaProxy::DumpData(uint32_t fd, std::shared_ptr<Nativ
{
MessageParcel data;
if (!data.WriteInterfaceToken(NativeMemoryProfilerSaProxy::GetDescriptor())) {
HILOG_ERROR(LOG_CORE, "DumpData failed to write descriptor");
PROFILER_LOG_ERROR(LOG_CORE, "DumpData failed to write descriptor");
return RET_ERR;
}
if (!data.WriteFileDescriptor(fd)) {
HILOG_ERROR(LOG_CORE, "DumpData failed to write fd");
PROFILER_LOG_ERROR(LOG_CORE, "DumpData failed to write fd");
return RET_ERR;
}
CHECK_TRUE(config->Marshalling(data), RET_ERR, "NativeMemoryProfilerSaConfig marshalling failed");
@ -64,7 +64,7 @@ int32_t NativeMemoryProfilerSaProxy::DumpData(uint32_t fd, std::shared_ptr<Nativ
int32_t ret = remote->SendRequest(static_cast<uint32_t>(NativeMemoryProfilerSaInterfaceCode::DUMP_DATA),
data, reply, option);
if (ret != RET_OK) {
HILOG_ERROR(LOG_CORE, "DumpData failed");
PROFILER_LOG_ERROR(LOG_CORE, "DumpData failed");
return ret;
}
return RET_OK;
@ -74,7 +74,7 @@ int32_t NativeMemoryProfilerSaProxy::Stop(uint32_t pid)
{
MessageParcel data;
if (!data.WriteInterfaceToken(NativeMemoryProfilerSaProxy::GetDescriptor())) {
HILOG_ERROR(LOG_CORE, "Stop failed to write descriptor");
PROFILER_LOG_ERROR(LOG_CORE, "Stop failed to write descriptor");
return RET_ERR;
}
WRITEUINT32(data, pid, RET_ERR);
@ -85,7 +85,7 @@ int32_t NativeMemoryProfilerSaProxy::Stop(uint32_t pid)
int32_t ret = remote->SendRequest(static_cast<uint32_t>(NativeMemoryProfilerSaInterfaceCode::STOP_HOOK_PID),
data, reply, option);
if (ret != RET_OK) {
HILOG_ERROR(LOG_CORE, "Stop failed");
PROFILER_LOG_ERROR(LOG_CORE, "Stop failed");
return ret;
}
return RET_OK;
@ -95,7 +95,7 @@ int32_t NativeMemoryProfilerSaProxy::Stop(const std::string& name)
{
MessageParcel data;
if (!data.WriteInterfaceToken(NativeMemoryProfilerSaProxy::GetDescriptor())) {
HILOG_ERROR(LOG_CORE, "Stop failed to write descriptor");
PROFILER_LOG_ERROR(LOG_CORE, "Stop failed to write descriptor");
return RET_ERR;
}
WRITESTRING(data, name, RET_ERR);
@ -106,7 +106,7 @@ int32_t NativeMemoryProfilerSaProxy::Stop(const std::string& name)
int32_t ret = remote->SendRequest(static_cast<uint32_t>(NativeMemoryProfilerSaInterfaceCode::STOP_HOOK_NAME),
data, reply, option);
if (ret != RET_OK) {
HILOG_ERROR(LOG_CORE, "Stop failed");
PROFILER_LOG_ERROR(LOG_CORE, "Stop failed");
return ret;
}
return RET_OK;

View File

@ -37,7 +37,7 @@ NativeMemoryProfilerSaService::NativeMemoryProfilerSaService() : SystemAbility(N
serviceEntry_ = std::make_shared<ServiceEntry>();
if (!serviceEntry_->StartServer(DEFAULT_UNIX_SOCKET_HOOK_PATH)) {
serviceEntry_ = nullptr;
HILOG_ERROR(LOG_CORE, "Start IPC Service FAIL");
PROFILER_LOG_ERROR(LOG_CORE, "Start IPC Service FAIL");
return;
}
serviceEntry_->RegisterService(*this);
@ -57,7 +57,7 @@ bool NativeMemoryProfilerSaService::StartServiceAbility()
CHECK_NOTNULL(native, false, "native is nullptr");
int32_t result = serviceManager->AddSystemAbility(NATIVE_DAEMON_SYSTEM_ABILITY_ID, native);
if (result != 0) {
HILOG_ERROR(LOG_CORE, "Service native memory failed to start");
PROFILER_LOG_ERROR(LOG_CORE, "Service native memory failed to start");
return false;
}
@ -66,10 +66,10 @@ bool NativeMemoryProfilerSaService::StartServiceAbility()
bool ret = abilityObject->AddDeathRecipient(new NativeMemoryProfilerSaDeathRecipient());
if (ret == false) {
HILOG_ERROR(LOG_CORE, "AddDeathRecipient failed");
PROFILER_LOG_ERROR(LOG_CORE, "AddDeathRecipient failed");
return false;
}
HILOG_INFO(LOG_CORE, "Service native memory started successfully");
PROFILER_LOG_INFO(LOG_CORE, "Service native memory started successfully");
return true;
}
@ -111,7 +111,7 @@ void NativeMemoryProfilerSaService::StopHook(uint32_t pid, std::string name)
config = taskIter->second;
}
if (config == nullptr) {
HILOG_INFO(LOG_CORE, "NativeMemoryProfilerSaService: hook has stop, pid: %d, process name: %s",
PROFILER_LOG_INFO(LOG_CORE, "NativeMemoryProfilerSaService: hook has stop, pid: %d, process name: %s",
pid, name.c_str());
return;
}
@ -129,7 +129,7 @@ void NativeMemoryProfilerSaService::StopHook(uint32_t pid, std::string name)
close(config->fd);
}
if (--taskNum_ == 0) {
HILOG_INFO(LOG_CORE, "StringViewMemoryHold clear");
PROFILER_LOG_INFO(LOG_CORE, "StringViewMemoryHold clear");
StringViewMemoryHold::GetInstance().Clear();
}
}
@ -144,7 +144,7 @@ int32_t NativeMemoryProfilerSaService::StartHook(std::shared_ptr<NativeMemoryPro
std::string filePathStr = (config->pid_ > 0) ? std::to_string(config->pid_) : config->processName_;
config->filePath_ = FILE_PATH_HEAD + filePathStr + FILE_PATH_TAIL;
}
HILOG_INFO(LOG_CORE, "file path: %s", config->filePath_.c_str());
PROFILER_LOG_INFO(LOG_CORE, "file path: %s", config->filePath_.c_str());
if (!CheckConfig(config, fd)) {
return RET_ERR;
@ -175,7 +175,7 @@ int32_t NativeMemoryProfilerSaService::StartHook(std::shared_ptr<NativeMemoryPro
config->duration_ * TIME_BASE,
true);
if (timerFd == -1) {
HILOG_ERROR(LOG_CORE, "NativeMemoryProfilerSaService Start Schedule Task failed");
PROFILER_LOG_ERROR(LOG_CORE, "NativeMemoryProfilerSaService Start Schedule Task failed");
return RET_ERR;
}
@ -204,12 +204,12 @@ int32_t NativeMemoryProfilerSaService::StartHook(std::shared_ptr<NativeMemoryPro
bool NativeMemoryProfilerSaService::CheckConfig(std::shared_ptr<NativeMemoryProfilerSaConfig>& config, uint32_t fd)
{
if (taskNum_ + 1 > MAX_TASK_NUM) {
HILOG_INFO(LOG_CORE, "NativeMemoryProfilerSaService: Support up to 4 tasks at the same time");
PROFILER_LOG_INFO(LOG_CORE, "NativeMemoryProfilerSaService: Support up to 4 tasks at the same time");
return false;
}
if (hasStartupMode_ && config->startupMode_) {
HILOG_INFO(LOG_CORE, "NativeMemoryProfilerSaService: tasks with an existing startup mode, name: %s",
PROFILER_LOG_INFO(LOG_CORE, "NativeMemoryProfilerSaService: tasks with an existing startup mode, name: %s",
startupModeProcessName_.c_str());
return false;
}
@ -217,17 +217,17 @@ bool NativeMemoryProfilerSaService::CheckConfig(std::shared_ptr<NativeMemoryProf
if (config->pid_ > 0) {
config->processName_.clear();
if (pidCtx_.find(config->pid_) != pidCtx_.end()) {
HILOG_INFO(LOG_CORE, "NativeMemoryProfilerSaService: hook has started, pid: %d", config->pid_);
PROFILER_LOG_INFO(LOG_CORE, "NativeMemoryProfilerSaService: hook has started, pid: %d", config->pid_);
return false;
}
} else if (!config->processName_.empty()) {
if (nameAndFilePathCtx_.find(config->processName_) != nameAndFilePathCtx_.end()) {
HILOG_INFO(LOG_CORE, "NativeMemoryProfilerSaService: hook has started, process name: %s",
config->processName_.c_str());
PROFILER_LOG_INFO(LOG_CORE, "NativeMemoryProfilerSaService: hook has started, process name: %s",
config->processName_.c_str());
return false;
}
} else {
HILOG_ERROR(LOG_CORE, "The PID and process name are not configured");
PROFILER_LOG_ERROR(LOG_CORE, "The PID and process name are not configured");
return false;
}
@ -237,11 +237,12 @@ bool NativeMemoryProfilerSaService::CheckConfig(std::shared_ptr<NativeMemoryProf
if (!config->filePath_.empty()) {
if (nameAndFilePathCtx_.find(config->filePath_) != nameAndFilePathCtx_.end()) {
HILOG_ERROR(LOG_CORE, "NativeMemoryProfilerSaService: File %s is being used.", config->filePath_.c_str());
PROFILER_LOG_ERROR(LOG_CORE,
"NativeMemoryProfilerSaService: File %s is being used.", config->filePath_.c_str());
return false;
}
} else {
HILOG_ERROR(LOG_CORE, "The file path are not configured");
PROFILER_LOG_ERROR(LOG_CORE, "The file path are not configured");
return false;
}
return true;
@ -263,7 +264,7 @@ void NativeMemoryProfilerSaService::FillTaskConfigContext(int32_t pid, const std
hasStartupMode_ = false;
}
} else {
HILOG_ERROR(LOG_CORE, "NativeMemoryProfilerSaService: fill TaskConfig context failed");
PROFILER_LOG_ERROR(LOG_CORE, "NativeMemoryProfilerSaService: fill TaskConfig context failed");
}
}
@ -281,7 +282,7 @@ bool NativeMemoryProfilerSaService::ProtocolProc(SocketContext &context, uint32_
std::string filePath = "/proc/" + std::to_string(peerConfig) + "/cmdline";
std::string bundleName;
if (!LoadStringFromFile(filePath, bundleName)) {
HILOG_ERROR(LOG_CORE, "Get process name by pid failed!, pid: %d", peerConfig);
PROFILER_LOG_ERROR(LOG_CORE, "Get process name by pid failed!, pid: %d", peerConfig);
return false;
}
bundleName.resize(strlen(bundleName.c_str()));
@ -295,12 +296,13 @@ bool NativeMemoryProfilerSaService::ProtocolProc(SocketContext &context, uint32_
if (auto iter = pidCtx_.find(peerConfig); iter != pidCtx_.end()) {
auto [eventFd, smbFd] = iter->second->hookMgr->GetFds(peerConfig, bundleName);
if (eventFd == smbFd) {
HILOG_ERROR(LOG_CORE, "Get eventFd and smbFd failed!, name: %s, pid: %d", bundleName.c_str(), peerConfig);
PROFILER_LOG_ERROR(LOG_CORE,
"Get eventFd and smbFd failed!, name: %s, pid: %d", bundleName.c_str(), peerConfig);
return false;
}
HILOG_INFO(LOG_CORE,
"ProtocolProc, receive message from hook client, and send hook config to process %d, name: %s",
peerConfig, bundleName.c_str());
PROFILER_LOG_INFO(LOG_CORE,
"ProtocolProc, receive message from hook client, and send hook config to process %d, name: %s",
peerConfig, bundleName.c_str());
ClientConfig clientConfig;
iter->second->hookMgr->GetClientConfig(clientConfig);
context.SendHookConfig(reinterpret_cast<uint8_t *>(&clientConfig), sizeof(clientConfig));

View File

@ -26,7 +26,7 @@ int32_t NativeMemoryProfilerSaStub::OnRemoteRequest(uint32_t code, MessageParcel
{
std::u16string descriptor = data.ReadInterfaceToken();
if (descriptor != INativeMemoryProfilerSa::GetDescriptor()) {
HILOG_ERROR(LOG_CORE, "Get unexpect descriptor:%s", Str16ToStr8(descriptor).c_str());
PROFILER_LOG_ERROR(LOG_CORE, "Get unexpect descriptor:%s", Str16ToStr8(descriptor).c_str());
return ERR_INVALID_STATE;
}
@ -44,7 +44,7 @@ int32_t NativeMemoryProfilerSaStub::OnRemoteRequest(uint32_t code, MessageParcel
return StubDumpFile(data, reply);
}
default : {
HILOG_ERROR(LOG_CORE, "Unknown code:%u", code);
PROFILER_LOG_ERROR(LOG_CORE, "Unknown code:%u", code);
return IPCObjectStub::OnRemoteRequest(code, data, reply, options);
}
}

View File

@ -32,7 +32,7 @@ namespace OHOS::Developtools::NativeDaemon {
#define WRITEBOOL(parcel, data, ...) \
do { \
if (!(parcel).WriteBool(data)) { \
HILOG_ERROR(LOG_CORE, "WriteBool "#data" failed"); \
PROFILER_LOG_ERROR(LOG_CORE, "WriteBool "#data" failed"); \
return DEFRET(false, ##__VA_ARGS__); \
} \
} while (0)
@ -40,7 +40,7 @@ namespace OHOS::Developtools::NativeDaemon {
#define WRITEINT32(parcel, data, ...) \
do { \
if (!(parcel).WriteInt32(data)) { \
HILOG_ERROR(LOG_CORE, "WriteInt32 "#data" failed"); \
PROFILER_LOG_ERROR(LOG_CORE, "WriteInt32 "#data" failed"); \
return DEFRET(false, ##__VA_ARGS__); \
} \
} while (0)
@ -48,7 +48,7 @@ namespace OHOS::Developtools::NativeDaemon {
#define WRITEINT64(parcel, data, ...) \
do { \
if (!(parcel).WriteInt64(data)) { \
HILOG_ERROR(LOG_CORE, "WriteInt64 "#data" failed"); \
PROFILER_LOG_ERROR(LOG_CORE, "WriteInt64 "#data" failed"); \
return DEFRET(false, ##__VA_ARGS__); \
} \
} while (0)
@ -56,7 +56,7 @@ namespace OHOS::Developtools::NativeDaemon {
#define WRITEUINT8(parcel, data, ...) \
do { \
if (!(parcel).WriteUint8(data)) { \
HILOG_ERROR(LOG_CORE, "WriteUint8 "#data" failed"); \
PROFILER_LOG_ERROR(LOG_CORE, "WriteUint8 "#data" failed"); \
return DEFRET(false, ##__VA_ARGS__); \
} \
} while (0)
@ -64,7 +64,7 @@ namespace OHOS::Developtools::NativeDaemon {
#define WRITEUINT32(parcel, data, ...) \
do { \
if (!(parcel).WriteUint32(data)) { \
HILOG_ERROR(LOG_CORE, "WriteUint32 "#data" failed"); \
PROFILER_LOG_ERROR(LOG_CORE, "WriteUint32 "#data" failed"); \
return DEFRET(false, ##__VA_ARGS__); \
} \
} while (0)
@ -72,7 +72,7 @@ namespace OHOS::Developtools::NativeDaemon {
#define WRITEUINT64(parcel, data, ...) \
do { \
if (!(parcel).WriteUint64(data)) { \
HILOG_ERROR(LOG_CORE, "WriteUint64 "#data" failed"); \
PROFILER_LOG_ERROR(LOG_CORE, "WriteUint64 "#data" failed"); \
return DEFRET(false, ##__VA_ARGS__); \
} \
} while (0)
@ -80,7 +80,7 @@ namespace OHOS::Developtools::NativeDaemon {
#define WRITESTRING(parcel, data, ...) \
do { \
if (!(parcel).WriteString(data)) { \
HILOG_ERROR(LOG_CORE, "WriteString "#data" failed"); \
PROFILER_LOG_ERROR(LOG_CORE, "WriteString "#data" failed"); \
return DEFRET(false, ##__VA_ARGS__); \
} \
} while (0)
@ -88,7 +88,7 @@ namespace OHOS::Developtools::NativeDaemon {
#define READBOOL(parcel, data, ...) \
do { \
if (!(parcel).ReadBool(data)) { \
HILOG_ERROR(LOG_CORE, "ReadBool "#data" failed"); \
PROFILER_LOG_ERROR(LOG_CORE, "ReadBool "#data" failed"); \
return DEFRET(false, ##__VA_ARGS__); \
} \
} while (0)
@ -96,7 +96,7 @@ namespace OHOS::Developtools::NativeDaemon {
#define READINT32(parcel, data, ...) \
do { \
if (!(parcel).ReadInt32(data)) { \
HILOG_ERROR(LOG_CORE, "ReadInt32 "#data" failed"); \
PROFILER_LOG_ERROR(LOG_CORE, "ReadInt32 "#data" failed"); \
return DEFRET(false, ##__VA_ARGS__); \
} \
} while (0)
@ -104,7 +104,7 @@ namespace OHOS::Developtools::NativeDaemon {
#define READINT64(parcel, data, ...) \
do { \
if (!(parcel).ReadInt64(data)) { \
HILOG_ERROR(LOG_CORE, "ReadInt64 "#data" failed"); \
PROFILER_LOG_ERROR(LOG_CORE, "ReadInt64 "#data" failed"); \
return DEFRET(false, ##__VA_ARGS__); \
} \
} while (0)
@ -112,7 +112,7 @@ namespace OHOS::Developtools::NativeDaemon {
#define READUINT8(parcel, data, ...) \
do { \
if (!(parcel).ReadUint8(data)) { \
HILOG_ERROR(LOG_CORE, "ReadUint8 "#data" failed"); \
PROFILER_LOG_ERROR(LOG_CORE, "ReadUint8 "#data" failed"); \
return DEFRET(false, ##__VA_ARGS__); \
} \
} while (0)
@ -120,7 +120,7 @@ namespace OHOS::Developtools::NativeDaemon {
#define READUINT32(parcel, data, ...) \
do { \
if (!(parcel).ReadUint32(data)) { \
HILOG_ERROR(LOG_CORE, "ReadUint32 "#data" failed"); \
PROFILER_LOG_ERROR(LOG_CORE, "ReadUint32 "#data" failed"); \
return DEFRET(false, ##__VA_ARGS__); \
} \
} while (0)
@ -128,7 +128,7 @@ namespace OHOS::Developtools::NativeDaemon {
#define READUINT64(parcel, data, ...) \
do { \
if (!(parcel).ReadUint64(data)) { \
HILOG_ERROR(LOG_CORE, "ReadUint64 "#data" failed"); \
PROFILER_LOG_ERROR(LOG_CORE, "ReadUint64 "#data" failed"); \
return DEFRET(false, ##__VA_ARGS__); \
} \
} while (0)
@ -136,7 +136,7 @@ namespace OHOS::Developtools::NativeDaemon {
#define READSTRING(parcel, data, ...) \
do { \
if (!(parcel).ReadString(data)) { \
HILOG_ERROR(LOG_CORE, "ReadString "#data" failed"); \
PROFILER_LOG_ERROR(LOG_CORE, "ReadString "#data" failed"); \
return DEFRET(false, ##__VA_ARGS__); \
} \
} while (0)

View File

@ -67,14 +67,13 @@ void DebugLogger::Disable(bool disable)
#if is_ohos
#ifndef CONFIG_NO_HILOG
int DebugLogger::HiLog(std::string &buffer) const
void DebugLogger::HiLog(std::string &buffer) const
{
size_t lastLF = buffer.find_last_of('\n');
if (lastLF != std::string::npos) {
buffer.erase(lastLF, 1);
}
return OHOS::HiviewDFX::HiLog::Debug(HIPERF_HILOG_LABLE[MODULE_DEFAULT], "%{public}s",
buffer.c_str());
HILOG_DEBUG(LOG_CORE, "%{public}s", buffer.c_str());
}
#endif
#endif
@ -109,7 +108,7 @@ int DebugLogger::Log(DebugLevel level, const std::string &logTag, const char *fm
if (enableHilog_) {
#if is_ohos && !defined(CONFIG_NO_HILOG)
std::lock_guard<std::mutex> lock(logMutex_);
ret = HiLog(buffer); // to the hilog
HiLog(buffer); // to the hilog
#endif
} else if (file_ != nullptr) {
std::lock_guard<std::mutex> lock(logMutex_);

View File

@ -63,13 +63,13 @@ bool HookManager::CheckProcess()
pidPath = "/proc/" + std::to_string(pid) + "/status";
if (stat(pidPath.c_str(), &statBuf) != 0) {
// pid = 0;
HILOG_ERROR(LOG_CORE, "%s: hook process does not exist", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s: hook process does not exist", __func__);
return false;
} else {
auto [iter, isExist] = pidCache.emplace(pid);
if (isExist) {
hookCtx_.emplace_back(std::make_shared<HookManagerCtx>(pid));
HILOG_INFO(LOG_CORE, "hook context: pid: %d", pid);
PROFILER_LOG_INFO(LOG_CORE, "hook context: pid: %d", pid);
}
continue;
}
@ -82,12 +82,13 @@ bool HookManager::CheckProcess()
if (hookConfig_.response_library_mode()) {
if (hookCtx_.size() > RESPONSE_MAX_PID_COUNT) {
HILOG_ERROR(LOG_CORE, "%s: The maximum allowed is to set %d PIDs.", __func__, RESPONSE_MAX_PID_COUNT);
PROFILER_LOG_ERROR(LOG_CORE, "%s: The maximum allowed is to set %d PIDs.",
__func__, RESPONSE_MAX_PID_COUNT);
return false;
}
} else {
if (hookCtx_.size() > MAX_PID_COUNT) {
HILOG_ERROR(LOG_CORE, "%s: The maximum allowed is to set %d PIDs.", __func__, MAX_PID_COUNT);
PROFILER_LOG_ERROR(LOG_CORE, "%s: The maximum allowed is to set %d PIDs.", __func__, MAX_PID_COUNT);
return false;
}
}
@ -100,18 +101,19 @@ bool HookManager::CheckProcessName()
const std::string processName = hookConfig_.process_name();
bool isExist = COMMON::IsProcessExist(processName, pidValue);
if (hookConfig_.startup_mode() || !isExist) {
HILOG_INFO(LOG_CORE, "Wait process %s start or restart, set param", hookConfig_.process_name().c_str());
PROFILER_LOG_INFO(LOG_CORE, "Wait process %s start or restart, set param", hookConfig_.process_name().c_str());
std::string cmd = STARTUP + hookConfig_.process_name();
int ret = SystemSetParameter(PARAM_NAME.c_str(), cmd.c_str());
if (ret < 0) {
HILOG_ERROR(LOG_CORE, "set param failed, please manually set param and start process(%s)",
hookConfig_.process_name().c_str());
PROFILER_LOG_ERROR(LOG_CORE, "set param failed, please manually set param and start process(%s)",
hookConfig_.process_name().c_str());
} else {
HILOG_INFO(LOG_CORE, "set param success, please start process(%s)", hookConfig_.process_name().c_str());
PROFILER_LOG_INFO(LOG_CORE, "set param success, please start process(%s)",
hookConfig_.process_name().c_str());
hookCtx_.emplace_back(std::make_shared<HookManagerCtx>(hookConfig_.process_name()));
}
} else if (pidValue != -1) {
HILOG_INFO(LOG_CORE, "Process %s exist, pid = %d", hookConfig_.process_name().c_str(), pidValue);
PROFILER_LOG_INFO(LOG_CORE, "Process %s exist, pid = %d", hookConfig_.process_name().c_str(), pidValue);
for (const auto& item : hookCtx_) {
if (item->pid == pidValue) {
return true;
@ -119,7 +121,8 @@ bool HookManager::CheckProcessName()
}
hookCtx_.emplace_back(std::make_shared<HookManagerCtx>(pidValue));
} else {
HILOG_ERROR(LOG_CORE, "The startup mode parameter is not set, name: %s", hookConfig_.process_name().c_str());
PROFILER_LOG_ERROR(LOG_CORE, "The startup mode parameter is not set, name: %s",
hookConfig_.process_name().c_str());
return false;
}
return true;
@ -144,15 +147,15 @@ bool HookManager::RegisterAgentPlugin(const std::string& pluginPath)
if (commandPoller_->RegisterPlugin(request, response)) {
if (response.status() == ResponseStatus::OK) {
HILOG_DEBUG(LOG_CORE, "response.plugin_id() = %d", response.plugin_id());
PROFILER_LOG_DEBUG(LOG_CORE, "response.plugin_id() = %d", response.plugin_id());
agentIndex_ = response.plugin_id();
HILOG_DEBUG(LOG_CORE, "RegisterPlugin OK");
PROFILER_LOG_DEBUG(LOG_CORE, "RegisterPlugin OK");
} else {
HILOG_DEBUG(LOG_CORE, "RegisterPlugin FAIL 1");
PROFILER_LOG_DEBUG(LOG_CORE, "RegisterPlugin FAIL 1");
return false;
}
} else {
HILOG_DEBUG(LOG_CORE, "RegisterPlugin FAIL 2");
PROFILER_LOG_DEBUG(LOG_CORE, "RegisterPlugin FAIL 2");
return false;
}
@ -168,7 +171,7 @@ bool HookManager::UnregisterAgentPlugin(const std::string& pluginPath)
if (commandPoller_->UnregisterPlugin(request, response)) {
CHECK_TRUE(response.status() == ResponseStatus::OK, false, "UnregisterPlugin FAIL 1");
} else {
HILOG_DEBUG(LOG_CORE, "UnregisterPlugin FAIL 2");
PROFILER_LOG_DEBUG(LOG_CORE, "UnregisterPlugin FAIL 2");
return false;
}
agentIndex_ = -1;
@ -218,7 +221,7 @@ bool HookManager::HandleHookContext(const std::shared_ptr<HookManagerCtx>& ctx)
} else if (!ctx->processName.empty()) {
ctx->smbName = "hooknativesmb_" + ctx->processName;
} else {
HILOG_ERROR(LOG_CORE, "HandleHookContext context error, pid: %d, process name: %s",
PROFILER_LOG_ERROR(LOG_CORE, "HandleHookContext context error, pid: %d, process name: %s",
ctx->pid, ctx->processName.c_str());
return false;
}
@ -240,15 +243,15 @@ bool HookManager::HandleHookContext(const std::shared_ptr<HookManagerCtx>& ctx)
ctx->eventNotifier->GetFd(),
std::bind(&HookManager::ReadShareMemory, this, ctx));
HILOG_INFO(LOG_CORE, "hookservice smbFd = %d, eventFd = %d\n", ctx->shareMemoryBlock->GetfileDescriptor(),
ctx->eventNotifier->GetFd());
PROFILER_LOG_INFO(LOG_CORE, "hookservice smbFd = %d, eventFd = %d\n", ctx->shareMemoryBlock->GetfileDescriptor(),
ctx->eventNotifier->GetFd());
ctx->isRecordAccurately = hookConfig_.record_accurately();
HILOG_INFO(LOG_CORE, "hookConfig filter size = %d, malloc disable = %d mmap disable = %d",
PROFILER_LOG_INFO(LOG_CORE, "hookConfig filter size = %d, malloc disable = %d mmap disable = %d",
hookConfig_.filter_size(), hookConfig_.malloc_disable(), hookConfig_.mmap_disable());
HILOG_INFO(LOG_CORE, "hookConfig fp unwind = %d, max stack depth = %d, record_accurately=%d",
PROFILER_LOG_INFO(LOG_CORE, "hookConfig fp unwind = %d, max stack depth = %d, record_accurately=%d",
hookConfig_.fp_unwind(), hookConfig_.max_stack_depth(), ctx->isRecordAccurately);
HILOG_INFO(LOG_CORE, "hookConfig offline_symbolization = %d", hookConfig_.offline_symbolization());
PROFILER_LOG_INFO(LOG_CORE, "hookConfig offline_symbolization = %d", hookConfig_.offline_symbolization());
ctx->stackData = std::make_shared<StackDataRepeater>(STACK_DATA_SIZE);
CHECK_TRUE(ctx->stackData != nullptr, false, "Create StackDataRepeater FAIL");
@ -263,19 +266,19 @@ bool HookManager::HandleHookContext(const std::shared_ptr<HookManagerCtx>& ctx)
bool HookManager::CreatePluginSession(const std::vector<ProfilerPluginConfig>& config)
{
HILOG_DEBUG(LOG_CORE, "CreatePluginSession");
PROFILER_LOG_DEBUG(LOG_CORE, "CreatePluginSession");
// save config
if (!config.empty()) {
std::string cfgData = config[0].config_data();
if (hookConfig_.ParseFromArray(reinterpret_cast<const uint8_t*>(cfgData.c_str()), cfgData.size()) <= 0) {
HILOG_ERROR(LOG_CORE, "%s: ParseFromArray failed", __func__);
PROFILER_LOG_ERROR(LOG_CORE, "%s: ParseFromArray failed", __func__);
return false;
}
}
int32_t uShortMax = (std::numeric_limits<unsigned short>::max)();
if (hookConfig_.filter_size() > uShortMax) {
HILOG_WARN(LOG_CORE, "%s: filter size invalid(size exceed 65535), reset to 65535!", __func__);
PROFILER_LOG_WARN(LOG_CORE, "%s: filter size invalid(size exceed 65535), reset to 65535!", __func__);
hookConfig_.set_filter_size(uShortMax);
}
if (!CheckProcess()) { // Check and initialize the context for the target process.
@ -311,13 +314,13 @@ bool HookManager::CreatePluginSession(const std::vector<ProfilerPluginConfig>& c
}
if (hookCtx_.empty()) {
HILOG_ERROR(LOG_CORE, "HookManager no task");
PROFILER_LOG_ERROR(LOG_CORE, "HookManager no task");
return false;
}
if (hookConfig_.save_file() && !hookConfig_.file_name().empty()) {
fpHookData_ = fopen(hookConfig_.file_name().c_str(), "wb+");
if (fpHookData_ == nullptr) {
HILOG_INFO(LOG_CORE, "fopen file %s fail", hookConfig_.file_name().c_str());
PROFILER_LOG_INFO(LOG_CORE, "fopen file %s fail", hookConfig_.file_name().c_str());
return false;
}
}
@ -329,7 +332,7 @@ bool HookManager::CreatePluginSession(const std::vector<ProfilerPluginConfig>& c
ClientConfig clientConfig;
GetClientConfig(clientConfig);
std::string clientConfigStr = clientConfig.ToString();
HILOG_INFO(LOG_CORE, "send hook client config:%s\n", clientConfigStr.c_str());
PROFILER_LOG_INFO(LOG_CORE, "send hook client config:%s\n", clientConfigStr.c_str());
hookService_ = std::make_shared<HookService>(clientConfig, shared_from_this());
CHECK_NOTNULL(hookService_, false, "HookService create failed!");
}
@ -393,7 +396,7 @@ bool HookManager::DestroyPluginSession(const std::vector<uint32_t>& pluginIds)
for (const auto& item : hookCtx_) {
if (item->eventPoller != nullptr) {
HILOG_ERROR(LOG_CORE, "eventPoller unset!");
PROFILER_LOG_ERROR(LOG_CORE, "eventPoller unset!");
if (item->eventNotifier != nullptr) {
item->eventPoller->RemoveFileDescriptor(item->eventNotifier->GetFd());
}
@ -437,19 +440,19 @@ bool HookManager::StopPluginSession(const std::vector<uint32_t>& pluginIds)
}
for (const auto& item : hookCtx_) {
if (item->pid > 0) {
HILOG_INFO(LOG_CORE, "stop command : send 37 signal to process %d", item->pid);
PROFILER_LOG_INFO(LOG_CORE, "stop command : send 37 signal to process %d", item->pid);
if (kill(item->pid, SIGNAL_STOP_HOOK) == -1) {
const int bufSize = 256;
char buf[bufSize] = {0};
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "send 37 signal to process %d , error = %s", item->pid, buf);
PROFILER_LOG_ERROR(LOG_CORE, "send 37 signal to process %d , error = %s", item->pid, buf);
}
} else {
HILOG_INFO(LOG_CORE, "StopPluginSession: pid(%d) is less or equal zero.", item->pid);
PROFILER_LOG_INFO(LOG_CORE, "StopPluginSession: pid(%d) is less or equal zero.", item->pid);
}
CHECK_TRUE(item->stackPreprocess != nullptr, false, "stop StackPreprocess FAIL");
item->stackPreprocess->StopTakeResults();
HILOG_INFO(LOG_CORE, "StopTakeResults success");
PROFILER_LOG_INFO(LOG_CORE, "StopTakeResults success");
if (hookConfig_.statistics_interval() > 0) {
item->stackPreprocess->FlushRecordStatistics();
}
@ -468,9 +471,9 @@ void HookManager::ResetStartupParam()
if (hookConfig_.startup_mode()) {
int ret = SystemSetParameter(PARAM_NAME.c_str(), resetParam.c_str());
if (ret < 0) {
HILOG_WARN(LOG_CORE, "set param failed, please reset param(%s)", PARAM_NAME.c_str());
PROFILER_LOG_WARN(LOG_CORE, "set param failed, please reset param(%s)", PARAM_NAME.c_str());
} else {
HILOG_INFO(LOG_CORE, "reset param success");
PROFILER_LOG_INFO(LOG_CORE, "reset param success");
}
}
}
@ -483,7 +486,7 @@ bool HookManager::ReportPluginBasicData(const std::vector<uint32_t>& pluginIds)
bool HookManager::CreateWriter(std::string pluginName, uint32_t bufferSize, int smbFd, int eventFd,
bool isProtobufSerialize)
{
HILOG_DEBUG(LOG_CORE, "agentIndex_ %d", agentIndex_);
PROFILER_LOG_DEBUG(LOG_CORE, "agentIndex_ %d", agentIndex_);
RegisterWriter(std::make_shared<BufferWriter>(pluginName, VERSION, bufferSize, smbFd, eventFd, agentIndex_));
return true;
}
@ -553,18 +556,18 @@ void HookManager::StartPluginSession()
if (item->stackPreprocess == nullptr) {
continue;
}
HILOG_ERROR(LOG_CORE, "StartPluginSession name: %s", item->processName.c_str());
PROFILER_LOG_ERROR(LOG_CORE, "StartPluginSession name: %s", item->processName.c_str());
item->stackPreprocess->StartTakeResults();
if (item->pid > 0) {
HILOG_INFO(LOG_CORE, "start command : send 36 signal to process %d", item->pid);
PROFILER_LOG_INFO(LOG_CORE, "start command : send 36 signal to process %d", item->pid);
if (kill(item->pid, SIGNAL_START_HOOK) == -1) {
const int bufSize = 256;
char buf[bufSize] = {0};
strerror_r(errno, buf, bufSize);
HILOG_ERROR(LOG_CORE, "send 36 signal error = %s", buf);
PROFILER_LOG_ERROR(LOG_CORE, "send 36 signal error = %s", buf);
}
} else {
HILOG_INFO(LOG_CORE, "StartPluginSession: pid(%d) is less or equal zero.", item->pid);
PROFILER_LOG_INFO(LOG_CORE, "StartPluginSession: pid(%d) is less or equal zero.", item->pid);
}
}
}
@ -573,7 +576,7 @@ void HookManager::WriteHookConfig()
{
for (const auto& item : hookCtx_) {
if (item == nullptr) {
HILOG_ERROR(LOG_CORE, "HookManager WriteHookConfig failed");
PROFILER_LOG_ERROR(LOG_CORE, "HookManager WriteHookConfig failed");
return;
}
item->stackPreprocess->WriteHookConfig();

View File

@ -46,7 +46,7 @@ bool HookService::StartService(const std::string& unixSocketName)
serviceEntry_ = std::make_shared<ServiceEntry>();
if (!serviceEntry_->StartServer(unixSocketName)) {
serviceEntry_ = nullptr;
HILOG_DEBUG(LOG_CORE, "Start IPC Service FAIL");
PROFILER_LOG_DEBUG(LOG_CORE, "Start IPC Service FAIL");
return false;
}
serviceEntry_->RegisterService(*this);
@ -66,7 +66,7 @@ bool HookService::ProtocolProc(SocketContext &context, uint32_t pnum, const int8
std::string filePath = "/proc/" + std::to_string(peerConfig) + "/cmdline";
std::string bundleName;
if (!LoadStringFromFile(filePath, bundleName)) {
HILOG_ERROR(LOG_CORE, "Get process name by pid failed!, pid: %d", peerConfig);
PROFILER_LOG_ERROR(LOG_CORE, "Get process name by pid failed!, pid: %d", peerConfig);
return false;
}
bundleName.resize(strlen(bundleName.c_str()));
@ -85,12 +85,12 @@ bool HookService::ProtocolProc(SocketContext &context, uint32_t pnum, const int8
std::lock_guard<std::mutex> lock(mtx_);
auto [eventFd, smbFd] = hookMgr_->GetFds(peerConfig, procName);
if (eventFd == smbFd) {
HILOG_ERROR(LOG_CORE, "Get eventFd and smbFd failed!, name: %s, pid: %d", procName.c_str(), peerConfig);
PROFILER_LOG_ERROR(LOG_CORE, "Get eventFd and smbFd failed!, name: %s, pid: %d", procName.c_str(), peerConfig);
return false;
}
HILOG_DEBUG(LOG_CORE, "ProtocolProc, receive message from hook client, and send hook config to process %d",
peerConfig);
PROFILER_LOG_DEBUG(LOG_CORE, "ProtocolProc, receive message from hook client, and send hook config to process %d",
peerConfig);
context.SendHookConfig(reinterpret_cast<uint8_t *>(&clientConfig_), sizeof(clientConfig_));
context.SendFileDescriptor(smbFd);
context.SendFileDescriptor(eventFd);

View File

@ -34,7 +34,7 @@ std::shared_ptr<HookManager> g_hookManager;
NativeHookConfig g_nativeConfig;
static void SignalHandl(int signo)
{
HILOG_INFO(LOG_CORE, "SignalHandl recv %d", signo);
PROFILER_LOG_INFO(LOG_CORE, "SignalHandl recv %d", signo);
std::vector<uint32_t> pluginIds;
g_hookManager->StopPluginSession(pluginIds);
g_hookManager->DestroyPluginSession(pluginIds);
@ -81,7 +81,7 @@ void SetNativeHookConfig(const HookData& hookData)
g_nativeConfig.response_library_mode()) {
g_hookManager->SethookStandalone(true);
}
HILOG_INFO(LOG_CORE, "hookData config = %s", hookData.ToString().c_str());
PROFILER_LOG_INFO(LOG_CORE, "hookData config = %s", hookData.ToString().c_str());
}
bool StartHook(HookData& hookData)

View File

@ -48,7 +48,7 @@ void StackDataRepeater::Close()
rawDataQueue_.clear();
closed_ = true;
}
HILOG_INFO(LOG_CORE, "StackDataRepeater Close, reducedStackCount_ : %" PRIx64 " ", reducedStackCount_);
PROFILER_LOG_INFO(LOG_CORE, "StackDataRepeater Close, reducedStackCount_ : %" PRIx64 " ", reducedStackCount_);
slotCondVar_.notify_all();
itemCondVar_.notify_all();
}
@ -59,7 +59,8 @@ bool StackDataRepeater::PutRawStack(const RawStackPtr& rawData, bool isRecordAcc
std::unique_lock<std::mutex> lock(mutex_);
if ((rawData == nullptr) && (rawDataQueue_.size() > 0)) {
HILOG_INFO(LOG_CORE, "no need put nullptr if queue has data, rawDataQueue_.size() = %zu", rawDataQueue_.size());
PROFILER_LOG_INFO(LOG_CORE, "no need put nullptr if queue has data, rawDataQueue_.size() = %zu",
rawDataQueue_.size());
return true;
}
while (rawDataQueue_.size() >= maxSize_ && !closed_) {

View File

@ -62,29 +62,29 @@ StackPreprocess::StackPreprocess(const StackDataRepeaterPtr& dataRepeater,
runtime_instance = std::make_shared<VirtualRuntime>(hookConfig_);
if (hookConfig_.malloc_free_matching_interval() > MAX_MATCH_INTERVAL) {
HILOG_INFO(LOG_CORE, "Not support set %d", hookConfig_.malloc_free_matching_interval());
PROFILER_LOG_INFO(LOG_CORE, "Not support set %d", hookConfig_.malloc_free_matching_interval());
hookConfig_.set_malloc_free_matching_interval(MAX_MATCH_INTERVAL);
}
if (hookConfig_.malloc_free_matching_cnt() > MAX_MATCH_CNT) {
HILOG_INFO(LOG_CORE, "Not support set %d", hookConfig_.malloc_free_matching_cnt());
PROFILER_LOG_INFO(LOG_CORE, "Not support set %d", hookConfig_.malloc_free_matching_cnt());
hookConfig_.set_malloc_free_matching_cnt(MAX_MATCH_CNT);
}
HILOG_INFO(LOG_CORE, "malloc_free_matching_interval = %d malloc_free_matching_cnt = %d\n",
PROFILER_LOG_INFO(LOG_CORE, "malloc_free_matching_interval = %d malloc_free_matching_cnt = %d\n",
hookConfig_.malloc_free_matching_interval(), hookConfig_.malloc_free_matching_cnt());
if (hookConfig_.statistics_interval() > 0) {
statisticsInterval_ = std::chrono::seconds(hookConfig_.statistics_interval());
}
HILOG_INFO(LOG_CORE, "statistics_interval = %d statisticsInterval_ = %lld \n",
PROFILER_LOG_INFO(LOG_CORE, "statistics_interval = %d statisticsInterval_ = %lld \n",
hookConfig_.statistics_interval(), statisticsInterval_.count());
hookDataClockId_ = COMMON::GetClockId(hookConfig_.clock());
HILOG_INFO(LOG_CORE, "StackPreprocess(): pluginDataClockId = %d hookDataClockId = %d \n",
PROFILER_LOG_INFO(LOG_CORE, "StackPreprocess(): pluginDataClockId = %d hookDataClockId = %d \n",
pluginDataClockId_, hookDataClockId_);
if (hookConfig_.save_file() && fpHookData_ == nullptr) {
HILOG_ERROR(LOG_CORE, "If you need to save the file, please set the file_name");
PROFILER_LOG_ERROR(LOG_CORE, "If you need to save the file, please set the file_name");
}
HILOG_INFO(LOG_CORE, "isHookStandaloneSerialize_ = %d", isHookStandaloneSerialize_);
PROFILER_LOG_INFO(LOG_CORE, "isHookStandaloneSerialize_ = %d", isHookStandaloneSerialize_);
#if defined(__arm__)
u64regs_.resize(PERF_REG_ARM_MAX);
#else
@ -131,18 +131,18 @@ bool StackPreprocess::StartTakeResults()
bool StackPreprocess::StopTakeResults()
{
HILOG_INFO(LOG_CORE, "start StopTakeResults");
PROFILER_LOG_INFO(LOG_CORE, "start StopTakeResults");
CHECK_NOTNULL(dataRepeater_, false, "data repeater null");
CHECK_TRUE(thread_.get_id() != std::thread::id(), false, "thread invalid");
isStopTakeData_ = true;
dataRepeater_->PutRawStack(nullptr, false);
HILOG_INFO(LOG_CORE, "StopTakeResults Wait thread join");
PROFILER_LOG_INFO(LOG_CORE, "StopTakeResults Wait thread join");
if (thread_.joinable()) {
thread_.join();
}
HILOG_INFO(LOG_CORE, "StopTakeResults Wait thread join success");
PROFILER_LOG_INFO(LOG_CORE, "StopTakeResults Wait thread join success");
return true;
}
@ -158,7 +158,7 @@ void StackPreprocess::TakeResults()
minStackDepth = static_cast<size_t>(hookConfig_.max_stack_depth());
}
minStackDepth += FILTER_STACK_DEPTH;
HILOG_INFO(LOG_CORE, "TakeResults thread %d, start!", gettid());
PROFILER_LOG_INFO(LOG_CORE, "TakeResults thread %d, start!", gettid());
while (1) {
BatchNativeHookData stackData;
RawStackPtr batchRawStack[MAX_BATCH_CNT] = {nullptr};
@ -176,7 +176,7 @@ void StackPreprocess::TakeResults()
BaseStackRawData* mmapRawData = rawData->stackConext;
std::string filePath(reinterpret_cast<char *>(rawData->data));
COMMON::AdaptSandboxPath(filePath, rawData->stackConext->pid);
HILOG_DEBUG(LOG_CORE, "MMAP_FILE_TYPE curMmapAddr=%p, MAP_FIXED=%d, "
PROFILER_LOG_DEBUG(LOG_CORE, "MMAP_FILE_TYPE curMmapAddr=%p, MAP_FIXED=%d, "
"PROT_EXEC=%d, offset=%" PRIu64 ", filePath=%s",
mmapRawData->addr, mmapRawData->mmapArgs.flags & MAP_FIXED,
mmapRawData->mmapArgs.flags & PROT_EXEC, mmapRawData->mmapArgs.offset, filePath.data());
@ -200,13 +200,14 @@ void StackPreprocess::TakeResults()
if (!rawData->reportFlag) {
ignoreCnts_++;
if (ignoreCnts_ % LOG_PRINT_TIMES == 0) {
HILOG_INFO(LOG_CORE, "ignoreCnts_ = %d quene size = %zu\n", ignoreCnts_, dataRepeater_->Size());
PROFILER_LOG_INFO(LOG_CORE, "ignoreCnts_ = %d quene size = %zu\n",
ignoreCnts_, dataRepeater_->Size());
}
continue;
}
eventCnts_++;
if (eventCnts_ % LOG_PRINT_TIMES == 0) {
HILOG_INFO(LOG_CORE, "eventCnts_ = %d quene size = %zu\n", eventCnts_, dataRepeater_->Size());
PROFILER_LOG_INFO(LOG_CORE, "eventCnts_ = %d quene size = %zu\n", eventCnts_, dataRepeater_->Size());
}
callFrames_.clear();
if (hookConfig_.fp_unwind()) {
@ -229,7 +230,7 @@ void StackPreprocess::TakeResults()
#else
if (memcpy_s(u64regs_.data(), sizeof(uint64_t) * PERF_REG_ARM64_MAX, rawData->data,
sizeof(uint64_t) * PERF_REG_ARM64_MAX) != EOK) {
HILOG_ERROR(LOG_CORE, "memcpy_s regs failed");
PROFILER_LOG_ERROR(LOG_CORE, "memcpy_s regs failed");
}
#endif
}
@ -249,7 +250,7 @@ void StackPreprocess::TakeResults()
bool ret = runtime_instance->UnwindStack(u64regs_, rawData->stackData, rawData->stackSize,
rawData->stackConext->pid, rawData->stackConext->tid, callFrames_, stackDepth);
if (!ret) {
HILOG_ERROR(LOG_CORE, "unwind fatal error");
PROFILER_LOG_ERROR(LOG_CORE, "unwind fatal error");
continue;
}
}
@ -267,14 +268,14 @@ void StackPreprocess::TakeResults()
uint64_t curTimeCost = (end.tv_sec - start.tv_sec) * MAX_MATCH_CNT * MAX_MATCH_CNT * MAX_MATCH_CNT +
(end.tv_nsec - start.tv_nsec);
if (curTimeCost >= LONG_TIME_THRESHOLD) {
HILOG_ERROR(LOG_CORE, "bigTimeCost %" PRIu64 " event=%d, realFrameDepth=%zu, "
PROFILER_LOG_ERROR(LOG_CORE, "bigTimeCost %" PRIu64 " event=%d, realFrameDepth=%zu, "
"callFramesDepth=%zu\n",
curTimeCost, rawData->stackConext->type, realFrameDepth, callFrames_.size());
}
timeCost += curTimeCost;
unwindTimes++;
if (unwindTimes % LOG_PRINT_TIMES == 0) {
HILOG_ERROR(LOG_CORE, "unwindTimes %" PRIu64" cost time = %" PRIu64" mean cost = %" PRIu64"\n",
PROFILER_LOG_ERROR(LOG_CORE, "unwindTimes %" PRIu64" cost time = %" PRIu64" mean cost = %" PRIu64"\n",
unwindTimes.load(), timeCost.load(), timeCost.load() / unwindTimes.load());
}
#endif
@ -297,7 +298,7 @@ void StackPreprocess::TakeResults()
}
}
}
HILOG_INFO(LOG_CORE, "TakeResults thread %d, exit!", gettid());
PROFILER_LOG_INFO(LOG_CORE, "TakeResults thread %d, exit!", gettid());
}
inline void StackPreprocess::ReportThreadNameMap(uint32_t tid, const std::string& tname,
@ -490,7 +491,7 @@ void StackPreprocess::SetHookData(RawStackPtr rawStack,
break;
}
default: {
HILOG_ERROR(LOG_CORE, "statistics event type:%d error", rawStack->stackConext->type);
PROFILER_LOG_ERROR(LOG_CORE, "statistics event type:%d error", rawStack->stackConext->type);
break;
}
}
@ -626,7 +627,7 @@ inline void StackPreprocess::SetAllocStatisticsData(const RawStackPtr& rawStack,
break;
}
default: {
HILOG_ERROR(LOG_CORE, "SetAllocStatisticsData event type error");
PROFILER_LOG_ERROR(LOG_CORE, "SetAllocStatisticsData event type error");
break;
}
}
@ -780,7 +781,7 @@ void StackPreprocess::SetSymbolInfo(uint32_t filePathId, ElfSymbolTable& symbolI
BatchNativeHookData& batchNativeHookData)
{
if (symbolInfo.symEntSize == 0) {
HILOG_ERROR(LOG_CORE, "SetSymbolInfo get symbolInfo failed");
PROFILER_LOG_ERROR(LOG_CORE, "SetSymbolInfo get symbolInfo failed");
return;
}
NativeHookData* hookData = batchNativeHookData.add_events();
@ -807,12 +808,12 @@ void StackPreprocess::FlushData(BatchNativeHookData& stackData)
google::protobuf::TextFormat::PrintToString(StandardStackData, &str);
size_t n = fwrite(str.data(), 1, str.size(), fpHookData_);
fflush(fpHookData_);
HILOG_DEBUG(LOG_CORE, "Flush Data fwrite n = %zu str.size() = %zu", n, str.size());
PROFILER_LOG_DEBUG(LOG_CORE, "Flush Data fwrite n = %zu str.size() = %zu", n, str.size());
} else {
Flush(buffer_.get(), length);
}
} else {
HILOG_ERROR(LOG_CORE, "the data is larger than MAX_BUFFER_SIZE, flush failed");
PROFILER_LOG_ERROR(LOG_CORE, "the data is larger than MAX_BUFFER_SIZE, flush failed");
}
}
}
@ -820,7 +821,7 @@ void StackPreprocess::FlushData(BatchNativeHookData& stackData)
void StackPreprocess::Flush(const uint8_t* src, size_t size)
{
if (src == nullptr) {
HILOG_ERROR(LOG_CORE, "Flush src is nullptr");
PROFILER_LOG_ERROR(LOG_CORE, "Flush src is nullptr");
return;
}
if (isSaService_) {
@ -853,7 +854,7 @@ void StackPreprocess::GetSymbols(const std::string& filePath, ElfSymbolTable& sy
symbols.textVaddr = elfPtr->GetStartVaddr();
symbols.textOffset = elfPtr->GetStartOffset();
if (symbols.textVaddr == (std::numeric_limits<uint64_t>::max)()) {
HILOG_ERROR(LOG_CORE, "GetSymbols get textVaddr failed");
PROFILER_LOG_ERROR(LOG_CORE, "GetSymbols get textVaddr failed");
return;
}
@ -872,16 +873,16 @@ void StackPreprocess::GetSymbols(const std::string& filePath, ElfSymbolTable& sy
symbols.symEntSize = shdr.entSize;
symbols.symTable.resize(shdr.size);
if (!elfPtr->GetSectionData(symbols.symTable.data(), shdr.size, symSecName)) {
HILOG_ERROR(LOG_CORE, "GetSymbols get symbol section data failed");
PROFILER_LOG_ERROR(LOG_CORE, "GetSymbols get symbol section data failed");
return;
}
if (!elfPtr->GetSectionInfo(shdr, strSecName)) {
HILOG_ERROR(LOG_CORE, "GetSymbols get str section failed");
PROFILER_LOG_ERROR(LOG_CORE, "GetSymbols get str section failed");
return;
}
symbols.strTable.resize(shdr.size);
if (!elfPtr->GetSectionData(symbols.strTable.data(), shdr.size, strSecName)) {
HILOG_ERROR(LOG_CORE, "GetSymbols get str section failed");
PROFILER_LOG_ERROR(LOG_CORE, "GetSymbols get str section failed");
return;
}
}

Some files were not shown because too many files have changed in this diff Show More