From patchwork Fri Oct 25 12:08:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 177735 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3602352ill; Fri, 25 Oct 2019 05:09:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHLDX2nXT63C95TgQRIAkrEh2oV5lQa07XzftXsxiAg1kXNybTfwKzrhYnJFRFiRDqTv/M X-Received: by 2002:a17:906:a94e:: with SMTP id hh14mr3169629ejb.164.1572005381582; Fri, 25 Oct 2019 05:09:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572005381; cv=none; d=google.com; s=arc-20160816; b=b39LuNlf3pkD7lIRZTFvQudOgyV9/4XhiRm0n0YC/r/AIC3bCG5CwOwr5RLJnHqXkA wJNWhGJXrTaMyt/lRQ1LnPPRIqAH/hc75FEl8o03EcmYp3J9/QVLE3SRqNuSwgSeGZnh gLV8O9vWVlhmvYn+oVVwSrzV/NIVxYiGsQYEEYVC/pw7O+IdAFy6ovbmyGIc8ka+IWAD mQZYSnyJHR9TAlcLQfHke3pS3Vzmr2EpGScoBVVDUnFulVAsvaNE1ixxjFwuW3ZA1C5t Uz0M86AzQdkgtt/6zQPRn8n4WxSW7GjWffVKI0ZDmZqqNs9Mf+jJpgsnEO7Xbxq7Tqud oysw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=jPPhegz/ZbxNQvefzP77OPmwFiVKWjkgPWTWs/wtmB4=; b=D9SAkzgSW6D7k8rYUNVqYJuO9+IvrufBWumDy5GlntJ1ajzoFh/HurzaxFCCJqPR33 LcNLrWEH2tm6TL1FujMZh7OJ+x0odrnYqQWJfK54RH4aK5ZLdaE6wsVS221E/R5IT0B7 3MU3xea/LHqPc4sKTh0w3z/m35wjZN2HqOi5eKrXRI/P0oFlnU/o6Yln1jNljMMZ30GK KUHMT/xlDw8/qtacODnK1uvxtf+CpfqGqEX8Qz281KIt3B1j0aul6uUKUggjGQdpWskR YWs5tkZCvPvAy85oiuBvTEdm/OBuxl2wKTSNfRKYljd3Q6VxpIygGg8JYqvKRFhQI7wm C2wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=TjQY6i6g; dkim=pass header.i=@linaro.org header.s=google header.b="djC/tlQ1"; spf=pass (google.com: domain of libc-alpha-return-106285-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-106285-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id g13si1096056eda.292.2019.10.25.05.09.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Oct 2019 05:09:41 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-106285-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=TjQY6i6g; dkim=pass header.i=@linaro.org header.s=google header.b="djC/tlQ1"; spf=pass (google.com: domain of libc-alpha-return-106285-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-106285-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=MmdnbDcowVoiiKLUBnWvNgHQYruqezk MkhwB6L1zf1elzBN/i5EUKqWev0xTrwvan5PSF0yWgea/wH0O0/vE3QASvXXZMIB +7uzDmvOcxhZlEQJRyzxuLtFBuqBAMn8BLCmeMa/pUtNouiJWX0NA8CqoZ9PczLH 2grX2lTlFWbo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=9plo7Du3GL5U2zu9oeIZoj9RJ+o=; b=TjQY6 i6gSHNCxF/3Nr8Jp42QOQrpuNFy9xpWzTv6eg/aWDNTphIUALlFbewfGyvuYDMv5 +MWnfVLoa9XqAxAVWp4RG86WTAGEPFeHKE7dOflvfI841Sdt+w3rgdONcEOj54hX nGFjGpA2poQlVv02ZD5ZuPJubSTKMeUwJWhy24= Received: (qmail 77663 invoked by alias); 25 Oct 2019 12:08:56 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 77553 invoked by uid 89); 25 Oct 2019 12:08:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-qk1-f196.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jPPhegz/ZbxNQvefzP77OPmwFiVKWjkgPWTWs/wtmB4=; b=djC/tlQ1wnEBdTbVp8Lwy5/kmqRobx52aVcD88HE9q+eiWxQ9s3xTOtcgUWbDurcOg 7DvdjaAEuY3krx4rKcRMsm1AE+K8Wz6RPIOSo92Wd80W6PG6svTllNzzGQ8BG6/dG8Lb 8Pk/3+YhWPXzEf55ojLDetCRenb1GvgUEBNq9iqwF/qh+j5owYDT5QYmMlBBPtJymK+N 5rF59h37rCSIQnAZWc4bbiQd8+e/SkG6+tJ4VZ5M37t4VC1avN8aypYjThVC4iGQ+SH3 /NJm9l57B5APDCuv2V3C+3o8R/td6fe4GGgxOtVgIChG3siStUV+2RfJjn03+H5WbxsU i8wA== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Lukasz Majewski Subject: [PATCH v2 05/11] Use clock_gettime to implement time. Date: Fri, 25 Oct 2019 09:08:26 -0300 Message-Id: <20191025120832.27667-6-adhemerval.zanella@linaro.org> In-Reply-To: <20191025120832.27667-1-adhemerval.zanella@linaro.org> References: <20191025120832.27667-1-adhemerval.zanella@linaro.org> Use clock_gettime to implement time. Changes from previous version: - Do not remove Linux arch-specific implementations. - Use CLOCK_REALTIME_COARSE for Linux. -- Change the default implementation of time to call clock_gettime, to align with new Linux ports that are expected to only implement __NR_clock_gettime. Arch-specific implementation that either call the time vDSO or route to gettimeofday vDSO are not removed. Also for Linux, CLOCK_REALTIME_COARSE is used instead of generic CLOCK_REALTIME clockid. This takes less CPU time and its behavior better matches what the current glibc does. Checked on x86_64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu, powerpc64-linux-gnu, powerpc-linux-gnu, and aarch64-linux-gnu. Co-authored-by: Zack Weinberg --- sysdeps/unix/sysv/linux/powerpc/time.c | 2 +- .../sysv/linux/{time.c => time-internal.h} | 31 ++++--------------- sysdeps/posix/time.c => time/time-internal.h | 28 +++-------------- time/time.c | 13 ++++---- 4 files changed, 17 insertions(+), 57 deletions(-) rename sysdeps/unix/sysv/linux/{time.c => time-internal.h} (64%) rename sysdeps/posix/time.c => time/time-internal.h (57%) -- 2.17.1 Reviewed-by: Lukasz Majewski diff --git a/sysdeps/unix/sysv/linux/powerpc/time.c b/sysdeps/unix/sysv/linux/powerpc/time.c index c35b80fad1..e957b81751 100644 --- a/sysdeps/unix/sysv/linux/powerpc/time.c +++ b/sysdeps/unix/sysv/linux/powerpc/time.c @@ -78,6 +78,6 @@ libc_hidden_def (time) #else -#include +#include