linux上的Valgrind:延迟启动

时间:2022-09-05 18:42:53

Using

使用

valgrind --tool=callgrind

= callgrind valgrind——工具

on Linux

在Linux上

.....I would like to pass canned messages into my process. However for the first eg 90% of the messages I would like to process as normal, with no grinding, in order to build up a map. Then I would like to activate valgrind/callgrind only for the last 10% messages.

.....我想在我的过程中传递一些固定的信息。然而,对于第一个(如90%)消息,我希望像往常一样处理,不需要磨磨蹭蹭,以便构建一个映射。然后我想激活valgrind/callgrind,只获取最后10%的消息。

Is this possible?

这是可能的吗?

Maybe there is a way to increment a counter in my C++ code and when it reaches a certain threshold, activate valgrind/callgrind.

也许有一种在我的c++代码中增加计数器的方法,当它达到某个阈值时,激活valgrind/callgrind。

Your feedback is much appreciated.

非常感谢您的反馈。

1 个解决方案

#1


3  

Yes, it is possible. You have to use a mix of --instr-atstart=no along with either a callgrind_control or a "toggle function" (--toggle-collect). The later seems more applicable to your scenario. See §6.2.2 "Limiting the range of collected events" of the Valgrind manual for more information.

是的,这是可能的。你必须使用-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -后者似乎更适合您的场景。看到§6.2.2”限制的范围收集事件”Valgrind手册获得更多信息。

#1


3  

Yes, it is possible. You have to use a mix of --instr-atstart=no along with either a callgrind_control or a "toggle function" (--toggle-collect). The later seems more applicable to your scenario. See §6.2.2 "Limiting the range of collected events" of the Valgrind manual for more information.

是的,这是可能的。你必须使用-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -后者似乎更适合您的场景。看到§6.2.2”限制的范围收集事件”Valgrind手册获得更多信息。