From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2610:1c1:1:606c::19:2]) by sourceware.org (Postfix) with ESMTPS id E44F43858C53 for ; Thu, 29 Dec 2022 18:36:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E44F43858C53 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4NjcY24sf0z3q9c; Thu, 29 Dec 2022 18:36:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NjcY241yJz3HJY; Thu, 29 Dec 2022 18:36:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672338982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Uq+VDgP2GCx4fruRuFt5OH8nBMJj1XB+C3Uzr7luJPE=; b=ZkCoiJribHxczMrGrtf7EUMZYOF+ilbaWHUZBLUqg5GOhx0zMC3vSNiZXkaNGmunQ5bRrg +kkwN8laH8j5tSADWFq+trfk2g8FGvC4gzu+8UgT9d4ePU01t0X9A6uQvDM7wyqz1cKojG /M5gO5SDDKlMMtVAYjCVaLphhXKRBPGVObkPbF0G1DI7cW+wjDtMR94beLzTIeZOjsD1/K zkJBFYguDKpn85k6Pteb0WRFDl0VTOJuag1ZsrfrecKn3hAHN9mSezzcvfuNp6z/tIXitF U3HT/2iGWipq2yJ8vXVw23Uol7LA4XNd6BQ1B1OhjMlVFzeKLnOnHCrB0TQa3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672338982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Uq+VDgP2GCx4fruRuFt5OH8nBMJj1XB+C3Uzr7luJPE=; b=shZmGR2SE5Z4pNBfV6yuKU7xAj9wQAyl0oLP6xe/tokJGsO1Qi4se8h4bHWv9JxI1xQccp ZdYCjjDBIoeQmPhJv/TVH5Nekeb5PH+UqeMCMiee5j/f/DmKaUbAgn86n9zL+9W+7TFgpj vQKJbqnmHlgerCy3un4WaWh6gVgi3MfueLOlXEXGKQn2NK2fqTB/3L2f1wCnwmcKm27NUU PJvwADfml5CXM4ZQoNeZNb4dbfl1Cp0gTVL4R6aciH8uOxgs3Lb3HvGx5MNmfDON1BPnAd Jb+U7naCt0dKNnqxTSDHdc2eDn+9Qp+UHAk+Amxlqaj6/mtBwJ8hfljeP1gbcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1672338982; a=rsa-sha256; cv=none; b=aluqGL+wJhITtSmXz3L2qdOsgzf/I8W5n8u6JMqllWdLhqZRVMsZdxGeMHqFDKjl7agNjp YA59jsvusiNf6S1MmR6561VskQZDDYithVo1/KuOonZVvnah+LYBTjMOmYOTymkPp7EpTQ xQHy1crYt1pccE9+7G1dz0q58YJIjFfom5bbeaBrFKWt1nFAg8H+hFuc9wZKnivoUybpB9 bk5tNr1ptg56QdFmnrIASZ2S5+HPN5kg4DpdHWTX7C/9+nhyAbjtL6x8HM2n37hhYIzd22 fYSQM7mU6BVUllvhGUUh6Rcp+wSsNDfTQ+r5ex+iyZCDMzEhzYHdTA+9M4a2Yg== Received: from [IPV6:2601:648:8680:16b0:b93a:926a:c05f:b196] (unknown [IPv6:2601:648:8680:16b0:b93a:926a:c05f:b196]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4NjcY14qQ3zyf9; Thu, 29 Dec 2022 18:36:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Thu, 29 Dec 2022 10:36:19 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: Two observations using GDB 13 snapshot Content-Language: en-US To: Tom Tromey , Eli Zaretskii Cc: gdb-patches@sourceware.org, luis.machado@arm.com References: <83h6xugc5v.fsf@gnu.org> <58b64bf8-90b6-d080-c060-d03761501199@arm.com> <83k02neezy.fsf@gnu.org> <835ye7e9jw.fsf@gnu.org> <87h6xrks77.fsf@tromey.com> <83mt7idacj.fsf@gnu.org> <87fsd4elb2.fsf@tromey.com> <83o7rs4qmg.fsf@gnu.org> <87cz84dasj.fsf@tromey.com> <835ydw20bw.fsf@gnu.org> <87wn6bbi5m.fsf@tromey.com> <83sfgz8m9i.fsf@gnu.org> <87o7rnb0ya.fsf@tromey.com> <83a6368chf.fsf@gnu.org> <87k02aaxc8.fsf@tromey.com> From: John Baldwin In-Reply-To: <87k02aaxc8.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP 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 12/29/22 10:17 AM, Tom Tromey wrote: >>>>>> "Eli" == Eli Zaretskii writes: > > Eli> The profile produced by gprof is attached. The time information looks > Eli> very inaccurate, almost bogus, to me (since GDB ran for more than 2 > Eli> minutes, I expected to see gdb_main show 130 as the value of > Eli> cumulative seconds, but the profile shows only 2.21?). > > Yeah, it looks strange to me as well. I don't think it really shows us > where all the time is going. > > gprof also thinks gdb only ran for a couple of seconds: > >> granularity: each sample hit covers 4 byte(s) for 0.44% of 2.29 seconds > > I wonder if just randomly interrupting gdb a few times during that 2 > minutes and doing a "bt" would be more informative. It wouldn't surprise me if -pg is somewhat broken in modern toolchains and supporting libraries. Profiling nowadays is usually driven by samping using hardware performance counters (like perf on Linux) rather than relying on calls to instrumentation functions like mcount inserted by the compiler. I'm sure Windows has a way to use hardware performance counters as well, but I'm not familiar with how to do it on Windows. -- John Baldwin