From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cluster-a.mailcontrol.com (cluster-a.mailcontrol.com [85.115.52.190]) by sourceware.org (Postfix) with ESMTPS id 0B1E93858023 for ; Thu, 29 Jul 2021 08:18:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0B1E93858023 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=EMEA.NEC.COM Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=EMEA.NEC.COM Received: from mail2.neceur.com (mail2.neceur.com [195.47.207.4]) by rly24a.srv.mailcontrol.com (MailControl) with ESMTPS id 16T8IWes013820 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 29 Jul 2021 09:18:32 +0100 Received: from intmail2.neceur.com (intmail2.neceur.com [172.29.177.11]) by mail2.neceur.com (8.15.2/8.15.2/SUSE Linux 0.8) with ESMTP id 16T8IWse031781; Thu, 29 Jul 2021 09:18:32 +0100 Received: from av1.neceur.com (av1.neceur.com [172.29.14.21]) by intmail2.neceur.com (8.14.7/8.14.7) with ESMTP id 16T8IWcx025025; Thu, 29 Jul 2021 09:18:32 +0100 Received: from av1.neceur.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8F7EE18045; Thu, 29 Jul 2021 09:18:32 +0100 (BST) Received: from av1.neceur.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7AA401803F; Thu, 29 Jul 2021 09:18:32 +0100 (BST) Received: from EUX13SRV2.EU.NEC.COM (unknown [172.29.155.139]) by av1.neceur.com (Postfix) with ESMTPS; Thu, 29 Jul 2021 09:18:32 +0100 (BST) Received: from EUX13SRV2.EU.NEC.COM (172.29.155.139) by EUX13SRV2.EU.NEC.COM (172.29.155.139) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 29 Jul 2021 09:18:32 +0100 Received: from EUX13SRV2.EU.NEC.COM ([172.29.155.139]) by EUX13SRV2.EU.NEC.COM ([172.29.155.139]) with mapi id 15.00.1497.015; Thu, 29 Jul 2021 09:18:32 +0100 From: Christian Weiss To: Florian Weimer CC: "libc-help@sourceware.org" , Felix Uhl Subject: RE: Runtime discrepancy clock_gettime + funcition instrumentation Thread-Topic: Runtime discrepancy clock_gettime + funcition instrumentation Thread-Index: AdeER+88iVjHeyDJSciWrhGLYZ+sTQAA+EpDAAGGYQA= Date: Thu, 29 Jul 2021 08:18:31 +0000 Message-ID: References: <5175db58f09c413b9c652d5dc45a2248@EUX13SRV2.EU.NEC.COM> <87fsvx60f0.fsf@oldenburg.str.redhat.com> In-Reply-To: <87fsvx60f0.fsf@oldenburg.str.redhat.com> Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [172.29.208.56] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1600-8.1.0.1054-22232.006 X-TMASE-Version: IMSVA-9.1.0.1600-8.1.1054-22232.006 X-TMASE-Result: 10--4.303600-10.000000 X-TMASE-MatchedRID: QW5G6BKkLTqYLyCLOSg+w6wOh3D3JSTGtfZHDDhfIFf1yiN1CBWeTXkp qtxSuc3w/H13OX809ggb6VSvua1C1xnu1nyuwPwz4pdq9sdj8LUZ9kiZvd+oBFpbYq2f4jz+UUV TX6QzIH1CAtI/Ra43tyFELzKw/rWnG51z9C+MFUOVUcz8XpiS9LqG2KtuLD8bqr3CBdU3C2Dipc MW7hbdxfH1bvUxus1neJjR+ZC+4GaQJG5jUgOzA+YAh37ZsBDC4wHGXjSYGPfnBDF/TMnTXts1C HzkaGoimtHmBLTOXoXvRCbdheTpLEOrZJUSTvYoC24oEZ6SpSmb4wHqRpnaDvCiVKr+g97WUKRE 8nYToaKOmLVKEyku30mb3zDEuR6Cw506yvimVnT9MGLSEBaeX1R8pYW4BQFYZ4QGVBik/K9bp7g p9+yBWhv42euufPAaBldfwMjvRdUXBW1Ofw+P6qpRyloQ8+z8VuGAHHweLts= X-TMASE-SNAP-Result: 1.811037.0001-0-1-12:0,22:0,34:0,39:0-0 X-MailControl-OutInfo: MTYyNzU0NjcxNTpGUEtleTEucHJpdjrCdufq0HX7I7R6Aq4mVCBPElKQ6Fnm0FmF+4/QRAdFluJeRp2n6zPB4P8NvHbdxK6CaFHCOgWL0CoHy9J9gM3l3U3dyLYYbyH2sIuGFBn9fPLTHAwFiT1i5lDJwy0mIAQnAN5BuMX4zuQYw539GT7N6aIzsrlEH73C/scH/+XfEd7KZvCNI4TBGMUtDy1dMXArTb2AdpMfWB1DhUHpTT0NvT0ZE8Wwu2MwWkZDL3nmv2QmljdGY9r0egqTN8O7zO3P/GEbKopztrphH8GeIs1R95ecZeY5RsaZFs2JggPpsWVZu4wECEZ+det9+q/UI0TxSOiKyWKiZZM9Mmh9BFc+ X-Scanned-By: MailControl 44278.2116 (www.mailcontrol.com) on 10.65.0.134 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2021 08:18:41 -0000 Dear Florian, Thank you for the quick reply. As far as I understand, I can check if vdso = is used by using strace on the binary. Doing so I get: ```[cweiss@amd022 overhead]$ strace ./test_time_static_gcc.x 1 2>&1 | grep = -i clock_gettime clock_gettime(CLOCK_MONOTONIC, {tv_sec=3D89045, tv_nsec=3D95268751}) =3D 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3D89145, tv_nsec=3D95813405}) =3D 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3D89145, tv_nsec=3D95863144}) =3D 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3D89145, tv_nsec=3D95933573}) =3D 0 [cweiss@amd022 overhead]$ strace ./test_time_dyn_gcc.x 1 2>&1 | grep -i clo= ck_gettime``` Am I right that this implies that vdso is not used in the static binary, bu= t in the dynamic one? Is there a way to activate it in the static case or d= o I just have to live with that? Best regards, Christian -----Original Message----- From: Florian Weimer [mailto:fweimer@redhat.com]=20 Sent: 29 July 2021 09:32 To: Christian Weiss Cc: libc-help@sourceware.org; Felix Uhl Subject: Re: Runtime discrepancy clock_gettime + funcition instrumentation * Christian Weiss: > Measuring the runtime, the static binary takes about five times more time= to finish than the dynamic one. I do not yet understand this observation: > > [cweiss@amd022 overhead]$ time ./test_time_static_gcc.x 10000000 > sum: 49999995000000 > real 0m2.594s > user 0m0.396s > sys 0m2.197s > [cweiss@amd022 overhead]$ time ./test_time_dyn_gcc.x 10000000 > sum: 49999995000000 > > real 0m0.518s > user 0m0.515s > sys 0m0.002s Have you checked that the statically linked version uses vDSO acceleration = instead of system calls? Thanks, Florian Click https://www.mailcontrol.com/sr/fIQaiVcf9cfGX2PQPOmvUg0Q1FXI7Aabn0rrn= rkHFzjvcdFTukB4r3gIRLMubDcYTms2r1hgqRkeq4Nrivo6iw=3D=3D to report this ema= il as spam.