From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by sourceware.org (Postfix) with ESMTPS id 4A94F3948827 for ; Wed, 23 Sep 2020 19:26:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4A94F3948827 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=serhei.io Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=me@serhei.io Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 8584DCB4; Wed, 23 Sep 2020 15:26:23 -0400 (EDT) Received: from imap21 ([10.202.2.71]) by compute7.internal (MEProxy); Wed, 23 Sep 2020 15:26:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=serhei.io; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm2; bh=QdRDFq3c9mPruPQza/ElqEZQy5LjIHd eZ8h/g1MTWHE=; b=LFPyb1M8PgWsDLEeJKiP5aeEKNUCoWWC6mlydkelGW62gol /e7CfOhNFNblXnBzCVOjBxpJko+Sl60Rnkncol4vDmr4uLxorD+sFKMhEs73KssR VUyzhZ8E719H3A4McKiVTeXrb2S7TkBf8d7NjwbaCHJqa78xJ8rtpl/Tbluix5+/ B6QBkAjZDFgteo2M8hwNMNBwFMpKIu57u4jXgnSGuYYGAit/4B2kQxjAekqO++GG qlJY9j+gE5y47BwqC1LKcW45hDAeu7pKYuo+49rg7NMh/OinqHnkIBs0XTdaRHMx HybbIweaRFWxKqKqT7lZo5Rr2niNKOiUEU7ndGQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=QdRDFq 3c9mPruPQza/ElqEZQy5LjIHdeZ8h/g1MTWHE=; b=n3fsxdO/NRM0W787IiiMlZ +UijEIfAXVbazY2/l3J5chMWaRlKnEdbq3DOU7QP3wrnWE4CqQX5YFZy95L1a20j NvBZbmuzqiiWrIIVq86Xolf3g3evMWtd5svtpFjJS2jj6gwjx/mydANpiFi38Kww 3Qgly87jQ1wLtEXohNjlmp2BibsiRR7LoopLizVk4Y80hwhz6LrsJAyalrgvaqQO MYbkBMI5YP0JNjiF1TlIpF7w5u86zgs2OT8ES3FM5RDzmDKeFzxAckNH66T35BDt k0ItlSVPSApZjyGRrcK0S8z5t+KtDU8mpj1jX+g/K5k1K+/TflwMDAO5rnSXlVlw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudeigddufeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfuvghr hhgvihcuofgrkhgrrhhovhdfuceomhgvsehsvghrhhgvihdrihhoqeenucggtffrrghtth gvrhhnpeefjefggfegffduheeitdeltdegjedtkefgueelhedutdfggedvgffhjeekiefg tdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmvg esshgvrhhhvghirdhioh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id D2D70660069; Wed, 23 Sep 2020 15:26:14 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-355-g3ece53b-fm-20200922.004-g3ece53b9 Mime-Version: 1.0 Message-Id: <6e7c5822-19a1-4a36-a88e-ba3a99b3af4d@www.fastmail.com> In-Reply-To: <20200923191517.1467231-1-keiths@redhat.com> References: <13bf0182-8055-a2d7-bbe7-a8454a948755@redhat.com> <20200923191517.1467231-1-keiths@redhat.com> Date: Wed, 23 Sep 2020 15:26:01 -0400 From: "Serhei Makarov" To: "Keith Seitz" Cc: Bunsen Subject: Re: [PATCH v2] Introduce simplified grok_architecture function Content-Type: text/plain X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: bunsen@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bunsen mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2020 19:26:27 -0000 LGTM, just have one niggle. On Wed, Sep 23, 2020, at 3:15 PM, Keith Seitz wrote: > +# Standardized architecture name mapping table. The "Native > configuration > +# is " line of a test run is matched against the keys in this table. > If > +# a match is found, the architecture is given by the corresponding > value. > +# Keys are regular expressions; values are functions which take the > regexp > +# match as parameter and return a string representatin of the > architecture. > +standard_architecture_map = {r'powerpc64-(\w+)-linux.*':lambda m: > 'ppc64', > + r'powerpc64le-(\w+)-linux.*':lambda m: > 'ppc64le', > + r'armv7l-(\w+)-linux-gnueabihf':lambda m: > 'armhf', > + r'(\w+)-(\w+)-linux.*':lambda m: > m.group(1)} LGTM, I like it. > # TODO Handle other exotic DejaGNU outcome codes if they come up. > test_outcome_map = {'PASS':'PASS', 'XPASS':'XPASS', 'IPASS':'PASS', > @@ -242,7 +232,7 @@ def annotate_dejagnu_log(testrun, logfile, > outcome_lines=[], > # (2) Parse the logfile and match its segments to the map of > testcases. > i = None # XXX index into testcases > j = 0 # XXX index into outcome_lines > - native_configuration_is = None > + testrun.arch = None > + if testrun.arch is None and line.startswith("Native > configuration is"): > + testrun.arch = grok_architecture(line) I would set uname_machine at this point and keep the 'testrun.arch = uname_machine' assignment in the block at the bottom. That way all the properties we plan to set are glanceable in one place. (Note the comment that says we plan to set testrun.osver but don't have the info yet.) I inherited this code layout from Martin Cermak's logproc code and I think keeping it intact helps maintainability. > - uname_machine = None > - if uname_machine is None: > - uname_machine = check_mapping(native_configuration_is, > - native_configuration_map) > - > - testrun.arch = uname_machine > # XXX testrun.osver should be extracted from buildbot repo path > testrun.version = gdb_version > testrun.year_month = year_month > --