-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix RecordEvent interface #39675
fix RecordEvent interface #39675
Changes from 2 commits
7e44acd
c6fdca7
6791fe0
370e952
5821f32
c882c74
bdf7564
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,16 +34,19 @@ struct RecordInstantEvent { | |
// Chrome Trace Viewer Format: Duration Event/Complte Event | ||
class RecordEvent { | ||
public: | ||
explicit RecordEvent(const std::string& name, | ||
const EventRole role = EventRole::kOrdinary, | ||
uint32_t level = 1); | ||
explicit RecordEvent( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 修改接口会导致部分使用EventRole的case无法编译,需要修改这些 |
||
const std::string& name, | ||
const TracerEventType type = TracerEventType::UserDefined, | ||
uint32_t level = 4, const EventRole role = EventRole::kOrdinary); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 把默认level 4定义一个const常量,这样用户需要设置后面的默认参数而不想改level时可以用这个 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 已改 |
||
|
||
explicit RecordEvent(const char* name, | ||
const EventRole role = EventRole::kOrdinary, | ||
uint32_t level = 1); | ||
explicit RecordEvent( | ||
const char* name, | ||
const TracerEventType type = TracerEventType::UserDefined, | ||
uint32_t level = 4, const EventRole role = EventRole::kOrdinary); | ||
|
||
RecordEvent(const std::string& name, const EventRole role, | ||
const std::string& attr, uint32_t level = 1); | ||
RecordEvent(const std::string& name, const std::string& attr, | ||
const TracerEventType type = TracerEventType::UserDefined, | ||
uint32_t level = 4, const EventRole role = EventRole::kOrdinary); | ||
|
||
// Stop event tracing explicitly before the object goes out of scope. | ||
// Sometimes it's inconvenient to use RAII | ||
|
@@ -65,6 +68,7 @@ class RecordEvent { | |
// different kernel invocations within an op. | ||
// std::string full_name_; | ||
EventRole role_{EventRole::kOrdinary}; | ||
TracerEventType type_{TracerEventType::UserDefined}; | ||
std::string* attr_{nullptr}; | ||
bool finished_{false}; | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default level低一点
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已改