Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp663511rdb; Thu, 22 Feb 2024 16:02:33 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWTtHmchTmcE0Zqt1P7cThoydlpoWaxva1lcZVLYAqtvf0WCgNtpY8bU4TkwNjLrBg+DlSAMAMGfoC848FlR8T/bNBZmuJQhWrkQCPmow== X-Google-Smtp-Source: AGHT+IE96FEmHp5xS/x8eBcCggiKxBj8GwHexT8gIsS4Rga601QXLsTnILmo/L7uWUKZqmSKPzMM X-Received: by 2002:a81:4419:0:b0:607:826d:afd1 with SMTP id r25-20020a814419000000b00607826dafd1mr633771ywa.16.1708646552889; Thu, 22 Feb 2024 16:02:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708646552; cv=pass; d=google.com; s=arc-20160816; b=ul6zrYLV2ZEmAIEAr2niQqxVHOBZw22Amc2qFD115yUnG0jIsPNFEuovlqIQDkUqj3 A9f9zqmTV7l1cYO0pGaQW+kIg5dXQFMNYW4UoY6rAK2qLMf+ddH7cA8Jqs6s0R6hQ+vB pGyMKdERwEh1YEV6NYRUmT9N1Cnr35DUrlmJBMtWPpoDXeZwwoEh9xpuQgMHntQu+NwC Eu3bgK1MUhOe7ZSiGuULGS9giITgMDHDURs5NbyebDUfmU2jUgmf3vM4MdQmV+SaNEqV mMLymm/jXfqxYTdEYH05ZGLfyk1D0T8vMsiVB2BnR4V/6xfz3/WgXj3qWz7F9LlivF+p xjrQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=YKIqei624U8pNnH0un8neNQZM9OozSHq1mh1Op7pFks=; fh=Mi/yI3opO8ohcPimXAw5ajH/TU/0CfIRlhQp/vw/idM=; b=Irxj+MSYKM2OliQRITrUh91IwvNzriPaZUXJyhlV96UhA3c7LGsxwyVD8rSVgL4sCB Lq4DM4ZAHamnN+1HBLROa69uif005/ZKRdPdN1QEcrSKpXfMp7kU8YR54SgRhSnoqZN6 1/UDKk0+4HYTB4y5jS0EldE/BEJkgzVhYM1OgZD033WmkLmyfdodtSeqDHbAZY94UqnQ BVlErfLpxXwg/71s0Pw45inbYRYvucc07ZaNem60xi/6aZGxgZn1paDP06gXO37MFvp0 hWJNWE9MikaeXFDyyEZv3w6AndR1t7SeTfsRj8AjpfqPwo1Ih16/hWKMygCnrE4pVPxw TWew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=obHVaBWm; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-77551-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77551-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o11-20020ac872cb000000b0042c2ca241b9si12491138qtp.200.2024.02.22.16.02.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 16:02:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77551-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=obHVaBWm; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-77551-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77551-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A471E1C21EF5 for ; Fri, 23 Feb 2024 00:02:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 015E820EB; Fri, 23 Feb 2024 00:02:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="obHVaBWm" Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8178370 for ; Fri, 23 Feb 2024 00:02:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708646545; cv=none; b=rEnUbvBXG6eXgmnsRPuB+h8+aKcnhrUFpHNP9F68yDq1hHnBSKvYWvAB2DRTOiQ7hhGOGrDH1Pe3H2Muay3o40q7A8dIuJOeC9g86iX3qmKM3lZ6oCh4EiYHrkCUFx+HM85fCrGPwC5TuGAzht8CI/RHZFdKyoxy/Ocog7RSgU8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708646545; c=relaxed/simple; bh=e+0tBc5rl3AsuopjGEnlgHYKkTUemBC1S0uodgi3rj8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ff3XXxaRwVyCI57i45mbEp74mhoBqffOqlfies3CxROCB1UPfk+aJR4lHF+eRYvDySgH6r8pm7GJvkv/RpQBSoIQzq4aAPwXbq9Jo13pqngOXPHBhM6RCmB2fF0/3ekyKgKdeSR9vmqQAdhpVbVmeAu7KdjFJ5LIcbAAZP9+C9g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=obHVaBWm; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1d5ce88b51cso36145ad.0 for ; Thu, 22 Feb 2024 16:02:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708646543; x=1709251343; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=YKIqei624U8pNnH0un8neNQZM9OozSHq1mh1Op7pFks=; b=obHVaBWmN2MUW8UVZkDATg3Eh6mC8E/svZFewFXut+0YRIgCGRAES2gnH8zfUHxUp1 cDpVN+MICjIpv1l2xiDoVBPOMlzTI8CBTV/kK/cWR4v85gjzncbe2W7UdcmmqDfgQFt2 nZC9YnB0aFeD47dbjoq4FMNf3VaymQHRhDoqmG//EkRP2EuHGKm3Yes8QWSar+lIQkuB s4dp7/p9BbFk8qrg+bYyMrh4lLJw5uAePzRv5Y7+rE8rb/oO1gBrAtP4N6xWxItSOKD+ 5eVZbcafepdjCo2lV/J5QV/E4Y4xkOyc5e9OdQQ5JsEicVC7rPeiIvvkDtLQKS2EiI8V SiCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708646543; x=1709251343; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YKIqei624U8pNnH0un8neNQZM9OozSHq1mh1Op7pFks=; b=YQvQlSVnrlSd9mZE+xCe1NbOycfDVGMTVLJknDfa0ENtMRJVL6f29NczeRJW77ZyQo gqrhLyN3Z6MDH3Lpl+aNOxvZsIovBPdcBQkOo3IG+Spf/pHw60Tj+n9X+ONtzKdczkXK 6+NHHgl8lYtkEoLw+iaehZLPC9kqZMW706y1z9I6EjL/2FCRUcO7WTqxY29ezYa6O20d ZBL7+sEFIlniae/1MdVG3KRh32vqxilpwS+YkAQ4FUudyN4PGlPR1StF2OXUP5yKdx2E I3KEF5WW6yol34HzmurcqVvaV1T+PTKddKhUWTEjqHJDNuzZw1Js1gKTtRtnZw36jtNN gW8Q== X-Forwarded-Encrypted: i=1; AJvYcCU+33UWb+LYeFRfhiBfSvZ7P2FLqqEN4zu1ecsymjXlVyeqkcfrCdHjln5/0aTP5fbd3iCD9P3qgM0gDXeRTtD1VYh27RTmoEzRYwS0 X-Gm-Message-State: AOJu0YzJswd2jQJ5zpdOa7ohpoaklmdwUZt9WNnF60JDlUQwv5m9g2CK JfQg3fxLkxV9JhcoOCRhP1pgf9VN/9WoCGSmqKgOdQVMOPXBzhct5Ty4ONzuMqvYotvIQfrPeFy YWI176srWRwhNvfqXATFehfSu3xoXMNSkNBf/yEXOhn/AyznorcXc X-Received: by 2002:a17:903:4093:b0:1d9:6949:6c88 with SMTP id z19-20020a170903409300b001d969496c88mr606312plc.17.1708646542627; Thu, 22 Feb 2024 16:02:22 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Ian Rogers Date: Thu, 22 Feb 2024 16:02:07 -0800 Message-ID: Subject: Re: [PATCH 1/1] perf test: Use TEST_FAIL in the TEST_ASSERT macros instead of -1 To: Arnaldo Carvalho de Melo Cc: Namhyung Kim , Adrian Hunter , Jiri Olsa , Linux Kernel Mailing List , linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Feb 22, 2024 at 12:07=E2=80=AFPM Arnaldo Carvalho de Melo wrote: > > Just to make things clearer, return TEST_FAIL (-1) instead of an open > coded -1. > > Cc: Adrian Hunter > Cc: Ian Rogers > Cc: Jiri Olsa > Cc: Namhyung Kim > Signed-off-by: Arnaldo Carvalho de Melo Reviewed-by: Ian Rogers Thanks, Ian > --- > tools/perf/tests/tests.h | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h > index dad3d7414142d1be..3aa7701ee0e939f7 100644 > --- a/tools/perf/tests/tests.h > +++ b/tools/perf/tests/tests.h > @@ -4,11 +4,17 @@ > > #include > > +enum { > + TEST_OK =3D 0, > + TEST_FAIL =3D -1, > + TEST_SKIP =3D -2, > +}; > + > #define TEST_ASSERT_VAL(text, cond) = \ > do { = \ > if (!(cond)) { = \ > pr_debug("FAILED %s:%d %s\n", __FILE__, __LINE__, text); = \ > - return -1; = \ > + return TEST_FAIL; = \ > } = \ > } while (0) > > @@ -17,16 +23,10 @@ do { = \ > if (val !=3D expected) { = \ > pr_debug("FAILED %s:%d %s (%d !=3D %d)\n", = \ > __FILE__, __LINE__, text, val, expected); = \ > - return -1; = \ > + return TEST_FAIL; = \ > } = \ > } while (0) > > -enum { > - TEST_OK =3D 0, > - TEST_FAIL =3D -1, > - TEST_SKIP =3D -2, > -}; > - > struct test_suite; > > typedef int (*test_fnptr)(struct test_suite *, int); > -- > 2.43.0 >