From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel,gmane.comp.lib.gnulib.bugs Subject: Re: boot-time: straighten code Date: Sat, 12 Aug 2023 19:49:04 -0700 Organization: UCLA Computer Science Department Message-ID: <5a77c0b9-8692-83bf-1aca-2f1d27122877@cs.ucla.edu> References: <4536176.VaOIPsP7d9@nimes> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------lDeJQUo04XOjgNsiqaCj609R" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37235"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: bug-gnulib@gnu.org, Emacs Development To: Bruno Haible Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Aug 13 04:49:46 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qV1Ao-0009Uc-6J for ged-emacs-devel@m.gmane-mx.org; Sun, 13 Aug 2023 04:49:46 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qV1AL-0001ND-Gj; Sat, 12 Aug 2023 22:49:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qV1AI-0001Lj-2t; Sat, 12 Aug 2023 22:49:14 -0400 Original-Received: from mail.cs.ucla.edu ([131.179.128.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qV1AD-0004cl-5G; Sat, 12 Aug 2023 22:49:13 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id E95543C011BD6; Sat, 12 Aug 2023 19:49:06 -0700 (PDT) Original-Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id os1_Z4srQUMu; Sat, 12 Aug 2023 19:49:05 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 10A0B3C011BD7; Sat, 12 Aug 2023 19:49:05 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 10A0B3C011BD7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1691894945; bh=NRv4oOw34hNhgyo8RmAmqCVycQJzY1wYTIn0KjtGR9c=; h=Message-ID:Date:MIME-Version:To:From; b=O1+k0kumUHCHMazHvHSe3fxXlX36EfZg3NXxi6Q0wOh/Tcj/VklAnR5cYP25p2BQ2 GJu+l2U7tBFJhW3rR/YftMirhTrzINAuFJFh/D1kjaTtZQyFEIHX494lIHArIIIi85 tYnpUQETVlHflm4bQqYiZYEPv6CUdMFVh26pJucn9NDczJo98/433Bq5F+W2Suanxb pzD94juJ2NAmXK0/rVO1oL5GZeZdB02Z6qrASr7gODtNZZ7XBby12AniU76gLw3O+A mU0YmTKn3drOuG07Kwthcr3INfJ8a7QFyjSOV6eFyuru4LCixcsgNiCWfQsYHNGRJa wE3Ppz8mIgvVQ== X-Virus-Scanned: amavisd-new at mail.cs.ucla.edu Original-Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 78yFly0qOjEE; Sat, 12 Aug 2023 19:49:04 -0700 (PDT) Original-Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id C2DBF3C011BD6; Sat, 12 Aug 2023 19:49:04 -0700 (PDT) Content-Language: en-US In-Reply-To: <4536176.VaOIPsP7d9@nimes> Received-SPF: pass client-ip=131.179.128.66; envelope-from=eggert@cs.ucla.edu; helo=mail.cs.ucla.edu X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, NICE_REPLY_A=-0.972, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:308639 gmane.comp.lib.gnulib.bugs:48169 Archived-At: This is a multi-part message in MIME format. --------------lDeJQUo04XOjgNsiqaCj609R Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2023-08-11 14:49, Bruno Haible wrote: > Paul: With this simplification, you may consider using the 'boot-time' module > in Emacs. I bet that it produces a better result than Emacs' src/filelock.c > on many platforms. (I haven't tested it, but I could test it if you give me > a manual testing recipe.) Thanks for doing all that. I installed the attached patch into Emacs master, which you should be able to test via: git clone https://git.savannah.gnu.org/git/emacs.git cd emacs ./autogen.sh ./configure make src/emacs Please give it a try, especially on any MS-Windows platform you happen to have. I have tested only on Ubuntu 23.04 so far. A simple way to test is to use Emacs to start editing a file (without saving) and then inspect the symbolic link .#* that Emacs uses as a lock file. The trailing digits of that link's contents should be the boot time. These symlinks are Emacs's only use of boot time. --------------lDeJQUo04XOjgNsiqaCj609R Content-Type: text/x-patch; charset=UTF-8; name="0001-Improve-boot-time-gathering.patch" Content-Disposition: attachment; filename="0001-Improve-boot-time-gathering.patch" Content-Transfer-Encoding: base64 RnJvbSA1ZTczNmNhNmNjZmExMzE3MzZhYjBiM2EyOThkZTJjYjMxOWU3ZGZiIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIEVnZ2VydCA8ZWdnZXJ0QGNzLnVjbGEuZWR1 PgpEYXRlOiBTYXQsIDEyIEF1ZyAyMDIzIDE5OjM5OjExIC0wNzAwClN1YmplY3Q6IFtQQVRD SF0gSW1wcm92ZSBib290LXRpbWUgZ2F0aGVyaW5nCk1JTUUtVmVyc2lvbjogMS4wCkNvbnRl bnQtVHlwZTogdGV4dC9wbGFpbjsgY2hhcnNldD1VVEYtOApDb250ZW50LVRyYW5zZmVyLUVu Y29kaW5nOiA4Yml0CgpTaW1wbGlmeSBFbWFjcyBwcm9wZXIgYnkgdXNpbmcgR251bGli4oCZ cyBib290LXRpbWUgbW9kdWxlCmluc3RlYWQgb2YgZG9pbmcgaXQgYWxsIGJ5IGhhbmQuICBU aGlzIHNob3VsZCBwb3J0IEVtYWNzCmJldHRlciB0byBvYnNjdXJpc2ggaG9zdHMsIGFzIEJy dW5vIEhhaWJsZSBoYXMgbWVyZ2VkIHRoZQpiZXN0IG9mIEVtYWNz4oCZcyBhbmQgR251bGli 4oCZcyBib290LXRpbWUgZ2F0aGVyaW5nLgoqIGxpYi9ib290LXRpbWUtYXV4LmgsIGxpYi9i b290LXRpbWUuYywgbGliL2Jvb3QtdGltZS5oOgoqIGxpYi9yZWFkdXRtcC5oLCBtNC9yZWFk dXRtcC5tNDogTmV3IGZpbGVzLCBjb3BpZWQgZnJvbSBHbnVsaWIuCiogYWRtaW4vbWVyZ2Ut Z251bGliIChHTlVMSUJfTU9EVUxFUyk6IEFkZCBib290LXRpbWUuCiogY29uZmlndXJlLmFj OiBEbyBub3QgY2hlY2sgZm9yIHV0bXAuaDsKdGhlIGJvb3QtdGltZSBtb2R1bGUgbm93IGRv ZXMgdGhpcy4KKEJPT1RfVElNRV9GSUxFKTogUmVtb3ZlOyBubyBsb25nZXIgdXNlZC4KKiBs aWIvZ251bGliLm1rLmluLCBtNC9nbnVsaWItY29tcC5tNDogUmVnZW5lcmF0ZS4KKiBzcmMv ZmlsZWxvY2suYyBbX19GcmVlQlNEX19dOiBEbyBub3QgaW5jbHVkZSA8c3lzL3N5c2N0bC5o Pi4KW0hBVkVfVVRNUF9IXTogRG8gbm90IGluY2x1ZGUgdXRtcC5oLgpJbmNsdWRlIGJvb3Qt dGltZSBpbnN0ZWFkOiBib290LXRpbWUgZG9lcyB0aGUgd29yayBub3cuCihCT09UX1RJTUUp IFtIQVZFX0FORFJPSUQgJiYgIUFORFJPSURfU1RVQklGWV06IERvbuKAmXQgdW5kZWYuCihX VE1QX0ZJTEUpOiBEb27igJl0IGRlZmluZS4KKGJvb3RfdGltZSwgYm9vdF90aW1lX2luaXRp YWxpemVkLCBnZXRfYm9vdF90aW1lXzEsIGdldF9ib290X3RpbWUpOgpSZW1vdmUuCihnZXRf Ym9vdF9zZWMpOiBOZXcgZnVuY3Rpb24gdGhhdCBzaW1wbHkgY2FsbHMgR251bGliIGdldF9i b290X3RpbWUuCihsb2NrX2ZpbGVfMSwgY3VycmVudF9sb2NrX293bmVyKTogVXNlIGdldF9i b290X3NlYyBpbnN0ZWFkCm9mIGdldF9ib290X3RpbWUuCi0tLQogYWRtaW4vbWVyZ2UtZ251 bGliICB8ICAgMiArLQogY29uZmlndXJlLmFjICAgICAgICB8ICA0NyArLS0tLS0tCiBsaWIv Ym9vdC10aW1lLWF1eC5oIHwgMzE1ICsrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr KysrKysrKysrKwogbGliL2Jvb3QtdGltZS5jICAgICB8IDI4NSArKysrKysrKysrKysrKysr KysrKysrKysrKysrKysrKysrKys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oZSB1cHRpbWUgYW5kIHRoZSBpZGxlIHRpbWUuICAqLworICAgICAg ICAgIHRpbWVfdCBzID0gMDsKKyAgICAgICAgICBjaGFyICpwOworICAgICAgICAgIGZvciAo cCA9IGJ1ZjsgJzAnIDw9ICpwICYmICpwIDw9ICc5JzsgcCsrKQorICAgICAgICAgICAgcyA9 IDEwICogcyArICgqcCAtICcwJyk7CisgICAgICAgICAgaWYgKGJ1ZiA8IHApCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIGxvbmcgbnMgPSAwOworICAgICAgICAgICAgICBpZiAo KnArKyA9PSAnLicpCisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCA5OyBp KyspCisgICAgICAgICAgICAgICAgICBucyA9IDEwICogbnMgKyAoJzAnIDw9ICpwICYmICpw IDw9ICc5JyA/ICpwKysgLSAnMCcgOiAwKTsKKyAgICAgICAgICAgICAgcF91cHRpbWUtPnR2 X3NlYyA9IHM7CisgICAgICAgICAgICAgIHBfdXB0aW1lLT50dl9uc2VjID0gbnM7CisgICAg ICAgICAgICAgIHJldHVybiAwOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQor IyBlbmRpZgorCisgIC8qIFRoZSBzeXNpbmZvIGNhbGwgcmV0dXJucyB0aGUgdXB0aW1lIHdp dGggYSByZXNvbHV0aW9uIG9mIDEgc2VjIG9ubHkuICAqLworICBzdHJ1Y3Qgc3lzaW5mbyBp bmZvOworICBpZiAoc3lzaW5mbyAoJmluZm8pID49IDApCisgICAgeworICAgICAgcF91cHRp bWUtPnR2X3NlYyA9IGluZm8udXB0aW1lOworICAgICAgcF91cHRpbWUtPnR2X25zZWMgPSAw OworICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgIHJldHVybiAtMTsKK30KKworI2VuZGlm CisKKyNpZiBkZWZpbmVkIF9fbGludXhfXyAmJiAhZGVmaW5lZCBfX0FORFJPSURfXworCitz dGF0aWMgaW50CitnZXRfbGludXhfYm9vdF90aW1lX2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VjX2dl dCAoJnJlc3VsdCwgVElNRV9VVEMpKQorICAgICAgICByZXR1cm4gLTE7CisjICBlbHNlCisg ICAgICAvKiBGYWxsIGJhY2sgb24gbG93ZXItcmVzIGFwcHJvYWNoIHRoYXQgZG9lcyBub3Qg bmVlZCAtbHJ0LgorICAgICAgICAgVGhpcyBpcyBnb29kIGVub3VnaDsgb24gdGhlc2UgaG9z dHMgVVBUSU1FIGlzIGV2ZW4gbG93ZXItcmVzLiAgKi8KKyAgICAgIHN0cnVjdCB0aW1ldmFs IHR2OworICAgICAgaW50IHIgPSBnZXR0aW1lb2ZkYXkgKCZ0diwgTlVMTCk7CisgICAgICBp ZiAociA8IDApCisgICAgICAgIHJldHVybiByOworICAgICAgcmVzdWx0LnR2X3NlYyA9IHR2 LnR2X3NlYzsKKyAgICAgIHJlc3VsdC50dl9uc2VjID0gdHYudHZfdXNlYyAqIDEwMDA7Cisj ICBlbmRpZgorCisgICAgICBpZiAocmVzdWx0LnR2X25zZWMgPCB1cHRpbWUudHZfbnNlYykK KyAgICAgICAgeworICAgICAgICAgIHJlc3VsdC50dl9uc2VjICs9IDEwMDAwMDAwMDA7Cisg ICAgICAgICAgcmVzdWx0LnR2X3NlYyAtPSAxOworICAgICAgICB9CisgICAgICByZXN1bHQu dHZfc2VjIC09IHVwdGltZS50dl9zZWM7CisgICAgICByZXN1bHQudHZfbnNlYyAtPSB1cHRp bWUudHZfbnNlYzsKKyAgICAgICpwX2Jvb3RfdGltZSA9IHJlc3VsdDsKKyAgICAgIHJldHVy biAwOworICAgIH0KKyAgcmV0dXJuIC0xOworfQorCisjZW5kaWYKKworI2lmIGRlZmluZWQg X19BTkRST0lEX18KKworc3RhdGljIGludAorZ2V0X2FuZHJvaWRfYm9vdF90aW1lIChzdHJ1 Y3QgdGltZXNwZWMgKnBfYm9vdF90aW1lKQoreworICAvKiBPbiBBbmRyb2lkLCB0aGVyZSBp cyBubyAvdmFyLCBhbmQgbm9ybWFsIHByb2Nlc3NlcyBkb24ndCBoYXZlIGFjY2VzcworICAg ICB0byBzeXN0ZW0gZmlsZXMuICBUaGVyZWZvcmUgdXNlIHRoZSBrZXJuZWwncyB1cHRpbWUg Y291bnRlciwgYWx0aG91Z2gKKyAgICAgaXQgcHJvZHVjZXMgd3JvbmcgdmFsdWVzIGFmdGVy IHRoZSBkYXRlIGhhcyBiZWVuIGJ1bXBlZCBpbiB0aGUgcnVubmluZworICAgICBzeXN0ZW0u ICAqLworICBzdHJ1Y3QgdGltZXNwZWMgdXB0aW1lOworICBpZiAoZ2V0X2xpbnV4X3VwdGlt ZSAoJnVwdGltZSkgPj0gMCkKKyAgICB7CisgICAgICBzdHJ1Y3QgdGltZXNwZWMgcmVzdWx0 OworICAgICAgaWYgKGNsb2NrX2dldHRpbWUgKENMT0NLX1JFQUxUSU1FLCAmcmVzdWx0KSA+ PSAwKQorICAgICAgICB7CisgICAgICAgICAgaWYgKHJlc3VsdC50dl9uc2VjIDwgdXB0aW1l LnR2X25zZWMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHJlc3VsdC50dl9uc2Vj ICs9IDEwMDAwMDAwMDA7CisgICAgICAgICAgICAgIHJlc3VsdC50dl9zZWMgLT0gMTsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgICByZXN1bHQudHZfc2VjIC09IHVwdGltZS50dl9zZWM7 CisgICAgICAgICAgcmVzdWx0LnR2X25zZWMgLT0gdXB0aW1lLnR2X25zZWM7CisgICAgICAg ICAgKnBfYm9vdF90aW1lID0gcmVzdWx0OworICAgICAgICAgIHJldHVybiAwOworICAgICAg ICB9CisgICAgfQorICByZXR1cm4gLTE7Cit9CisKKyNlbmRpZgorCisjaWYgZGVmaW5lZCBf X09wZW5CU0RfXworCitzdGF0aWMgaW50CitnZXRfb3BlbmJzZF9ib290X3RpbWUgKHN0cnVj dCB0aW1lc3BlYyAqcF9ib290X3RpbWUpCit7CisgIC8qIE9uIE9wZW5CU0QsIFVUTVBfRklM RSBpcyBub3QgZmlsbGVkLiAgSXQgY29udGFpbnMgb25seSBkdW1teSBlbnRyaWVzLgorICAg ICBTbywgZ2V0IHRoZSB0aW1lIHN0YW1wIG9mIGEgZmlsZSB0aGF0IGdldHMgdG91Y2hlZCBv bmx5IGR1cmluZyB0aGUKKyAgICAgYm9vdCBwcm9jZXNzLiAgKi8KKyAgY29uc3QgY2hhciAq IGNvbnN0IGJvb3RfdG91Y2hlZF9maWxlc1tdID0KKyAgICB7CisgICAgICAiL3Zhci9kYi9o b3N0LnJhbmRvbSIsCisgICAgICAiL3Zhci9ydW4vdXRtcCIKKyAgICB9OworICBmb3IgKGlk eF90IGkgPSAwOyBpIDwgU0laRU9GIChib290X3RvdWNoZWRfZmlsZXMpOyBpKyspCisgICAg eworICAgICAgY29uc3QgY2hhciAqZmlsZW5hbWUgPSBib290X3RvdWNoZWRfZmlsZXNbaV07 CisgICAgICBzdHJ1Y3Qgc3RhdCBzdGF0YnVmOworICAgICAgaWYgKHN0YXQgKGZpbGVuYW1l LCAmc3RhdGJ1ZikgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgICpwX2Jvb3RfdGltZSA9 IGdldF9zdGF0X210aW1lICgmc3RhdGJ1Zik7CisgICAgICAgICAgcmV0dXJuIDA7CisgICAg ICAgIH0KKyAgICB9CisgIHJldHVybiAtMTsKK30KKworI2VuZGlmCisKKyNpZiBIQVZFX1NZ U19TWVNDVExfSCAmJiBIQVZFX1NZU0NUTCBcCisgICAgJiYgZGVmaW5lZCBDVExfS0VSTiAm JiBkZWZpbmVkIEtFUk5fQk9PVFRJTUUgXAorICAgICYmICFkZWZpbmVkIF9fbWluaXgKKy8q IG1hY09TLCBGcmVlQlNELCBHTlUva0ZyZWVCU0QsIE5ldEJTRCwgT3BlbkJTRCAqLworLyog T24gTWluaXggMy4zIHRoaXMgc3lzY3RsIHByb2R1Y2VzIGdhcmJhZ2UgcmVzdWx0cy4gIFRo ZXJlZm9yZSBhdm9pZCBpdC4gICovCisKKy8qIFRoZSBmb2xsb3dp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3RfdGltZSA9IHRzOworCisjICAgaWYgZGVmaW5lZCBfX2xpbnV4X18gJiYgIWRlZmlu ZWQgX19BTkRST0lEX18KKyAgICAgIGlmIChtZW1jbXAgKFVUX1VTRVIgKHV0KSwgInJ1bmxl dmVsIiwgc3RybGVuICgicnVubGV2ZWwiKSArIDEpID09IDAKKyAgICAgICAgICAmJiBtZW1j bXAgKHV0LT51dF9saW5lLCAifiIsIHN0cmxlbiAoIn4iKSArIDEpID09IDApCisgICAgICAg IHJ1bmxldmVsX3RzID0gdHM7CisjICAgZW5kaWYKKyMgICBpZiBkZWZpbmVkIF9fbWluaXgK KyAgICAgIGlmIChVVF9VU0VSICh1dClbMF0gPT0gJ1wwJworICAgICAgICAgICYmIG1lbWNt cCAodXQtPnV0X2xpbmUsICJydW4tbGV2ZWwgIiwgc3RybGVuICgicnVuLWxldmVsICIpKSA9 PSAwKQorICAgICAgICBydW5sZXZlbF90cyA9IHRzOworIyAgIGVuZGlmCisgICAgfQorCisg IEVORF9VVE1QX0VOVCAoKTsKKworIyAgIGlmIGRlZmluZWQgX19saW51eF9fICYmICFkZWZp bmVkIF9fQU5EUk9JRF9fCisgIC8qIE9uIFJhc3BiaWFuLCB3aGljaCBydW5zIG9uIGhhcmR3 YXJlIHdpdGhvdXQgYSByZWFsLXRpbWUgY2xvY2ssIGR1cmluZyBib290LAorICAgICAgIDEu IHRoZSBjbG9jayBnZXRzIHNldCB0byAxOTcwLTAxLTAxIDAwOjAwOjAwLAorICAgICAgIDIu IGFuIGVudHJ5IGdldHMgd3JpdHRlbiBpbnRvIC92YXIvcnVuL3V0bXAsIHdpdGggdXRfdHlw ZSA9IEJPT1RfVElNRSwKKyAgICAgICAgICB1dF91c2VyID0gInJlYm9vdCIsIHV0X2xpbmUg PSAifiIsIHRpbWUgPSAxOTcwLTAxLTAxIDAwOjAwOjA1IG9yIHNvLAorICAgICAgIDMuIHRo ZSBjbG9jayBnZXRzIHNldCB0byBhIGNvcnJlY3QgdmFsdWUgdGhyb3VnaCBOVFAsCisgICAg ICAgNC4gYW4gZW50cnkgZ2V0cyB3cml0dGVuIGludG8gL3Zhci9ydW4vdXRtcCwgd2l0aAor ICAgICAgICAgIHV0X3VzZXIgPSAicnVubGV2ZWwiLCB1dF9saW5lID0gIn4iLCB0aW1lID0g Y29ycmVjdCB2YWx1ZS4KKyAgICAgSW4gdGhpcyBjYXNlLCBnZXQgdGhlIHRpbWUgZnJvbSB0 aGUgInJ1bmxldmVsIiBlbnRyeS4gICovCisKKyAgLyogV29ya2Fyb3VuZCBmb3IgUmFzcGJp YW46ICAqLworICBpZiAoZm91bmRfYm9vdF90aW1lLnR2X3NlYyA8PSA2MCAmJiBydW5sZXZl bF90cy50dl9zZWMgIT0gMCkKKyAgICBmb3VuZF9ib290X3RpbWUgPSBydW5sZXZlbF90czsK KyAgaWYgKGZvdW5kX2Jvb3RfdGltZS50dl9zZWMgPT0gMCkKKyAgICB7CisgICAgICAvKiBX b3JrYXJvdW5kIGZvciBBbHBpbmUgTGludXg6ICAqLworICAgICAgZ2V0X2xpbnV4X2Jvb3Rf dGltZV9mYWxsYmFjayAoJmZvdW5kX2Jvb3RfdGltZSk7CisgICAgfQorIyAgIGVuZGlmCisK KyMgICBpZiBkZWZpbmVkIF9fQU5EUk9JRF9fCisgIGlmIChmb3VuZF9ib290X3RpbWUudHZf c2VjID09IDApCisgICAgeworICAgICAgLyogV29ya2Fyb3VuZCBmb3IgQW5kcm9pZDogICov CisgICAgICBnZXRfYW5kcm9pZF9ib290X3RpbWUgKCZmb3VuZF9ib290X3RpbWUpOworICAg IH0KKyMgICBlbmRpZgorCisjICAgaWYgZGVmaW5lZCBfX21pbml4CisgIC8qIE9uIE1pbml4 LCBkdXJpbmcgYm9vdCwKKyAgICAgICAxLiBhbiBlbnRyeSBnZXRzIHdyaXR0ZW4gaW50byAv dmFyL3J1bi91dG1wLCB3aXRoIHV0X3R5cGUgPSBCT09UX1RJTUUsCisgICAgICAgICAgdXRf dXNlciA9ICIiLCB1dF9saW5lID0gInN5c3RlbSBib290IiwgdGltZSA9IDE5NzAtMDEtMDEg MDA6MDA6MDAsCisgICAgICAgMi4gYW4gZW50cnkgZ2V0cyB3cml0dGVuIGludG8gL3Zhci9y dW4vdXRtcCwgd2l0aAorICAgICAgICAgIHV0X3VzZXIgPSAiIiwgdXRfbGluZSA9ICJydW4t bGV2ZWwgbSIsIHRpbWUgPSBjb3JyZWN0IHZhbHVlLgorICAgICBJbiB0aGlzIGNhc2UsIGNv cHkgdGhlIHRpbWUgZnJvbSB0aGUgInJ1bi1sZXZlbCBtIiBlbnRyeSB0byB0aGUKKyAgICAg InN5c3RlbSBib290IiBlbnRyeS4gICovCisgIGlmIChmb3VuZF9ib290X3RpbWUudHZfc2Vj IDw9IDYwICYmIHJ1bmxldmVsX3RzLnR2X3NlYyAhPSAwKQorICAgIGZvdW5kX2Jvb3RfdGlt ZSA9IHJ1bmxldmVsX3RzOworIyAgIGVuZGlmCisKKyMgIGVsc2UgLyogSFAtVVgsIEhhaWt1 ICovCisKKyAgRklMRSAqZiA9IGZvcGVuIChVVE1QX0ZJTEUsICJyZSIpOworCisgIGlmIChm ICE9IE5VTEwpCisgICAgeworICAgICAgZm9yICg7OykKKyAgICAgICAgeworICAgICAgICAg IHN0cnVjdCBVVE1QX1NUUlVDVF9OQU1FIHV0OworCisgICAgICAgICAgaWYgKGZyZWFkICgm dXQsIHNpemVvZiB1dCwgMSwgZikgPT0gMCkKKyAgICAgICAgICAgIGJyZWFrOworCisgICAg ICAgICAgc3RydWN0IHRpbWVzcGVjIHRzID0KKyAgICAgICAgICAgICNpZiAoSEFWRV9VVE1Q WF9IID8gMSA6IEhBVkVfU1RSVUNUX1VUTVBfVVRfVFYpCisgICAgICAgICAgICB7IC50dl9z ZWMgPSB1dC51dF90di50dl9zZWMsIC50dl9uc2VjID0gdXQudXRfdHYudHZfdXNlYyAqIDEw MDAgfTsKKyAgICAgICAgICAgICNlbHNlCisgICAgICAgICAgICB7IC50dl9zZWMgPSB1dC51 dF90aW1lLCAudHZfbnNlYyA9IDAgfTsKKyAgICAgICAgICAgICNlbmRpZgorCisgICAgICAg ICAgaWYgKHV0LnV0X3R5cGUgPT0gQk9PVF9USU1FKQorICAgICAgICAgICAgZm91bmRfYm9v dF90aW1lID0gdHM7CisgICAgICAgIH0KKworICAgICAgZmNsb3NlIChmKTsKKyAgICB9CisK KyMgIGVuZGlmCisKKyMgIGlmIGRlZmluZWQgX19saW51eF9fICYmICFkZWZpbmVkIF9fQU5E Uk9JRF9fCisgIGlmIChmb3VuZF9ib290X3RpbWUudHZfc2VjID09IDApCisgICAgeworICAg ICAgZ2V0X2xpbnV4X2Jvb3RfdGltZV9maW5hbF9mYWxsYmFjayAoJmZvdW5kX2Jvb3RfdGlt ZSk7CisgICAgfQorIyAgZW5kaWYKKworIyBlbHNlIC8qIG9sZCBGcmVlQlNELCBPcGVuQlNE LCBuYXRpdmUgV2luZG93cyAqLworCisjICBpZiBkZWZpbmVkIF9fT3BlbkJTRF9fCisgIC8q IFdvcmthcm91bmQgZm9yIE9wZW5CU0Q6ICAqLworICBnZXRfb3BlbmJzZF9ib290X3RpbWUg KCZmb3VuZF9ib290X3RpbWUpOworIyAgZW5kaWYKKworIyBlbmRpZgorCisjIGlmIEhBVkVf U1lTX1NZU0NUTF9IICYmIEhBVkVfU1lTQ1RMIFwKKyAgICAgJiYgZGVmaW5lZCBDVExfS0VS TiAmJiBkZWZpbmVkIEtFUk5fQk9PVFRJTUUgXAorICAgICAmJiAhZGVmaW5lZCBfX21pbml4 CisgIGlmIChmb3VuZF9ib290X3RpbWUudHZfc2VjID09IDApCisgICAgeworICAgICAgZ2V0 X2JzZF9ib290X3RpbWVfZmluYWxfZmFsbGJhY2sgKCZmb3VuZF9ib290X3RpbWUpOworICAg IH0KKyMgZW5kaWYKKworIyBpZiBkZWZpbmVkIF9fSEFJS1VfXworICBpZiAoZm91bmRfYm9v dF90aW1lLnR2X3NlYyA9PSAwKQorICAgIHsKKyAgICAgIGdldF9oYWlrdV9ib290X3RpbWUg KCZmb3VuZF9ib290X3RpbWUpOworICAgIH0KKyMgZW5kaWYKKworIyBpZiBIQVZFX09TX0gK KyAgaWYgKGZvdW5kX2Jvb3RfdGltZS50dl9zZWMgPT0gMCkKKyAgICB7CisgICAgICBnZXRf aGFpa3VfYm9vdF90aW1lX2ZpbmFsX2ZhbGxiYWNrICgmZm91bmRfYm9vdF90aW1lKTsKKyAg ICB9CisjIGVuZGlmCisKKyMgaWYgZGVmaW5lZCBfX0NZR1dJTl9fIHx8IGRlZmluZWQgX1dJ TjMyCisgIGlmIChmb3VuZF9ib290X3RpbWUudHZfc2VjID09IDApCisgICAgeworICAgICAg LyogV29ya2Fyb3VuZCBmb3IgV2luZG93czogICovCisgICAgICBnZXRfd2luZG93c19ib290 X3RpbWUgKCZmb3VuZF9ib290X3RpbWUpOworICAgIH0KKyMgZW5kaWYKKworICBpZiAoZm91 bmRfYm9vdF90aW1lLnR2X3NlYyAhPSAwKQorICAgIHsKKyAgICAgICpwX2Jvb3RfdGltZSA9 IGZvdW5kX2Jvb3RfdGltZTsKKyAgICAgIHJldHVybiAwOworICAgIH0KKyAgZWxzZQorICAg IHJldHVybiAtMTsKK30KKworaW50CitnZXRfYm9vdF90aW1lIChzdHJ1Y3QgdGltZXNwZWMg KnBfYm9vdF90aW1lKQoreworICAvKiBDYWNoZSB0aGUgcmVzdWx0IGZyb20gZ2V0X2Jvb3Rf dGltZV91bmNhY2hlZC4gICovCisgIHN0YXRpYyBpbnQgdm9sYXRpbGUgY2FjaGVkX3Jlc3Vs dCA9IC0xOworICBzdGF0aWMgc3RydWN0IHRpbWVzcGVjIHZvbGF0aWxlIGNhY2hlZF9ib290 X3RpbWU7CisKKyAgaWYgKGNhY2hlZF9yZXN1bHQgPCAwKQorICAgIHsKKyAgICAgIHN0cnVj dCB0aW1lc3BlYyBib290X3RpbWU7CisgICAgICBpbnQgcmVzdWx0ID0gZ2V0X2Jvb3RfdGlt ZV91bmNhY2hlZ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Rt cAoreworICAvKiBBbGwgJ2NoYXIgKicgaGVyZSBhcmUgb2YgYXJiaXRyYXJ5IGxlbmd0aCBh bmQgcG9pbnQgdG8gc3RvcmFnZQorICAgICB3aXRoIGxpZmV0aW1lIGVxdWFsIHRvIHRoYXQg b2YgdGhpcyBzdHJ1Y3QuICAqLworICBjaGFyICp1dF91c2VyOyAgICAgICAgICAgICAgICAv KiBVc2VyIG5hbWUgKi8KKyAgY2hhciAqdXRfaWQ7ICAgICAgICAgICAgICAgICAgLyogU2Vz c2lvbiBJRCAqLworICBjaGFyICp1dF9saW5lOyAgICAgICAgICAgICAgICAvKiBzZWF0IC8g ZGV2aWNlICovCisgIGNoYXIgKnV0X2hvc3Q7ICAgICAgICAgICAgICAgIC8qIGZvciByZW1v dGUgc2Vzc2lvbnM6IHVzZXJAaG9zdCBvciBob3N0LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBmb3IgbG9jYWwgc2Vzc2lvbnM6IHRoZSBYMTEgZGlzcGxheSA6TiAq LworICBzdHJ1Y3QgdGltZXNwZWMgdXRfdHM7ICAgICAgICAvKiB0aW1lICovCisgIHBpZF90 IHV0X3BpZDsgICAgICAgICAgICAgICAgIC8qIHByb2Nlc3MgSUQgb2YgPyAqLworICBwaWRf dCB1dF9zZXNzaW9uOyAgICAgICAgICAgICAvKiBwcm9jZXNzIElEIG9mIHNlc3Npb24gbGVh ZGVyICovCisgIHNob3J0IHV0X3R5cGU7ICAgICAgICAgICAgICAgIC8qIEJPT1RfVElNRSwg VVNFUl9QUk9DRVNTLCBvciBvdGhlciAqLworICBzdHJ1Y3QgeyBpbnQgZV90ZXJtaW5hdGlv bjsgaW50IGVfZXhpdDsgfSB1dF9leGl0OworfTsKKworLyogVGhlIGZvbGxvd2luZyB0eXBl cywgbWFjcm9zLCBhbmQgY29uc3RhbnRzIGRlc2NyaWJlIHRoZSAnc3RydWN0IGdsX3V0bXAn LiAgKi8KKyNkZWZpbmUgVVRfVVNFUihVVCkg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isgICBmcm9tIHN5c3Rl bWQpLCBpdCB1c2VzIHRoZSBmb2xsb3dpbmcgbG93LWxldmVsIHR5cGVzIGFuZCBtYWNyb3Mu CisgICBLZWVwIHRoZW0gaGVyZSwgcmF0aGVyIHRoYW4gbW92aW5nIHRoZW0gaW50byByZWFk dXRtcC5jLCBmb3IgYmFja3dhcmQKKyAgIGNvbXBhdGliaWxpdHkuICAqLworCisjaWYgSEFW RV9VVE1QWF9ICisKKy8qIDx1dG1weC5oPiBkZWZpbmVzICdzdHJ1Y3QgdXRtcHgnIHdpdGgg dGhlIGZvbGxvd2luZyBmaWVsZHM6CisKKyAgICAgRmllbGQgICAgICAgIFR5cGUgICAgICAg ICAgICAgICAgICAgICAgIFBsYXRmb3JtcworICAgICAtLS0tLS0tLS0tICAgLS0tLS0tICAg ICAgICAgICAgICAgICAgICAgLS0tLS0tLS0tCisgICDijqEgdXRfdXNlciAgICAgIGNoYXJb XSAgICAgICAgICAgICAgICAgICAgIGdsaWJjLCBtdXNsLCBtYWNPUywgRnJlZUJTRCwgQUlY LCBIUC1VWCwgSVJJWCwgU29sYXJpcywgQ3lnd2luCisgICDijqMgdXRfbmFtZSAgICAgIGNo YXJbXSAgICAgICAgICAgICAgICAgICAgIE5ldEJTRCwgTWluaXgKKyAgICAgdXRfaWQgICAg ICAgIGNoYXJbXSAgICAgICAgICAgICAgICAgICAgIGdsaWJjLCBtdXNsLCBtYWNPUywgRnJl ZUJTRCwgTmV0QlNELCBNaW5peCwgQUlYLCBIUC1VWCwgSVJJWCwgU29sYXJpcywgQ3lnd2lu CisgICAgIHV0X2xpbmUgICAgICBjaGFyW10gICAgICAgICAgICAgICAgICAgICBnbGliYywg bXVzbCwgbWFjT1MsIEZyZWVCU0QsIE5ldEJTRCwgTWluaXgsIEFJWCwgSFAtVVgsIElSSVgs IFNvbGFyaXMsIEN5Z3dpbgorICAgICB1dF9waWQgICAgICAgcGlkX3QgICAgICAgICAgICAg ICAgICAgICAgZ2xpYmMsIG11c2wsIG1hY09TLCBGcmVlQlNELCBOZXRCU0QsIE1pbml4LCBB SVgsIEhQLVVYLCBJUklYLCBTb2xhcmlzLCBDeWd3aW4KKyAgICAgdXRfdHlwZSAgICAgIHNo b3J0ICAgICAgICAgICAgICAgICAgICAgIGdsaWJjLCBtdXNsLCBtYWNPUywgRnJlZUJTRCwg TmV0QlNELCBNaW5peCwgQUlYLCBIUC1VWCwgSVJJWCwgU29sYXJpcywgQ3lnd2luCisgICDi jqEgdXRfdHYgICAgICAgIHN0cnVjdCAgICAgICAgICAgICAgICAgICAgIGdsaWJjLCBtdXNs LCBtYWNPUywgRnJlZUJTRCwgTmV0QlNELCBNaW5peCwgQUlYLCBIUC1VWCwgSVJJWCwgU29s YXJpcywgQ3lnd2luCisgICDijqIgICAgICAgICAgICAgIHsgdHZfc2VjOyB0dl91c2VjOyB9 CisgICDijqMgdXRfdGltZSAgICAgIHRpbWVfdCAgICAgICAgICAgICAgICAgICAgIEN5Z3dp bgorICAgICB1dF9ob3N0ICAgICAgY2hhcltdICAgICAgICAgICAgICAgICAgICAgZ2xpYmMs IG11c2wsIG1hY09TLCBGcmVlQlNELCBOZXRCU0QsIE1pbml4LCBBSVgsIEhQLVVYLCBJUklY LCBTb2xhcmlzLCBDeWd3aW4KKyAgICAgdXRfZXhpdCAgICAgIHN0cnVjdCAgICAgICAgICAg ICAgICAgICAgIGdsaWJjLCBtdXNsLCBOZXRCU0QsIE1pbml4LCBIUC1VWCwgSVJJWCwgU29s YXJpcworICAgICAgICAgICAgICAgICAgeyBlX3Rlcm1pbmF0aW9uOyBlX2V4aXQ7IH0KKyAg ICAgdXRfc2Vzc2lvbiAgIFtsb25nXSBpbnQgICAgICAgICAgICAgICAgIGdsaWJjLCBtdXNs LCBOZXRCU0QsIE1pbml4LCBJUklYLCBTb2xhcmlzCisgICDijqEgdXRfYWRkciAgICAgIFts b25nXSBpbnQgICAgICAgICAgICAgICAgIEhQLVVYLCBDeWd3aW4KKyAgIOKOoiB1dF9hZ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lNELCBO ZXRCU0QsIE9wZW5CU0QsIE1pbml4CisgICAgIHV0X2lkICAgICAgICBjaGFyW10gICAgICAg ICAgICAgICAgICAgICBnbGliYywgbXVzbCwgQUlYLCBIUC1VWCwgSVJJWCwgU29sYXJpcywg Q3lnd2luLCBBbmRyb2lkCisgICAgIHV0X2xpbmUgICAgICBjaGFyW10gICAgICAgICAgICAg ICAgICAgICBnbGliYywgbXVzbCwgbWFjT1MsIG9sZCBGcmVlQlNELCBOZXRCU0QsIE9wZW5C U0QsIE1pbml4LCBBSVgsIEhQLVVYLCBJUklYLCBTb2xhcmlzLCBDeWd3aW4sIEFuZHJvaWQK KyAgICAgdXRfcGlkICAgICAgIHBpZF90ICAgICAgICAgICAgICAgICAgICAgIGdsaWJjLCBt dXNsLCBBSVgsIEhQLVVYLCBJUklYLCBTb2xhcmlzLCBDeWd3aW4sIEFuZHJvaWQKKyAgICAg dXRfdHlwZSAgICAgIHNob3J0ICAgICAgICAgICAgICAgICAgICAgIGdsaWJjLCBtdXNsLCBB SVgsIEhQLVVYLCBJUklYLCBTb2xhcmlzLCBDeWd3aW4sIEFuZHJvaWQKKyAgIOKOoSB1dF90 diAgICAgICAgc3RydWN0ICAgICAgICAgICAgICAgICAgICAgZ2xpYmMsIG11c2wsIEFuZHJv aWQKKyAgIOKOoiAgICAgICAgICAgICAgeyB0dl9zZWM7IHR2X3VzZWM7IH0KKyAgIOKOoyB1 dF90aW1lICAgICAgdGltZV90ICAgICAgICAgICAgICAgICAgICAgbWFjT1MsIG9sZCBGcmVl QlNELCBOZXRCU0QsIE9wZW5CU0QsIE1pbml4LCBBSVgsIEhQLVVYLCBJUklYLCBTb2xhcmlz LCBDeWd3aW4KKyAgICAgdXRfaG9zdCAgICAgIGNoYXJbXSAgICAgICAgICAgICAgICAgICAg IGdsaWJjLCBtdXNsLCBtYWNPUywgb2xkIEZyZWVCU0QsIE5ldEJTRCwgT3BlbkJTRCwgTWlu aXgsIEFJWCwgSFAtVVgsIEN5Z3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