From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18918 invoked by alias); 1 May 2014 22:37:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 18748 invoked by uid 89); 1 May 2014 22:37:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_20,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS,UNSUBSCRIBE_BODY autolearn=no version=3.3.2 X-HELO: mail-oa0-f42.google.com Received: from mail-oa0-f42.google.com (HELO mail-oa0-f42.google.com) (209.85.219.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 01 May 2014 22:37:26 +0000 Received: by mail-oa0-f42.google.com with SMTP id i7so4324406oag.29 for ; Thu, 01 May 2014 15:37:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Oqv5dneoGFp1qAk2I3xw1RsrZNifdNr2v3TpY9pNZEs=; b=eK2MC7E/qse1bkkC54zLfW3ei0rrxnIFJq9rhr6DCyF7WH21tdXL9oSH0sGjFyMTCc AQCn+t/RZNuC8w3zKoPdrGFWr6sC2u3AtWLY2vU+2HxbKYqI2NGPtreSeBO03a+guJVj oadvqIsfpdzPpLILor/GcUBlMqf0s63LrBYzKCYoOsZVqaFBfxgBaD7w76qhf5E60UC6 jF5EhBZayzPNYOtexP0xGOTTA2UrZT7izj0sDK9UwdTDnejchwFPOPCRFuruewkPx6iT 0A00BIi+c/t7jf9TurodwuTtFtzU1YZtekrzJOpWfts07n/ADzqk6Mhgw1uAg6ouXNUK KB+Q== X-Gm-Message-State: ALoCoQn3M6iIT9StBTWSWMeuIgRWE5ymw+NNPXfCp9IQCBqF4+crbc384Nn4ewVWxHY5ur3Qdrj7 MIME-Version: 1.0 X-Received: by 10.182.113.227 with SMTP id jb3mr11829485obb.3.1398983843773; Thu, 01 May 2014 15:37:23 -0700 (PDT) Received: by 10.182.176.98 with HTTP; Thu, 1 May 2014 15:37:23 -0700 (PDT) In-Reply-To: <20140417033448.GC3157@kam.mff.cuni.cz> References: <20140415213850.GA23141@atrey.karlin.mff.cuni.cz> <20140417033448.GC3157@kam.mff.cuni.cz> Date: Thu, 01 May 2014 22:37:00 -0000 Message-ID: Subject: Re: [PATCH] offline gcda profile processing tool From: Rong Xu To: Jan Hubicka Cc: GCC Patches , Xinliang David Li , Teresa Johnson , Dehao Chen Content-Type: multipart/mixed; boundary=089e012281220e41b504f85e4f4c X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg00027.txt.bz2 --089e012281220e41b504f85e4f4c Content-Type: text/plain; charset=UTF-8 Content-length: 4119 Hi, Honza, Please find the new patch in the attachment. This patch integrated your earlier suggestions. The noticeable changes are: (1) build specialized object for libgcov-driver.c and libgcov-merge.c and link into gcov-tool, rather including the source file. (2) split some gcov counter definition code to gcov-counter.def to avoid code duplication. (3) use a macro for gcov_read_counter(), so gcov-tool can use existing code in libgcov-merge.c with minimal change. This patch does not address the suggestion of creating a new directory for libgcov. I agree with you that's a much better and cleaner structure we should go for. We can do that in follow-up patches. I tested this patch with boostrap and profiledbootstrap. Other tests are on-going. Thanks, -Rong On Wed, Apr 16, 2014 at 8:34 PM, Jan Hubicka wrote: >> GCOT_TOOL needs to use this function to read the string in gcda file >> to memory to construct gcov_info objects. >> As you noticed, gcov runtime does not need this interface. But >> gcov-tool links with gcov runtime and it also uses the function. >> We could make it available in gcov_runtime, but that will slightly >> increase the memory footprint. > > Yep, it is not really pretty. I wrote bellow some plan how things may be > structured in more convenient way. Any work in that direction would be welcome. >> >> The planned new functions for trunk version is: (1) overlap score b/w >> two profiles (2) better dumping (top hot objects/function/counters) >> and statistics. >> Once this basic version is in, we can start to add the new functionality. > > Sounds good. I assume the autoFDO does not go via gcov tool but rather uses > custom reader of profile data at GCC side? > I wonder, are there any recent overview papers/slides/text of design of AutoFDO > and other features to be merged? > I remember the talk from GCC Summit and I did read some of pre-LTO LIPO > sources & papers, but it would be nice to have somethin up to date. >> >> libgcov-util.o is built in gcc/ directory, rather in libgcc. >> It's directly linked to gcov-tool. >> So libgcov-util.o is built for HOST, not TARGET. >> With makefile changes, we can built HOST version of libgcov-driver.o >> and libgcov-merge.o. >> I also need to make some static functions/variables public. > > I suppose that can go with IN_GCOV_TOOL ifdef. > > So we currently have basic gcov io handling in gcc/gcov-io.c that is borrowed > by libgcc/libgcov* code. We also will get libgcov-util.c in libgcc directory > that is actually borrowed by by gcc/gcov-tool.c code. > > We now have one runtime using STDIO for streaming and kernel has custom version > that goes via /proc interface (last time I looked). We added some abstraction > into libgcov-interface that is the part that relies on STDIO, partly via gcov-io.c > code and now we have in-memory handling code in libgcov-util. > > I guess it would make most sentse to put all the gcov code into a new directory > (libgcov) and make it stand-alone library that can be configured > 1) for stdio based runtime as we do not > 2) for runtime missing the interface and relyin on user providing it > 3) for use within gcov file manipulation tools with reorg of > GCC/gcov/gcov-dump/gcov-tool to all use the same low-level interfaces. > In a longer term, I would like to make FDO profiling intstrumentation to happen > at linktime. For that I need to make the instrumentation code (minimal spaning > tree & friends) to work w/o cgraph that would ideally be done in a shared > implementation >> > Won't this get wrong answer when counters[0] is not the same? >> > I would expected the merging code to compare the counters first. Similarly for delta counter. >> >> These *_op functions are for scaling only. So there is only one >> profile involved (thus there is no comparison). >> The merge handles are in libgcov-merge.c which have the code to handle >> mismatched profile targets. > > I see, OK then. >> > >> > Adding correct rounding may actually make difference for Martin's startup time work. >> >> Do you mean to use something like in RDIV macro? > > Yes. > > Honza --089e012281220e41b504f85e4f4c Content-Type: text/plain; charset=US-ASCII; name="gcov_tool_patch_v3.txt" Content-Disposition: attachment; filename="gcov_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A9IGNoZGlyIChwd2QpOworICBmcmVlIChwd2QpOworICByZXR1cm4gMDsK K30KKworLyogVXNhZ2UgbWVzc2FnZSBmb3IgcHJvZmlsZSBtZXJnZS4gICov CisKK3N0YXRpYyB2b2lkCitwcmludF9tZXJnZV91c2FnZV9tZXNzYWdlIChp bnQgZXJyb3JfcCkKK3sKKyAgRklMRSAqZmlsZSA9IGVycm9yX3AgPyBzdGRl cnIgOiBzdGRvdXQ7CisKKyAgZm5vdGljZSAoZmlsZSwgIiAgbWVyZ2UgW29w dGlvbnNdIDxkaXIxPiA8ZGlyMj4gICAgICAgICBNZXJnZSBjb3ZlcmFnZSBm aWxlIGNvbnRlbnRzXG4iKTsKKyAgZm5vdGljZSAoZmlsZSwgIiAgICAtdiwg LS12ZXJib3NlICAgICAgICAgICAgICAgICAgICAgICBWZXJib3NlIG1vZGVc biIpOworICBmbm90aWNlIChmaWxlLCAiICAgIC1vLCAtLW91dHB1dCA8ZGly PiAgICAgICAgICAgICAgICAgIE91dHB1dCBkaXJlY3RvcnlcbiIpOworICBm bm90aWNlIChmaWxlLCAiICAgIC13LCAtLXdlaWdodCA8dzEsdzI+ICAgICAg ICAgICAgICAgIFNldCB3ZWlnaHRzIChmbG9hdCBwb2ludCB2YWx1ZXMpXG4i KTsKK30KKworc3RhdGljIGNvbnN0IHN0cnVjdCBvcHRpb24gbWVyZ2Vfb3B0 aW9uc1tdID0KK3sKKyAgeyAidmVyYm9zZSIsICAgICAgICAgICAgICAgIG5v X2FyZ3VtZW50LCAgICAgICBOVUxMLCAndicgfSwKKyAgeyAib3V0cHV0Iiwg ICAgICAgICAgICAgICAgIHJlcXVpcmVkX2FyZ3VtZW50LCBOVUxMLCAnbycg fSwKKyAgeyAid2VpZ2h0IiwgICAgICAgICAgICAgICAgIHJlcXVpcmVkX2Fy Z3VtZW50LCBOVUxMLCAndycgfSwKKyAgeyAwLCAwLCAwLCAwIH0KK307CisK Ky8qIFByaW50IG1lcmdlIHVzYWdlIGFuZCBleGl0LiAgKi8KKworc3RhdGlj IHZvaWQKK21lcmdlX3VzYWdlICh2b2lkKQoreworICBmbm90aWNlIChzdGRl cnIsICJNZXJnZSBzdWJjb21hbmQgdXNhZ2U6Iik7CisgIHByaW50X21lcmdl X3VzYWdlX21lc3NhZ2UgKHRydWUpOworICBleGl0IChGQVRBTF9FWElUX0NP REUpOworfQorCisvKiBEcml2ZXIgZm9yIHByb2ZpbGUgbWVyZ2Ugc3ViLWNv bW1hbmQuICAqLworCitzdGF0aWMgaW50Citkb19tZXJnZSAoaW50IGFyZ2Ms IGNoYXIgKiphcmd2KQoreworICBpbnQgb3B0OworICBpbnQgcmV0OworICBj b25zdCBjaGFyICpvdXRwdXRfZGlyID0gMDsKKyAgaW50IHcxID0gMSwgdzIg PSAxOworCisgIG9wdGluZCA9IDA7CisgIHdoaWxlICgob3B0ID0gZ2V0b3B0 X2xvbmcgKGFyZ2MsIGFyZ3YsICJ2bzp3OiIsIG1lcmdlX29wdGlvbnMsIE5V TEwpKSAhPSAtMSkKKyAgICB7CisgICAgICBzd2l0Y2ggKG9wdCkKKyAgICAg ICAgeworICAgICAgICBjYXNlICd2JzoKKyAgICAgICAgICB2ZXJib3NlID0g MTsKKyAgICAgICAgICBnY292X3NldF92ZXJib3NlICgpOworICAgICAgICAg IGJyZWFrOworICAgICAgICBjYXNlICdvJzoKKyAgICAgICAgICBvdXRwdXRf ZGlyID0gb3B0YXJnOworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNl ICd3JzoKKyAgICAgICAgICBzc2NhbmYgKG9wdGFyZywgIiVkLCVkIiwgJncx LCAmdzIpOworICAgICAgICAgIGlmICh3MSA8IDAgfHwgdzIgPCAwKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBmbm90aWNlIChzdGRlcnIsICJ3 ZWlnaHRzIG5lZWQgdG8gYmUgbm9uLW5lZ2F0aXZlXG4iKTsKKyAgICAgICAg ICAgICAgZXhpdCAoRkFUQUxfRVhJVF9DT0RFKTsKKyAgICAgICAgICAgIH0K KyAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAg ICBtZXJnZV91c2FnZSAoKTsKKyAgICAgICAgfQorICAgIH0KKworICBpZiAo b3V0cHV0X2RpciA9PSBOVUxMKQorICAgIG91dHB1dF9kaXIgPSAibWVyZ2Vk X3Byb2ZpbGUiOworCisgIGlmIChhcmdjIC0gb3B0aW5kID09IDIpCisgICAg cmV0ID0gcHJvZmlsZV9tZXJnZSAoYXJndltvcHRpbmRdLCBhcmd2W29wdGlu ZCsxXSwgb3V0cHV0X2RpciwgdzEsIHcyKTsKKyAgZWxzZQorICAgIG1lcmdl X3VzYWdlICgpOworCisgIHJldHVybiByZXQ7Cit9CisKKy8qIElmIE5fVkFM IGlzIG5vLXplcm8sIG5vcm1hbGl6ZSB0aGUgcHJvZmlsZSBieSBzZXR0aW5n IHRoZSBsYXJnZXN0IGNvdW50ZXIKKyAgIGNvdW50ZXIgdmFsdWUgdG8gTl9W QUwgYW5kIHNjYWxlIG90aGVycyBjb3VudGVycyBwcm9wb3J0aW9uYWxseS4K KyAgIE90aGVyd2lzZSwgbXVsdGlwbHkgdGhlIGFsbCBjb3VudGVycyBieSBT Q0FMRS4gICovCisKK3N0YXRpYyBpbnQKK3Byb2ZpbGVfcmV3cml0ZSAoY29u c3QgY2hhciAqZDEsIGNvbnN0IGNoYXIgKm91dCwgbG9uZyBsb25nIG5fdmFs LAorICAgICAgICAgICAgICAgICBmbG9hdCBzY2FsZSwgaW50IG4sIGludCBk KQoreworICBjaGFyICpwd2Q7CisgIGludCByZXQ7CisgIHN0cnVjdCBnY292 X2luZm8gKiBkMV9wcm9maWxlOworCisKKyAgZDFfcHJvZmlsZSA9IGdjb3Zf cmVhZF9wcm9maWxlX2RpciAoZDEsIDApOworICBpZiAoIWQxX3Byb2ZpbGUp CisgICAgcmV0dXJuIDE7CisKKyAgLyogT3V0cHV0IG5ldyBwcm9maWxlLiAg Ki8KKyAgdW5saW5rX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9kaXIgPSAw OworICBsb25nIGxvbmcgbm9ybWFsaXplX3ZhbCA9IDA7CisgIGZsb2F0IHNj YWxlID0gMC4wOworICBpbnQgbnVtZXJhdG9yID0gMTsKKyAgaW50IGRlbm9t aW5hdG9yID0gMTsKKyAgaW50IGRvX3NjYWxpbmcgPSAwOworCisgIG9wdGlu ZCA9IDA7CisgIHdoaWxlICgob3B0ID0gZ2V0b3B0X2xvbmcgKGFyZ2MsIGFy Z3YsICJ2bzpzOm46IiwgcmV3cml0ZV9vcHRpb25zLCBOVUxMKSkgIT0gLTEp CisgICAgeworICAgICAgc3dpdGNoIChvcHQpCisgICAgICAgIHsKKyAgICAg ICAgY2FzZSAndic6CisgICAgICAgICAgdmVyYm9zZSA9IDE7CisgICAgICAg ICAgZ2Nvdl9zZXRfdmVyYm9zZSAoKTsKKyAgICAgICAgICBicmVhazsKKyAg ICAgICAgY2FzZSAnbyc6CisgICAgICAgICAgb3V0cHV0X2RpciA9IG9wdGFy ZzsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAnbic6CisgICAg ICAgICAgaWYgKCFkb19zY2FsaW5nKQorICAgICAgICAgICAgbm9ybWFsaXpl X3ZhbCA9IGF0b2xsIChvcHRhcmcpOworICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgIGZub3RpY2UgKHN0ZGVyciwgInNjYWxpbmcgY2Fubm90IGNvLWV4 aXN0IHdpdGggbm9ybWFsaXphdGlvbiwiCisgICAgICAgICAgICAgICAgIiBz a2lwcGluZ1xuIik7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2Ug J3MnOgorICAgICAgICAgIHJldCA9IDA7CisgICAgICAgICAgZG9fc2NhbGlu ZyA9IDE7CisgICAgICAgICAgaWYgKHN0cnN0ciAob3B0YXJnLCAiLyIpKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICByZXQgPSBzc2NhbmYgKG9w dGFyZywgIiVkLyVkIiwgJm51bWVyYXRvciwgJmRlbm9taW5hdG9yKTsKKyAg ICAgICAgICAgICAgaWYgKHJldCA9PSAyKQorICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgIGdjY19hc3NlcnQgKG51bWVyYXRvciA+PSAw KTsKKyAgICAgICAgICAgICAgICAgIGdjY19hc3NlcnQgKGRlbm9taW5hdG9y ID4gMCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAg ICAgICAgIGlmIChyZXQgIT0gMikKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgcmV0ID0gc3NjYW5mIChvcHRhcmcsICIlZiIsICZzY2FsZSk7Cisg ICAgICAgICAgICAgIGdjY19hc3NlcnQgKHJldCA9PSAxKTsKKyAgICAgICAg ICAgICAgZGVub21pbmF0b3IgPSAwOworICAgICAgICAgICAgfQorCisgICAg ICAgICAgaWYgKHNjYWxlIDwgMC4wKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBmbm90aWNlIChzdGRlcnIsICJzY2FsZSBuZWVkcyB0byBiZSBu b24tbmVnYXRpdmVcbiIpOworICAgICAgICAgICAgICBleGl0IChGQVRBTF9F WElUX0NPREUpOworICAgICAgICAgICAgfQorICAgICAgICAgIGlmIChub3Jt YWxpemVfdmFsICE9IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IGZub3RpY2UgKHN0ZGVyciwgIm5vcm1hbGl6YXRpb24gY2Fubm90IGNvLWV4 aXN0IHdpdGggc2NhbGluZ1xuIik7CisgICAgICAgICAgICAgIG5vcm1hbGl6 ZV92YWwgPSAwOworICAgICAgICAgICAgfQorICAgICAgICAgIGJyZWFrOwor ICAgICAgICBkZWZhdWx0OgorICAgICAgICAgIHJld3JpdGVfdXNhZ2UgKCk7 CisgICAgICAgIH0KKyAgICB9CisKKyAgaWYgKG91dHB1dF9kaXIgPT0gTlVM TCkKKyAgICBvdXRwdXRfZGlyID0gInJld3JpdGVfcHJvZmlsZSI7CisKKyAg aWYgKGFyZ2MgLSBvcHRpbmQgPT0g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9uIG9wdGlvbnNbXSA9Cit7CisgIHsgImhlbHAiLCAgICAgICAgICAg ICAgICAgbm9fYXJndW1lbnQsICAgICAgIE5VTEwsICdoJyB9LAorICB7ICJ2 ZXJzaW9uIiwgICAgICAgICAgICAgIG5vX2FyZ3VtZW50LCAgICAgICBOVUxM LCAndicgfSwKKyAgeyAwLCAwLCAwLCAwIH0KK307CisKKy8qIFByb2Nlc3Mg YXJncywgcmV0dXJuIGluZGV4IHRvIGZpcnN0IG5vbi1hcmcuICAqLworCitz dGF0aWMgaW50Citwcm9jZXNzX2FyZ3MgKGludCBhcmdjLCBjaGFyICoqYXJn dikKK3sKKyAgaW50IG9wdDsKKworICB3aGlsZSAoKG9wdCA9IGdldG9wdF9s b25nIChhcmdjLCBhcmd2LCAiK2h2Iiwgb3B0aW9ucywgTlVMTCkpICE9IC0x KQorICAgIHsKKyAgICAgIHN3aXRjaCAob3B0KQorICAgICAgICB7CisgICAg ICAgIGNhc2UgJ2gnOgorICAgICAgICAgIHByaW50X3VzYWdlIChmYWxzZSk7 CisgICAgICAgICAgLyogUHJpbnRfdXNhZ2Ugd2lsbCBleGl0LiAgKi8KKyAg ICAgICAgY2FzZSAndic6CisgICAgICAgICAgcHJpbnRfdmVyc2lvbiAoKTsK KyAgICAgICAgICAvKiBQcmludF92ZXJzaW9uIHdpbGwgZXhpdC4gICovCisg ICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgcHJpbnRfdXNhZ2UgKHRydWUp OworICAgICAgICAgIC8qIFByaW50X3VzYWdlIHdpbGwgZXhpdC4gICovCisg ICAgICAgIH0KKyAgICB9CisKKyAgcmV0dXJuIG9wdGluZDsKK30KKworLyog TWFpbiBmdW5jdGlvbiBmb3IgZ2Nvdi10b29sLiAgKi8KKworaW50CittYWlu IChpbnQgYXJnYywgY2hhciAqKmFyZ3YpCit7CisgIGNvbnN0IGNoYXIgKnA7 CisgIGNvbnN0IGNoYXIgKnN1Yl9jb21tYW5kOworCisgIHAgPSBhcmd2WzBd ICsgc3RybGVuIChhcmd2WzBdKTsKKyAgd2hpbGUgKHAgIT0gYXJndlswXSAm JiAhSVNfRElSX1NFUEFSQVRPUiAocFstMV0pKQorICAgIC0tcDsKKyAgcHJv Z25hbWUgPSBwOworCisgIHhtYWxsb2Nfc2V0X3Byb2dyYW1fbmFtZSAocHJv Z25hbWUpOworCisgIC8qIFVubG9jayB0aGUgc3RkaW8gc3RyZWFtcy4gICov CisgIHVubG9ja19zdGRfc3RyZWFtcyAoKTsKKworICBnY2NfaW5pdF9saWJp bnRsICgpOworCisgIGRpYWdub3N0aWNfaW5pdGlhbGl6ZSAoZ2xvYmFsX2Rj LCAwKTsKKworICAvKiBIYW5kbGUgcmVzcG9uc2UgZmlsZXMuICAqLworICBl eHBhbmRhcmd2ICgmYXJnYywgJmFyZ3YpOworCisgIHByb2Nlc3NfYXJncyAo YXJnYywgYXJndik7CisgIGlmIChvcHRpbmQgPj0gYXJnYykKKyAgICBwcmlu dF91c2FnZSAodHJ1ZSk7CisKKyAgc3ViX2NvbW1hbmQgPSBhcmd2W29wdGlu ZF07CisKKyAgaWYgKCFzdHJjbXAgKHN1Yl9jb21tYW5kLCAibWVyZ2UiKSkK KyAgICByZXR1cm4gZG9fbWVyZ2UgKGFyZ2MgLSBvcHRpbmQsIGFyZ3YgKyBv cHRpbmQpOworICBlbHNlIGlmICghc3RyY21wIChzdWJfY29tbWFuZCwgInJl d3JpdGUiKSkKKyAgICByZXR1cm4gZG9fcmV3cml0ZSAoYXJnYyAtIG9wdGlu ZCwgYXJndiArIG9wdGluZCk7CisKKyAgcHJpbnRfdXNhZ2UgKHRydWUpOwor fQpJbmRleDogZ2NjL01ha2VmaWxlLmluCj09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT0KLS0tIGdjYy9NYWtlZmlsZS5pbgkocmV2aXNpb24gMjA5OTgxKQorKysg Z2NjL01ha2VmaWxlLmluCSh3b3JraW5nI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W5mbyk7Cisg IG51bV9mbl9pbmZvID0gMDsKKyAgY3Vycl9mbl9pbmZvID0gMDsKKyAgewor ICAgIGNoYXIgKnN0cl9kdXAgPSAoY2hhciopIHhtYWxsb2MgKHN0cmxlbiAo ZmlsZW5hbWUpICsgMSk7CisgICAgaW50IGxlbjsKKworICAgIHN0cmNweSAo c3RyX2R1cCwgZmlsZW5hbWUpOworICAgIG9ial9pbmZvLT5maWxlbmFtZSA9 IHN0cl9kdXA7CisgICAgaWYgKChsZW4gPSBzdHJsZW4gKGZpbGVuYW1lKSkg PiBtYXhfZmlsZW5hbWVfbGVuKQorICAgICAgbWF4X2ZpbGVuYW1lX2xlbiA9 IGxlbjsKKyAgfQorCisgIC8qIFJlYWQgc3RhbXAuICAqLworICBvYmpfaW5m by0+c3RhbXAgPSBnY292X3JlYWRfdW5zaWduZWQgKCk7CisKKyAgd2hpbGUg KDEpCisgICAgeworICAgICAgZ2Nvdl9wb3NpdGlvbl90IGJhc2U7CisgICAg ICB1bnNpZ25lZCB0YWcsIGxlbmd0aDsKKyAgICAgIHRhZ19mb3JtYXRfdCBj b25zdCAqZm9ybWF0OworICAgICAgdW5zaWduZWQgdGFnX2RlcHRoOworICAg ICAgaW50IGVycm9yOworICAgICAgdW5zaWduZWQgbWFzazsKKworICAgICAg dGFnID0gZ2Nvdl9yZWFkX3Vuc2lnbmVkICgpOworICAgICAgaWYgKCF0YWcp CisJYnJlYWs7CisgICAgICBsZW5ndGggPSBnY292X3JlYWRfdW5zaWduZWQg KCk7CisgICAgICBiYXNlID0gZ2Nvdl9wb3NpdGlvbiAoKTsKKyAgICAgIG1h c2sgPSBHQ09WX1RBR19NQVNLICh0YWcpID4+IDE7CisgICAgICBmb3IgKHRh Z19kZXB0aCA9IDQ7IG1hc2s7IG1hc2sgPj49IDgpCisJeworCSAgaWYgKCgo bWFzayAmIDB4ZmYpICE9IDB4ZmYpKQorCSAgICB7CisJICAgICAgZnByaW50 ZiAoc3RkZXJyLCAid2FybmluZz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Zml4X2xlbjsKKyAgc3RydWN0IGdjb3ZfaW5mbyAqb2JqX2luZm87CisK KyAgLyogT25seSByZWFkIHJlZ3VsYXIgZmlsZXMuICAqLworICBpZiAodHlw ZSAhPSBGVFdfRikKKyAgICByZXR1cm4gMDsKKworICBmaWxlbmFtZV9sZW4g PSBzdHJsZW4gKGZpbGVuYW1lKTsKKyAgc3VmZml4X2xlbiA9IHN0cmxlbiAo R0NPVl9EQVRBX1NVRkZJWCk7CisKKyAgaWYgKGZpbGVuYW1lX2xlbiA8PSBz dWZmaXhfbGVuKQorICAgIHJldHVybiAwOworCisgIGlmIChzdHJjbXAoZmls ZW5hbWUgKyBmaWxlbmFtZV9sZW4gLSBzdWZmaXhfbGVuLCBHQ09WX0RBVEFf U1VGRklYKSkKKyAgICByZXR1cm4gMDsKKworICAgaWYgKHZlcmJvc2UpCisg ICAgZnByaW50ZiAoc3RkZXJyLCAicmVhZGluZyBmaWxlOiAlc1xuIiwgZmls ZW5hbWUpOworCisgIG9ial9pbmZvID0gcmVhZF9nY2RhX2ZpbGUgKGZpbGVu YW1lKTsKKworICBvYmpfaW5mby0+bmV4dCA9IGdjb3ZfaW5mb19oZWFkOwor ICBnY292X2luZm9faGVhZCA9IG9ial9pbmZvOworCisgIHJldHVybiAwOwor fQorCisvKiBJbml0aWFsaXplciBmb3IgcmVhZGluZyBhIHByb2ZpbGUgZGly LiAgKi8KKworc3RhdGljIGlubGluZSB2b2lkCityZWFkX3Byb2ZpbGVfZGly X2luaXQgKHZvaWQpCit7CisgIGdjb3ZfaW5mb19oZWFkID0gMDsKK30KKwor LyogRHJpdmVyIGZvciByZWFkIGEgcHJvZmlsZSBkaXJlY3RvcnkgYW5kIGNv bnZlcnQgaW50byBnY292X2luZm8gbGlzdCBpbiBtZW1vcnkuCisgICBSZXR1 cm4gTlVMTCBvbiBlcnJvciwKKyAgIFJldHVybiB0aGUgaGVhZCBvZiBnY292 X2luZm8gbGlzdCBvbiBzdWNjZXNzLgorICAgTm90Z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dW0gIT0gZ2ZpX3B0cjItPmNmZ19jaGVja3N1bSkKKyAg ICAgICAgeworICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgImluICVzLCBj ZmdfY2hlY2tzdW0gbWlzbWF0Y2gsIHNraXBwaW5nXG4iLAorICAgICAgICAg ICAgICAgICAgaW5mbzEtPmZpbGVuYW1lKTsKKyAgICAgICAgICBoYXNfbWlz bWF0Y2ggPSAxOworICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9Cisg ICAgICBjaV9wdHIxID0gZ2ZpX3B0cjEtPmN0cnM7CisgICAgICBjaV9wdHIy ID0gZ2ZpX3B0cjItPmN0cnM7CisgICAgICBmb3IgKHRfaXggPSAwOyB0X2l4 ICE9IEdDT1ZfQ09VTlRFUlM7IHRfaXgrKykKKyAgICAgICAgeworICAgICAg ICAgIGdjb3ZfbWVyZ2VfZm4gbWVyZ2UxID0gaW5mbzEtPm1lcmdlW3RfaXhd OworICAgICAgICAgIGdjb3ZfbWVyZ2VfZm4gbWVyZ2UyID0gaW5mbzItPm1l cmdlW3RfaXhdOworCisgICAgICAgICAgZ2NjX2Fzc2VydCAobWVyZ2UxID09 IG1lcmdlMik7CisgICAgICAgICAgaWYgKCFtZXJnZTEpCisgICAgICAgICAg ICBjb250aW51ZTsKKyAgICAgICAgICBnY2NfYXNzZXJ0IChjaV9wdHIxLT5u dW0gPT0gY2lfcHRyMi0+bnVtKTsKKyAgICAgICAgICBtZXJnZV93cmFwcGVy IChtZXJnZTEsIGNpX3B0cjEtPnZhbHVlcywgY2lfcHRyMS0+bnVtLCBjaV9w dHIyLT52YWx1ZXMsIHcpOworICAgICAgICAgIGNpX3B0cjErKzsKKyAgICAg ICAgICBjaV9wdHIyKys7CisgICAgICAgIH0KKyAgICB9CisKKyAgcmV0dXJu IGhhc19taXNtYXRjaDsKK30KKworLyogRmluZCBhbmQgcmV0dXJuIHRoZSBt YXRjaCBnY292X2luZm8gb2JqZWN0IGZvciBJTkZPIGZyb20gQVJSQVkuCisg ICBTSVpFIGlzIHRoZSBsZW5ndGggb2YgQVJSQVkuCisgICBSZXR1cm4gTlVM TCBpZiB0aGVyZSBpcyBubyBtYXRjaC4gICovCisKK3N0YXRpYyBzdHJ1Y3Qg Z2Nvdl9pbmZvICoKK2ZpbmRfbWF0Y2hfZ2Nvdl9pbmZvIChzdHJ1Y3QgZ2Nv dl9pbmZvICoqYXJyYXksIGludCBzaXplLCBzdHJ1Y3QgZ2Nvdl9pbmZvICpp bmZvKQoreworICBzdHJ1Y3QgZ2Nvdl9pbmZvICpnaV9wdHI7CisgIHN0cnVj dCBnY292X2luZm8gKnJldCA9IE5VTEw7CisgIGludCBpOworCisgIGZvciAo aSA9IDA7IGkgPCBzaXplOyBpKyspCisgICAgeworICAgICAgZ2lfcHRyID0g YXJyYXlbaV07CisgICAgICBpZiAoZ2lfcHRyID09IDApCisgICAgICAgIGNv bnRpbnVlOworICAgICAgaWYgKCFzdHJjbXAgKGdpX3B0ci0+ZmlsZW5hbWUs IGluZm8tPmZpbGVuYW1lKSkKKyAgICAgICAgeworICAgICAgICAgIHJldCA9 IGdpX3B0cjsKKyAgICAgICAgICBhcnJheVtpXSA9IDA7CisgICAgICAgICAg YnJlYWs7CisgICAgICAgIH0KKyAgICB9CisKKyAgaWYgKHJldCAmJiByZXQt Pm5fZnVuY3Rpb25zICE9IGluZm8tPm5fZnVuY3Rpb25zKQorICAgIHsKKyAg ICAgIGZwcmludGYgKHN0ZGVyciwgIm1pc21hdGNoZWQgcHJvZmlsZXMgaW4g JXMgKCVkIGZ1bmN0aW9ucyIKKyAgICAgICAgICAgICAgICAgICAgICAgIiB2 cyAlZCBmdW5jdGlvbnMpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICBy ZXQtPmZpbGVuYW1lLAorICAgICAgICAgICAgICAgICAgICAgICByZXQtPm5f ZnVuY3Rpb25zLAorICAgICAgICAgICAgICAgICAgICAgICBpbmZvLT5uX2Z1 bmN0aW9ucyk7CisgICAgICByZXQgPSB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AgICAgICAgIGNvbnRp bnVlOworICAgICAgICB9CisgICAgICBnY292X21lcmdlIChnaV9wdHIxLCBn aV9wdHIsIHcyKTsKKyAgICB9CisKKyAgLyogRm9yIG1vZHVsZXMgaW4gc3Jj IGJ1dCBub3QgaW4gdGd0LiBXZSBhZGp1c3QgdGhlIGNvdW50ZXIgYW5kIGFw cGVuZC4gICovCisgIGZvciAoaSA9IDA7IGkgPCB1bm1hdGNoX2luZm9fY250 OyBpKyspCisgICAgeworICAgICAgZ2lfcHRyID0gaW5fc3JjX25vdF90Z3Rb aV07CisgICAgICBnY292X21lcmdlIChnaV9wdHIsIGdpX3B0ciwgdzIgLSAx KTsKKyAgICAgIHRndF90YWlsLT5uZXh0ID0gZ2lfcHRyOworICAgICAgdGd0 X3RhaWwgPSBnaV9wdHI7CisgICAgfQorCisgIHJldHVybiAwOworfQorCit0 eXBlZGVmIGdjb3ZfdHlwZSAoKmNvdW50ZXJfb3BfZm4pIChnY292X3R5cGUs IHZvaWQqLCB2b2lkKik7CisKKy8qIFBlcmZvcm1pbmcgRk4gdXBvbiBhcmMg Y291bnRlcnMuICAqLworCitzdGF0aWMgdm9pZAorX19nY292X2FkZF9jb3Vu dGVyX29wIChnY292X3R5cGUgKmNvdW50ZXJzLCB1bnNpZ25lZCBuX2NvdW50 ZXJzLAorICAgICAgICAgICAgICAgICAgICAgICBjb3VudGVyX29wX2ZuIGZu LCB2b2lkICpkYXRhMSwgdm9pZCAqZGF0YTIpCit7CisgIGZvciAoOyBuX2Nv dW50ZXJzOyBjb3VudGVycysrLCBuX2NvdW50ZXJzLS0pCisgICAgeworICAg ICAgZ2Nvdl90eXBlIHZhbCA9ICpjb3VudGVyczsKKyAgICAgICpjb3VudGVy cyA9IGZuKHZhbCwgZGF0YTEsIGRhdGEyKTsKKyAgICB9Cit9CisKKy8qIFBl cmZvcm1pbmcgRk4gdXBvbiBpb3IgY291bnRlcnMuICAqLworCitzdGF0aWMg dm9pZAorX19nY292X2lvcl9jb3VudGVyX29wIChnY292X3R5cGUgKmNvdW50 ZXJzIEFUVFJJQlVURV9VTlVTRUQsCisgICAgICAgICAgICAgICAgICAgICAg IHVuc2lnbmVkIG5fY291bnRlcnMgQVRUUklCVVRFX1VOVVNFRCwKKyAgICAg ICAgICAgICAgICAgICAgICAgY291bnRlcl9vcF9mbiBmbiBBVFRSSUJVVEVf VU5VU0VELAorICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpkYXRhMSBB VFRSSUJVVEVfVU5VU0VELAorICAgICAgICAgICAgICAgICAgICAgICB2b2lk ICpkYXRhMiBBVFRSSUJVVEVfVU5VU0VEKQoreworICAvKiBEbyBub3RoaW5n LiAgKi8KK30KKworLyogUGVyZm9ybWFpbmcgRk4gdXBvbiBkZWx0YSBjb3Vu dGVycy4gICovCisKK3N0YXRpYyB2b2lkCitfX2djb3ZfZGVsdGFfY291bnRl cl9vcCAoZ2Nvdl90eXBlICpjb3VudGVycywgdW5zaWduZWQgbl9jb3VudGVy cywKKyAgICAgICAgICAgICAgICAgICAgICAgICBjb3VudGVyX29wX2ZuIGZu LCB2b2lkICpkYXRhMSwgdm9pZCAqZGF0YTIpCit7CisgIHVuc2lnbmVkIGks IG5fbWVhc3VyZXM7CisKKyAgZ2NjX2Fzc2VydCAoIShuX2NvdW50ZXJzICUg NCkpOworICBuX21lYXN1cmVzID0gbl9jb3VudGVycyAvIDQ7CisgIGZvciAo aSA9IDA7IGkgPCBuX21lYXN1cmVzOyBpKyssIGNvdW50ZXJzICs9IDQpCisg ICAgeworICAgICAgY291bnRlcnNbMl0gPSBmbiAoY291bnRlcnNbMl0sIGRh dGExLCBkYXRhMik7CisgICAgICBjb3VudGVyc1szXSA9IGZuIChjb3VudGVy c1szXSwgZGF0YTEsIGRhdGEyKTsKKyAgICB9Cit9CisKKy8qIFBlcmZvcm1p bmcgRk4gdXBvbiBzaW5nbGUgY291bnRlcnMuICAqLworCitzdGF0aWMgdm9p ZAorX19nY292X3NpbmdsZV9jb3VudGVyX29wIChnY292X3R5cGUgKmNvdW50 ZXJzLCB1bnNpZ25lZCBuX2NvdW50ZXJzLAorICAgICAgICAgICAgICAgICAg ICAgICAgICBjb3VudGVyX29wX2ZuIGZuLCB2b2lkICpkYXRhMSwgdm9pZCAq ZGF0YTIpCit7CisgIHVuc2lnbmVkIGksIG5fbWVhc3VyZXM7CisKKyAgZ2Nj X2Fzc2VydCAoIShuX2NvdW50ZXJzICUgMykpOworICBuX21lYXN1cmVzID0g bl9jb3VudGVycyAvIDM7CisgIGZvciAoaSA9IDA7IGkgPCBuX21lYXN1cmVz OyBpKyssIGNvdW50ZXJzICs9IDMpCisgICAgeworICAgICAgY291bnRlcnNb MV0gPSBmbiAoY291bnRlcnNbMV0sIGRhdGExLCBkYXRhMik7CisgICAgICBj b3VudGVyc1syXSA9IGZuIChjb3VudGVyc1syXSwgZGF0YTEsIGRhdGEyKTsK KyAgICB9Cit9CisKKy8qIFNjYWxpbmcgdGhlIGNvdW50ZXIgdmFsdWUgViBi eSBtdWx0aXBseWluZyAqKGZsb2F0KikgREFUQTEuICAqLworCitzdGF0aWMg Z2Nvdl90eXBlCitmcF9zY2FsZSAoZ2Nvdl90eXBlIHYsIHZvaWQgKmRhdGEx LCB2b2lkICpkYXRhMiBBVFRSSUJVVEVfVU5VU0VEKQoreworICBmbG9hdCBm ID0gKihmbG9hdCAqKSBkYXRhMTsKKyAgcmV0dXJuIChnY292X3R5cGUpICh2 ICogZik7Cit9CisKKy8qIFNjYWxpbmcgdGhlIGNvdW50ZXIgdmFsdWUgViBi eSBtdWx0aXBseWluZyBEQVRBMi9EQVRBMS4gICovCisKK3N0YXRpYyBnY292 X3R5cGUKK2ludF9zY2FsZSAoZ2Nvdl90eXBlIHYsIHZvaWQgKmRhdGExLCB2 b2lkICpkYXRhMikKK3sKKyAgaW50IG4gPSAqKGludCAqKSBkYXRhMTsKKyAg aW50IGQgPSAqKGludCAqKSBkYXRhMjsKKyAgcmV0dXJuIChnY292X3R5cGUp ICggUkRJViAod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9mYWN0b3IsIG4sIGQpOwor CisgIC8qIFNjYWxpbmcgdGhlIGNvdW50ZXJzLiAgKi8KKyAgZm9yIChnaV9w dHIgPSBwcm9maWxlOyBnaV9wdHI7IGdpX3B0ciA9IGdpX3B0ci0+bmV4dCkK KyAgICBmb3IgKGZfaXggPSAwOyBmX2l4IDwgZ2lfcHRyLT5uX2Z1bmN0aW9u czsgZl9peCsrKQorICAgICAgeworICAgICAgICB1bnNpZ25lZCB0X2l4Owor ICAgICAgICBjb25zdCBzdHJ1Y3QgZ2Nvdl9mbl9pbmZvICpnZmlfcHRyID0g Z2lfcHRyLT5mdW5jdGlvbnNbZl9peF07CisgICAgICAgIGNvbnN0IHN0cnVj dCBnY292X2N0cl9pbmZvICpjaV9wdHI7CisKKyAgICAgICAgaWYgKCFnZmlf cHRyIHx8IGdmaV9wdHItPmtleSAhPSBnaV9wdHIpCisgICAgICAgICAgY29u dGludWU7CisKKyAgICAgICAgY2lfcHRyID0gZ2ZpX3B0ci0+Y3RyczsKKyAg ICAgICAgZm9yICh0X2l4ID0gMDsgdF9peCAhPSBHQ09WX0NPVU5URVJTOyB0 X2l4KyspCisgICAgICAgICAgeworICAgICAgICAgICAgZ2Nvdl9tZXJnZV9m biBtZXJnZSA9IGdpX3B0ci0+bWVyZ2VbdF9peF07CisKKyAgICAgICAgICAg IGlmICghbWVyZ2UpCisgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAg ICAgICAgaWYgKGQgPT0gMCkKKyAgICAgICAgICAgICAgKCpjdHJfZnVuY3Rp b25zW3RfaXhdKSAoY2lfcHRyLT52YWx1ZXMsIGNpX3B0ci0+bnVtLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcF9zY2FsZSwg JnNjYWxlX2ZhY3RvciwgTlVMTCk7CisgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgICgqY3RyX2Z1bmN0aW9uc1t0X2l4XSkgKGNpX3B0ci0+dmFs dWVzLCBjaV9wdHItPm51bSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaW50X3NjYWxlLCAmbiwgJmQpOworICAgICAgICAgICAg Y2lfcHRyKys7CisgICAgICAgICAgfQorICAgICAgfQorCisgIHJldHVybiAw OworfQorCisvKiBEcml2ZXIgdG8gbm9ybWFsaXplIHByb2ZpbGUgY291bnRl cnMuICAqLworCitpbnQKK2djb3ZfcHJvZmlsZV9ub3JtYWxpemUgKHN0cnVj dCBnY292X2luZm8gKnByb2ZpbGUsIGdjb3ZfdHlwZSBtYXhfdmFsKQorewor ICBzdHJ1Y3QgZ2Nvdl9pbmZvICpnaV9wdHI7CisgIGdjb3ZfdHlwZSBjdXJy X21heF92YWwgPSAwOworICB1bnNpZ25lZCBmX2l4OworICB1bnNpZ25lZCBp bnQgaTsKKyAgZmxvYXQgc2NhbGVfZmFjdG9yOworCisgIC8qIEZpbmQgdGhl IGxhcmdlc3QgY291bnQgdmFsdWUuICAqLworICBmb3IgKGdpX3B0ciA9IHBy b2ZpbGU7IGdpX3B0cjsgZ2lfcHRyID0gZ2lfcHRyLT5uZXh0KQorICAgIGZv ciAoZl9peCA9IDA7IGZfaXggPCBnaV9wdHItPm5fZnVuY3Rpb25zOyBmX2l4 KyspCisgICAgICB7CisgICAgICAgIHVuc2lnbmVkIHRfaXg7CisgICAgICAg IGNvbnN0IHN0cnVjdCBnY292X2ZuX2luZm8gKmdmaV9wdHIgPSBnaV9wdHIt PmZ1bmN0aW9uc1tmX2l4XTsKKyAgICAgICAgY29uc3Qgc3RydWN0IGdjb3Zf Y3RyX2luZm8gKmNpX3B0cjsKKworICAgICAgICBpZiAoIWdmaV9wdHIgfHwg Z2ZpX3B0ci0+a2V5ICE9IGdpX3B0cikKKyAgICAgICAgICBjb250aW51ZTsK KworICAgICAgICBjaV9wdHIgPSBnZmlfcHRyLT5jdHJzOworICAgICAgICBm b3IgKHRfaXggPSAwOyB0X2l4IDwgMTsgdF9peCsrKQorICAgICAgICAgIHsK KyAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBjaV9wdHItPm51bTsgaSsr KQorICAgICAgICAgICAgICBpZiAoY2lfcHRyLT52YWx1ZXNbaV0gPiBjdXJy X21heF92YWwpCisgICAgICAgICAgICAgICAgY3Vycl9tYXhfdmFsID0gY2lf cHRyLT52YWx1ZXNbaV07CisgICAgICAgICAgICBjaV9wdHIrKzsKKyAgICAg ICAgICB9CisgICAgICB9CisKKyAgc2NhbGVfZmFjdG9yID0gKGZsb2F0KW1h eF92YWwgLyBjdXJyX21heF92YWw7CisgIGlmICh2ZXJib3NlKQorICAgIGZw cmludGYgKHN0ZG91dCwgIm1heF92YWwgaXMgJWxsZFxuIiwgKGxvbmcgbG9u ZykgY3Vycl9tYXhfdmFsKTsKKworICByZXR1cm4gZ2Nvdl9wcm9maWxlX3Nj YWxlIChwcm9maWxlLCBzY2FsZV9mYWN0b3IsIDAsIDApOworfQpJbmRleDog bGliZ2NjL2xpYmdjb3YuaAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBs aWJnY2MvbGliZ2Nvdi5oCShyZXZpc2lvbiAyMDk5ODEpCisrKyBsaWJnY2Mv bGliZ2Nvdi5oCSh3b3JraW5nIGNvcHkpCkBAIC0zMyw2ICszMywxMCBAQAog I2RlZmluZSB4Y2FsbG9jIGNhbGxvYwogI2VuZGlmCiAKKyNpZm5kZWYgSU5f R0NPVl9UT09MCisvKiBBYm91dCB0aGUgdGFyZ2V0LiAgKi8KKy8qIFRoaXMg cGF0aCB3aWxsIGJlIHVzZWQgYnkgbGliZ2NvdiBydW50aW1lLiAgKi8KKwog I2luY2x1ZGUgInRjb25maWcuaCIKICNpbmNsdWRlICJ0c3lzdGVtLmgiCiAj aW5jbHVkZSAiY29yZXR5cGVzLmgiCkBAIC03OSw2ICs4Myw2MCBAQCB0eXBl ZGVmIHVuc2lnbmVkIGdjb3ZfdHlwZV91bnN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