From owner-freebsd-questions@freebsd.org Sat Nov 28 11:26:24 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A96C47DB32 for ; Sat, 28 Nov 2020 11:26:24 +0000 (UTC) (envelope-from ml@netfence.it) Received: from soth.netfence.it (mailserver.netfence.it [78.134.96.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mailserver.netfence.it", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cjq272387z3kZ3 for ; Sat, 28 Nov 2020 11:26:22 +0000 (UTC) (envelope-from ml@netfence.it) Received: from alamar.ventu (mailserver.netfence.it [78.134.96.152]) (authenticated bits=0) by soth.netfence.it (8.16.1/8.16.1) with ESMTPSA id 0ASBQ5ZK020158 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Sat, 28 Nov 2020 12:26:05 +0100 (CET) (envelope-from ml@netfence.it) X-Authentication-Warning: soth.netfence.it: Host mailserver.netfence.it [78.134.96.152] claimed to be alamar.ventu Subject: Re: Profiling C application To: freebsd-questions@freebsd.org, ihor@antonovs.family References: <39693639-6531-493f-fb24-53519f66cd98@antonovs.family> From: Andrea Venturoli Message-ID: <175c36b0-c433-94ee-cf56-c65699f75b44@netfence.it> Date: Sat, 28 Nov 2020 12:26:05 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <39693639-6531-493f-fb24-53519f66cd98@antonovs.family> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.83 X-Rspamd-Queue-Id: 4Cjq272387z3kZ3 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=netfence.it; spf=pass (mx1.freebsd.org: domain of ml@netfence.it designates 78.134.96.152 as permitted sender) smtp.mailfrom=ml@netfence.it X-Spamd-Result: default: False [-3.80 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[78.134.96.152:from]; R_SPF_ALLOW(-0.20)[+ip4:78.134.96.152]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; TO_DN_NONE(0.00)[]; SPAMHAUS_ZRD(0.00)[78.134.96.152:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[netfence.it,none]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; RCVD_COUNT_ONE(0.00)[1]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:35612, ipnet:78.134.0.0/17, country:IT]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-questions] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2020 11:26:24 -0000 On 11/28/20 4:38 AM, Ihor Antonov wrote: > Hello folks, > > What can I use on FreeBSD to profile a slow application? > > I have a source code of the application and I can rebuild it if necessary. > > I want to see where (in what functions) application spends most of its > time - amount of function calls and duration of each call (per call) > > What tools can you recommend to do this? Hello. Take a look at: _ devel/valgrind (callgrind tool), possibly with devel/kcachegrind to analyze the results; _ devel/google-perftools; _ something is also included in base system (llvm-cov), altough it's better suited for code coverage. Sorry to be vague, but I last used them some time ago and I don't remember the details right now. HTH. bye av.