From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailsec110.isp.belgacom.be (mailsec110.isp.belgacom.be [195.238.20.106]) by sourceware.org (Postfix) with ESMTPS id DD25B3858C00 for ; Wed, 7 Sep 2022 20:50:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DD25B3858C00 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=skynet.be Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=skynet.be DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=skynet.be; i=@skynet.be; q=dns/txt; s=rmail; t=1662583850; x=1694119850; h=message-id:subject:from:to:date:in-reply-to:references: mime-version:content-transfer-encoding; bh=hxWUOrL3dencndA5Gzb7bEkW7eHxO5ieHfOCQL+ZoN0=; b=f/SwbPjXx5sQy2YP+Egw92XU8AvmOofMAb/2unlN/cbllsUi+34r+TdZ sj7UOSOTzcaTdQ42CyxriGlURWdJt60f7g+VJwgu+xS2HRM9Z8UBzNxTy q5e5hgEYb/EUn9HdJabxJ1tAH3ej4/gYM5UCl9NnbpZBNj2QSFcxgVo6e g=; X-ExtLoop: 1 X-IPAS-Result: =?us-ascii?q?A2AbAQDAAxlj/1uGgG0NTR4BPAwCCxUJgUaDJYYmkRODV?= =?us-ascii?q?pkvFIFoCwEBAQEBAQEBAQk3CwQBAYUGAoRmJjYHDgECBAEBAQEDAgMBAQEBA?= =?us-ascii?q?QEDAQEGAQEBAQEBBgQBgRuFLzmCQikBg2QBAQEDIw8BQBYJAhgCAiYCAlcGA?= =?us-ascii?q?YMQgzOKa5sdeoExgQGDZkFKgyyBXwaBESyGfxtTVYddN4FVRIQ/PoJiBAEXg?= =?us-ascii?q?QyEEIJlBIlwh1eFfBw3AxorHkIDC3kDFQMUAwUkBwMZDyMNDQQWBwwDAwUlA?= =?us-ascii?q?wICGwcCAgMCBhUFAgIXNjgIBAgEKyQPBQIHLwUELwIeBAUGEQgCFgIGBAQEB?= =?us-ascii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Frrx8RYZWc QpsIIaRpQs19z91Yj+sfy2SnkciGtY+NiDW4pZatjTLbhVq/kQPPqgH2PU0NmBPkjW5k5NNx fpBp82uTF4oBZXeobFIO/VYO3kW0axuy+aWez7m75zVlgufIk6EL/dGVRlne9RCqqAuWj0Ip KVwxDMlN3hvg8quwLO/S/F0i4I8JdPsJZ4et2t75SraHPArXdbJTs0m4PcBh2Zh3ZwXQK+2i 8wxRx1mSATkPCJ1P04QCqBjoufr20vzbGgNwL6Sje9ti4TJ9yR10aPtLd2MIIbXFZp9hlmCq iTN+GGRKh4WPvSEzief+X+zj/XC2yThV+ov+KaQp6cs2QbPgzVJWFhPDQr9qPWijguyStQZK lcMvCAjqac7/0uuCNPwN/GlnEO5Utcnc4I4O4UHBMulk8I4Py7x6qM4ovKtpTDoWALahdDn6 7NRo+7UOA== IronPort-HdrOrdr: A9a23:2wvWSqtSuhjhgWNHHnuKJ/TO7skDY9V00zEX/kB9WHVpm6uj5q WTdZUgtSMc5wx/ZJhNo7290ey7L080lqQFg7X5X43IYOCOggLBEGgh1+rfKlbbcREWmNQw6U 4tSdkcNOHN X-IronPort-Anti-Spam-Filtered: true X-ProximusIPWarmup: true Received: from 91.134-128-109.adsl-dyn.isp.belgacom.be (HELO [192.168.1.19]) ([109.128.134.91]) by relay.proximus.be with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2022 22:50:48 +0200 Message-ID: <4f5098c4dd3286c730408e18a31e2f625a820fe5.camel@skynet.be> Subject: Re: hello, is there anyway to count number of executed instructions of a function From: Philippe Waroquiers To: =?UTF-8?Q?=E6=9D=8E=E7=A1=95=EF=BC=88lishuo122587?= - =?UTF-8?Q?=E6=96=B0=E8=AF=9B=E4=BB=99=E4=B8=96=E7=95=8C=E6=9C=8D?= =?UTF-8?Q?=E5=8A=A1=E5=99=A8=E7=BB=84=EF=BC=89?= , "gdb@sourceware.org" Date: Wed, 07 Sep 2022 22:50:49 +0200 In-Reply-To: <7029d52e99714f9f856611e625351bbb@pwrd.com> References: <7029d52e99714f9f856611e625351bbb@pwrd.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 版邮件发送 > 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