Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp996084ybb; Wed, 1 Apr 2020 13:35:39 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuskXW1k70pgI5IznXxYHeT1h+nsxfblgPX7qUS0391QgAHBQa2V0vwfxnNaCdd0TUcKTpz X-Received: by 2002:a9d:6a02:: with SMTP id g2mr14079922otn.196.1585773339505; Wed, 01 Apr 2020 13:35:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585773339; cv=none; d=google.com; s=arc-20160816; b=aG6oH4hyoxG/ys/Yrm+YvnsNBfbAJM7FCelY+l6ImfcngR3luPLXaYmo9eyMQ3Zf/X ThDgrDbSO5XILfVs8afcXEv3p8Nk07oIytNxnKIfSqy/JTRuxYe5uZfJYDuErVHoyntk 2my4wrlAL9BAizPPw0OrfmEHnqPGIb8G+NsX8ctXSo/Lxz6fiq/hxVc6AYg1jv3YWL+y s2AowpUsyuSySeL2ET6zVGMmthNtRvCdjzBXegHUILKjYl749zi/FQ3pTHZ3kjA0plk3 slQDmLdhM2p5qex/kBgQEm6np5x2rhCwwEU66owFMgxrDg4q0cunR1dkcdQRvYfhvx4N DqRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:subject:cc:to:from; bh=doNDqlz7/gU91uOJ/J+6/lnmA4IkB68KW4mUacTFArQ=; b=s9ohu9W5O+EGl8t27axa+1FxWixw0XbyUKJJn2znhZGovH3k2QLJZf+6fCZOOTcdDD 3z5OjIVWntaCAj6HWxPzL6TAaDZoy58w20RyoywhyC0kYhngnqxliO/jkjYKdEDCulZo kkEFZRvbfTDLYX8WrZiRZgc2pjVVoz50Xi7HvH8SBt1ojJVsZq4O6Pez8mlCs4aTbDNJ gFZmPlIZtBXD/Mae1LxdqhTQ+7ysehdOoRyTFQeGdQ8SBP1TtiRm57nk4w+Ravh0PQXs yc2q3rVG4fxAjj751UcjZmkmwSs3+fe6J+rzcOGTMIHsa6spbNtqaaumtA29xniECPdl OccA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r67si1329386oib.237.2020.04.01.13.35.27; Wed, 01 Apr 2020 13:35:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733095AbgDAUfB (ORCPT + 99 others); Wed, 1 Apr 2020 16:35:01 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:60814 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733049AbgDAUe7 (ORCPT ); Wed, 1 Apr 2020 16:34:59 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 031KYMmL100450 for ; Wed, 1 Apr 2020 16:34:58 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 304sws7mc5-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 01 Apr 2020 16:34:58 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 1 Apr 2020 21:34:48 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 1 Apr 2020 21:34:42 +0100 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 031KYmuX23462132 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 1 Apr 2020 20:34:48 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9A914A4054; Wed, 1 Apr 2020 20:34:48 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 081A2A405B; Wed, 1 Apr 2020 20:34:43 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.199.38.236]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 1 Apr 2020 20:34:42 +0000 (GMT) From: Kajol Jain To: acme@kernel.org, linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au, sukadev@linux.vnet.ibm.com Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, anju@linux.vnet.ibm.com, maddy@linux.vnet.ibm.com, ravi.bangoria@linux.ibm.com, peterz@infradead.org, yao.jin@linux.intel.com, ak@linux.intel.com, jolsa@kernel.org, kan.liang@linux.intel.com, jmario@redhat.com, alexander.shishkin@linux.intel.com, mingo@kernel.org, paulus@ozlabs.org, namhyung@kernel.org, mpetlan@redhat.com, gregkh@linuxfoundation.org, benh@kernel.crashing.org, mamatha4@linux.vnet.ibm.com, mark.rutland@arm.com, tglx@linutronix.de, kjain@linux.ibm.com Subject: [PATCH v8 5/7] perf/tests/expr: Added test for runtime param in metric expression Date: Thu, 2 Apr 2020 02:03:38 +0530 X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200401203340.31402-1-kjain@linux.ibm.com> References: <20200401203340.31402-1-kjain@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 20040120-0012-0000-0000-0000039C7DB3 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20040120-0013-0000-0000-000021D98EE8 Message-Id: <20200401203340.31402-6-kjain@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-04-01_04:2020-03-31,2020-04-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 suspectscore=2 bulkscore=0 clxscore=1015 lowpriorityscore=0 mlxlogscore=999 phishscore=0 adultscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004010165 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Added test case for parsing "?" in metric expression. Signed-off-by: Kajol Jain --- tools/perf/tests/expr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/perf/tests/expr.c b/tools/perf/tests/expr.c index 516504cf0ea5..f9e8e5628836 100644 --- a/tools/perf/tests/expr.c +++ b/tools/perf/tests/expr.c @@ -59,6 +59,14 @@ int test__expr(struct test *t __maybe_unused, int subtest __maybe_unused) TEST_ASSERT_VAL("find other", !strcmp(other[2], "BOZO")); TEST_ASSERT_VAL("find other", other[3] == NULL); + TEST_ASSERT_VAL("find other", + expr__find_other("EVENT1\\,param\\=?@ + EVENT2\\,param\\=?@", NULL, + &other, &num_other, 3) == 0); + TEST_ASSERT_VAL("find other", num_other == 2); + TEST_ASSERT_VAL("find other", !strcmp(other[0], "EVENT1,param=3/")); + TEST_ASSERT_VAL("find other", !strcmp(other[1], "EVENT2,param=3/")); + TEST_ASSERT_VAL("find other", other[2] == NULL); + for (i = 0; i < num_other; i++) zfree(&other[i]); free((void *)other); -- 2.21.0