* hello, is there anyway to count number of executed instructions of a function
@ 2022-09-02 11:16 李硕(lishuo122587 - 新诛仙世界服务器组)
2022-09-07 20:50 ` Philippe Waroquiers
0 siblings, 1 reply; 2+ messages in thread
From: 李硕(lishuo122587 - 新诛仙世界服务器组) @ 2022-09-02 11:16 UTC (permalink / raw)
To: gdb
[-- Attachment #1: Type: text/plain, Size: 229 bytes --]
Dear programmers,
Hello, I’m a newer, does someone known how to count number of executed instructions of a function?
Yours, sincerely
从 Windows 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>发送
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: hello, is there anyway to count number of executed instructions of a function
2022-09-02 11:16 hello, is there anyway to count number of executed instructions of a function 李硕(lishuo122587 - 新诛仙世界服务器组)
@ 2022-09-07 20:50 ` Philippe Waroquiers
0 siblings, 0 replies; 2+ messages in thread
From: Philippe Waroquiers @ 2022-09-07 20:50 UTC (permalink / raw)
To: 李硕(lishuo122587 -
新诛仙世界服务器组),
gdb
On Fri, 2022-09-02 at 11:16 +0000, 李硕(lishuo122587 - 新诛仙世界服务器组) wrote:
> Dear programmers,
> Hello, I’m a newer, does someone known how to count number of executed instructions of a function?
>
> Yours, sincerely
>
> 从 Windows 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>发送
>
To my knowledge, GDB does not have such a feature.
But for sure, there are various tools that can do that.
E.g. see valgrind https://valgrind.org/docs/manual/manual.html
and in particular the sections about callgrind and cachegrind (and possibly
the lackey tool).
Note that kcachegrind is a nice visualisation tool for callgrind output.
On linux, the "perf" command might also do what you want (significantly faster than
valgrind, which have a high performance impact).
Philippe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-07 20:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-02 11:16 hello, is there anyway to count number of executed instructions of a function 李硕(lishuo122587 - 新诛仙世界服务器组)
2022-09-07 20:50 ` Philippe Waroquiers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).