Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932300AbdGCOus (ORCPT ); Mon, 3 Jul 2017 10:50:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60284 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932249AbdGCOuo (ORCPT ); Mon, 3 Jul 2017 10:50:44 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6AE7685545 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=none smtp.mailfrom=jolsa@kernel.org DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6AE7685545 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Peter Zijlstra , Namhyung Kim , David Ahern , Thomas Richter Subject: [PATCH 05/15] perf tests attr: Rename compare_data to data_equal Date: Mon, 3 Jul 2017 16:50:20 +0200 Message-Id: <20170703145030.12903-6-jolsa@kernel.org> In-Reply-To: <20170703145030.12903-1-jolsa@kernel.org> References: <20170703145030.12903-1-jolsa@kernel.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 03 Jul 2017 14:50:43 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1778 Lines: 51 The data_equal name fits better to the return value of the function. It's true when the data is equal. Link: http://lkml.kernel.org/n/tip-rmebesaea5axp8fq9lfvx35s@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/tests/attr.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/perf/tests/attr.py b/tools/perf/tests/attr.py index bb671cd1d66a..b03261c6b1ed 100644 --- a/tools/perf/tests/attr.py +++ b/tools/perf/tests/attr.py @@ -9,7 +9,7 @@ import logging import shutil import ConfigParser -def compare_data(a, b): +def data_equal(a, b): # Allow multiple values in assignment separated by '|' a_list = a.split('|') b_list = b.split('|') @@ -101,7 +101,7 @@ class Event(dict): log.debug(" [%s] %s %s" % (t, self[t], other[t])); if not self.has_key(t) or not other.has_key(t): return False - if not compare_data(self[t], other[t]): + if not data_equal(self[t], other[t]): return False return True @@ -109,7 +109,7 @@ class Event(dict): for t in Event.terms: if not self.has_key(t) or not other.has_key(t): continue - if not compare_data(self[t], other[t]): + if not data_equal(self[t], other[t]): log.warning("expected %s=%s, got %s" % (t, self[t], other[t])) # Test file description needs to have following sections: @@ -220,7 +220,7 @@ class Test(object): log.info(" '%s' ret '%s', expected '%s'" % (cmd, str(ret), str(self.ret))) - if not compare_data(str(ret), str(self.ret)): + if not data_equal(str(ret), str(self.ret)): raise Unsup(self) def compare(self, expect, result): -- 2.9.4