提交 8f631222 创建 作者: Austin Clements's avatar Austin Clements 提交者: Silas Boyd-Wickizer

sperf doesn't need the hack to explicitly run static constructors now

上级 8e60785f
...@@ -36,7 +36,6 @@ void initnet(void); ...@@ -36,7 +36,6 @@ void initnet(void);
void initsched(void); void initsched(void);
void initlockstat(void); void initlockstat(void);
void initwq(void); void initwq(void);
void initsperf(void);
void initidle(void); void initidle(void);
void initcpprt(void); void initcpprt(void);
void initfutex(void); void initfutex(void);
...@@ -149,7 +148,6 @@ cmain(u64 mbmagic, u64 mbaddr) ...@@ -149,7 +148,6 @@ cmain(u64 mbmagic, u64 mbaddr)
initacpi(); initacpi();
initseg(); initseg();
initsperf();
inittrap(); inittrap();
initlapic(); initlapic();
initcmdline(); initcmdline();
......
...@@ -9,11 +9,3 @@ using namespace scopedperf; ...@@ -9,11 +9,3 @@ using namespace scopedperf;
static tsc_ctr tsc; static tsc_ctr tsc;
ctrgroup_chain<tsc_ctr> perfgroup(&tsc); ctrgroup_chain<tsc_ctr> perfgroup(&tsc);
// but xv6 doesn't run static constructors, so call them explicitly below..
void
initsperf()
{
new (&tsc) tsc_ctr();
new (&perfgroup) ctrgroup_chain<tsc_ctr>(&tsc);
}
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论