Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
5635ad0a
A
apollo
项目概览
Pinoxchio
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5635ad0a
编写于
9月 16, 2018
作者:
Z
zhangchao19
提交者:
GoLancer
9月 17, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
framework: format and lint code for perf event
上级
b288f0a9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
24 deletion
+20
-24
framework/cybertron/event/perf_event.cpp
framework/cybertron/event/perf_event.cpp
+2
-2
framework/cybertron/event/perf_event.h
framework/cybertron/event/perf_event.h
+3
-10
framework/cybertron/event/perf_event_cache.cpp
framework/cybertron/event/perf_event_cache.cpp
+9
-7
framework/cybertron/event/perf_event_cache.h
framework/cybertron/event/perf_event_cache.h
+6
-5
未找到文件。
framework/cybertron/event/perf_event.cpp
浏览文件 @
5635ad0a
...
@@ -29,7 +29,7 @@ namespace event {
...
@@ -29,7 +29,7 @@ namespace event {
using
apollo
::
cybertron
::
base
::
BoundedQueue
;
using
apollo
::
cybertron
::
base
::
BoundedQueue
;
using
apollo
::
cybertron
::
common
::
GlobalData
;
using
apollo
::
cybertron
::
common
::
GlobalData
;
void
SchedPerfEvent
::
SetParams
(
int
count
,
...)
{
void
SchedPerfEvent
::
SetParams
(
const
int
count
,
...)
{
va_list
ap
;
va_list
ap
;
va_start
(
ap
,
count
);
va_start
(
ap
,
count
);
event_id
=
va_arg
(
ap
,
int
);
event_id
=
va_arg
(
ap
,
int
);
...
@@ -43,7 +43,7 @@ void SchedPerfEvent::SetParams(int count, ...) {
...
@@ -43,7 +43,7 @@ void SchedPerfEvent::SetParams(int count, ...) {
va_end
(
ap
);
va_end
(
ap
);
}
}
void
TransportPerfEvent
::
SetParams
(
int
count
,
...)
{
void
TransportPerfEvent
::
SetParams
(
const
int
count
,
...)
{
va_list
ap
;
va_list
ap
;
va_start
(
ap
,
count
);
va_start
(
ap
,
count
);
event_id
=
va_arg
(
ap
,
int
);
event_id
=
va_arg
(
ap
,
int
);
...
...
framework/cybertron/event/perf_event.h
浏览文件 @
5635ad0a
...
@@ -51,20 +51,13 @@ enum class SchedPerf {
...
@@ -51,20 +51,13 @@ enum class SchedPerf {
enum
class
TransPerf
{
TRANS_FROM
=
1
,
TRANS_TO
=
2
,
WRITE_NOTIFY
=
3
};
enum
class
TransPerf
{
TRANS_FROM
=
1
,
TRANS_TO
=
2
,
WRITE_NOTIFY
=
3
};
// event_id
// 1 swap_in
// 2 swap_out
// 3 try_fetch_out
// 4 notify_in
// 5 next_routine
class
PerfEventBase
{
class
PerfEventBase
{
public:
public:
int
event_type
=
0
;
int
event_type
=
0
;
int
event_id
;
int
event_id
;
uint64_t
t_start
=
-
1
;
uint64_t
t_start
=
-
1
;
uint64_t
t_end
=
-
1
;
uint64_t
t_end
=
-
1
;
virtual
void
SetParams
(
int
count
,
...)
{
virtual
void
SetParams
(
const
int
count
,
...)
{
va_list
ap
;
va_list
ap
;
va_start
(
ap
,
count
);
va_start
(
ap
,
count
);
event_type
=
va_arg
(
ap
,
int
);
event_type
=
va_arg
(
ap
,
int
);
...
@@ -92,7 +85,7 @@ class PerfEventBase {
...
@@ -92,7 +85,7 @@ class PerfEventBase {
class
SchedPerfEvent
:
public
PerfEventBase
{
class
SchedPerfEvent
:
public
PerfEventBase
{
public:
public:
SchedPerfEvent
()
{
event_type
=
int
(
EventType
::
SCHED_EVENT
);
}
SchedPerfEvent
()
{
event_type
=
int
(
EventType
::
SCHED_EVENT
);
}
void
SetParams
(
int
count
,
...)
override
;
void
SetParams
(
const
int
count
,
...)
override
;
std
::
string
SerializeToString
()
override
{
std
::
string
SerializeToString
()
override
{
std
::
stringstream
ss
;
std
::
stringstream
ss
;
ss
<<
event_type
<<
"
\t
"
;
ss
<<
event_type
<<
"
\t
"
;
...
@@ -121,7 +114,7 @@ class SchedPerfEvent : public PerfEventBase {
...
@@ -121,7 +114,7 @@ class SchedPerfEvent : public PerfEventBase {
class
TransportPerfEvent
:
public
PerfEventBase
{
class
TransportPerfEvent
:
public
PerfEventBase
{
public:
public:
TransportPerfEvent
()
{
event_type
=
int
(
EventType
::
TRANS_EVENT
);
}
TransportPerfEvent
()
{
event_type
=
int
(
EventType
::
TRANS_EVENT
);
}
void
SetParams
(
int
count
,
...)
override
;
void
SetParams
(
const
int
count
,
...)
override
;
std
::
string
SerializeToString
()
override
{
std
::
string
SerializeToString
()
override
{
std
::
stringstream
ss
;
std
::
stringstream
ss
;
ss
<<
event_type
<<
"
\t
"
;
ss
<<
event_type
<<
"
\t
"
;
...
...
framework/cybertron/event/perf_event_cache.cpp
浏览文件 @
5635ad0a
...
@@ -20,7 +20,6 @@
...
@@ -20,7 +20,6 @@
#include <unordered_map>
#include <unordered_map>
#include "cybertron/event/perf_event_cache.h"
#include "cybertron/event/perf_event_cache.h"
#include "cybertron/common/global_data.h"
#include "cybertron/common/global_data.h"
#include "cybertron/init.h"
#include "cybertron/init.h"
#include "cybertron/time/time.h"
#include "cybertron/time/time.h"
...
@@ -65,10 +64,12 @@ void PerfEventCache::AddEvent(const std::shared_ptr<PerfEventBase>& event) {
...
@@ -65,10 +64,12 @@ void PerfEventCache::AddEvent(const std::shared_ptr<PerfEventBase>& event) {
}
}
}
}
void
PerfEventCache
::
AddSchedEvent
(
SchedPerf
event_id
,
uint64_t
cr_id
,
void
PerfEventCache
::
AddSchedEvent
(
const
SchedPerf
event_id
,
int
proc_id
,
uint64_t
t_sleep
,
const
uint64_t
cr_id
,
const
int
proc_id
,
uint64_t
t_start
,
int
try_fetch_result
,
const
uint64_t
t_sleep
,
int
croutine_state
)
{
const
uint64_t
t_start
,
const
int
try_fetch_result
,
const
int
croutine_state
)
{
if
(
!
enable_
)
{
if
(
!
enable_
)
{
return
;
return
;
}
}
...
@@ -85,8 +86,9 @@ void PerfEventCache::AddSchedEvent(SchedPerf event_id, uint64_t cr_id,
...
@@ -85,8 +86,9 @@ void PerfEventCache::AddSchedEvent(SchedPerf event_id, uint64_t cr_id,
}
}
}
}
void
PerfEventCache
::
AddTransportEvent
(
TransPerf
event_id
,
uint64_t
channel_id
,
void
PerfEventCache
::
AddTransportEvent
(
const
TransPerf
event_id
,
uint64_t
msg_seq
)
{
const
uint64_t
channel_id
,
const
uint64_t
msg_seq
)
{
if
(
!
enable_
)
{
if
(
!
enable_
)
{
return
;
return
;
}
}
...
...
framework/cybertron/event/perf_event_cache.h
浏览文件 @
5635ad0a
...
@@ -44,11 +44,12 @@ using apollo::cybertron::proto::PerfConf;
...
@@ -44,11 +44,12 @@ using apollo::cybertron::proto::PerfConf;
class
PerfEventCache
{
class
PerfEventCache
{
public:
public:
~
PerfEventCache
();
~
PerfEventCache
();
void
AddSchedEvent
(
SchedPerf
event_id
,
uint64_t
cr_id
,
int
proc_id
,
void
AddSchedEvent
(
const
SchedPerf
event_id
,
const
uint64_t
cr_id
,
uint64_t
t_sleep
,
uint64_t
t_start
,
int
try_fetch_result
,
const
int
proc_id
,
const
uint64_t
t_sleep
,
int
croutine_state
);
const
uint64_t
t_start
,
const
int
try_fetch_result
,
void
AddTransportEvent
(
TransPerf
event_id
,
uint64_t
channel_id
,
const
int
croutine_state
);
uint64_t
msg_seq
);
void
AddTransportEvent
(
const
TransPerf
event_id
,
const
uint64_t
channel_id
,
const
uint64_t
msg_seq
);
void
AddEvent
(
const
std
::
shared_ptr
<
PerfEventBase
>&
event
);
void
AddEvent
(
const
std
::
shared_ptr
<
PerfEventBase
>&
event
);
private:
private:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录