public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Re: hello, is there anyway to count number of executed instructions of a function
       [not found] <7029d52e99714f9f856611e625351bbb@pwrd.com>
@ 2022-09-07 20:50 ` Philippe Waroquiers
  0 siblings, 0 replies; only message 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] only message in thread

only message in thread, other threads:[~2022-09-07 20:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <7029d52e99714f9f856611e625351bbb@pwrd.com>
2022-09-07 20:50 ` hello, is there anyway to count number of executed instructions of a function 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).