!1735 修改ftrace proto

Merge pull request !1735 from zhangyixin/master
This commit is contained in:
openharmony_ci 2024-07-31 11:40:00 +00:00 committed by Gitee
commit c8552eacb8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 8 additions and 0 deletions

View File

@ -23,6 +23,13 @@ template <typename T> void sched_blocked_reason_func(T& msg, uint8_t data[], siz
msg->set_pid(FtraceFieldParser::ParseIntField<int32_t>(format.fields, i++, data, size)); msg->set_pid(FtraceFieldParser::ParseIntField<int32_t>(format.fields, i++, data, size));
msg->set_caller(FtraceFieldParser::ParseIntField<uint64_t>(format.fields, i++, data, size)); msg->set_caller(FtraceFieldParser::ParseIntField<uint64_t>(format.fields, i++, data, size));
msg->set_io_wait(FtraceFieldParser::ParseIntField<uint32_t>(format.fields, i++, data, size)); msg->set_io_wait(FtraceFieldParser::ParseIntField<uint32_t>(format.fields, i++, data, size));
uint64_t recOffset = FtraceFieldParser::ParseIntField<uint64_t>(format.fields, ++i, data, size);
uint64_t recSize = FtraceFieldParser::ParseIntField<uint64_t>(format.fields, ++i, data, size);
std::string funcName = FtraceFieldParser::ParseStrField(format.fields, ++i, data, size);
std::string modName = FtraceFieldParser::ParseStrField(format.fields, ++i, data, size);
std::string caller_str = funcName + "+0x" + std::to_string(recOffset) + "/0x"
+ std::to_string(recSize) + "[" + modName + "]";
msg->set_caller_str(caller_str);
} }
REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_blocked_reason, REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_blocked_reason,
[](FtraceEvent& ftraceEvent, uint8_t data[], size_t size, const EventFormat& format) { [](FtraceEvent& ftraceEvent, uint8_t data[], size_t size, const EventFormat& format) {

View File

@ -23,6 +23,7 @@ message SchedBlockedReasonFormat {
int32 pid = 1; int32 pid = 1;
uint64 caller = 2; uint64 caller = 2;
uint32 io_wait = 3; uint32 io_wait = 3;
string caller_str = 4;
} }
// /sys/kernel/debug/tracing/events/sched/sched_kthread_stop/format // /sys/kernel/debug/tracing/events/sched/sched_kthread_stop/format