From nobody Thu Nov 28 15:58:48 2024 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (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 3E6E71BC9ED for ; Tue, 1 Oct 2024 05:23:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727760224; cv=none; b=gFgLqSWwSTMREW4y5jGp4189laZ9O8Z1AgLM+DUzZBi5jHq52Zt/kpowf74bJ2jBeUXUC7cpKLcS3p2jWbZPgQEFO9nJCjM8Ckzzi5R6dGMpe1o/KYMBCaxWgjAUUT4zSPCBJu+2vQ2wf+NI168DxI7q/xv2ZK8HcgNTPmK7XcI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727760224; c=relaxed/simple; bh=HlaJPf1DpkhIcVfUnD58FBwEx20zYRsFkrETe/cFLkU=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=uePK62omdFfQKf+k3up/KoZnn3uQpxpn3HhVq89akNOyELasIWtb4sdSv5+bt67mEQlKmua3oqo9LNclhzqmmOzJQ5Z35uoNpr8Xm8AmCS0UA2gSG+LNOoHDebR328Kz1o+q4b2N8IuxL7SS2YBB98ploYaNNOooAtfCwEAWW04= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=juoDUpam; arc=none smtp.client-ip=209.85.128.202 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=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="juoDUpam" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-6e2364f45a4so55041587b3.2 for ; Mon, 30 Sep 2024 22:23:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1727760222; x=1728365022; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=FSpyv/AFjmfCtapMZ23chCRHMXjbu/7COuZjKrd4Qfk=; b=juoDUpamF7UF6rFT9yyark8XE+ageMESuAvoescAbFB2MNgcBEPj0ZBf4MZsbLgxaj IHR/IHrmCtYsAhT1xtzVZv9I+T4nitjiLsaOeBZPXc87vdNL8nv4aLppobokcqGCIANI c1nNnIOKZb+jiUwOxVOarYsBWp7yNpCW4og864bwsd4QzOrMlqspMe9x8+JuC8QV7oXp 35naNd0a47FgkZNq15jxTjr+3uEPeVAujIIvPw+zcfz9lLP9R6JQaJcbW2f1NoJVXHN4 bq5je00m5VZ2pmGiSBjxFsCLbBUngGIPlifZX1UMSS/Uyb6x8dKQzK8THhAIV/jrzSqM lyDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727760222; x=1728365022; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FSpyv/AFjmfCtapMZ23chCRHMXjbu/7COuZjKrd4Qfk=; b=QI5QxNo3uSQARp4T6x/PVWgLvBP+KtVo7+VLyrxgmB3ocXZrJtEcJT1tY6LyAVLN7a 0pXXS0gZcThYw24Ekph/ZVEyVhaE95/PSaVwk/fBU3WtbUbLLnnVMAVArX1Ytz5Eac4m sLSQtvlh6V4SQGIyVxEsJbAwbZ+CeFcOY8KY8UX8uy0ozRFtkYZl12iANRDxgO9/MMMj wB6am+MikNIAb43lpVAx99eRMpwDWYV45BJ+nlnEh2KSOpMrjWstYDr9KJdQ8tHYRVdd r8e2nxvX4ySXju+GfwkV8GVU5RbHaF0PMzh9aOrIDa79s0fF6rjf/Qa2ZnfUt4No8uW8 LQOA== X-Forwarded-Encrypted: i=1; AJvYcCWagS1kNC4pweRcQRiXFbuEWwzbFN8eIZbvMCfqgIAslJQMWWOQa2mOtZq8f87xzS2qOrEcOSegqKbWlRw=@vger.kernel.org X-Gm-Message-State: AOJu0YwsSmimmr/5Mf5wk9sz0fw9PfPUTQp90CXz2iENaXv6KPBjNZLy OQIySyqYNwYVuRQvDYz5ggKxxGdTQUKKpQvBhIW7Bq1vNQXx7fYywvf1CRZ5PuQmWo+7+AAGL7R xPpJWQw== X-Google-Smtp-Source: AGHT+IHVW0m7mS9IM+OEPcKA7PRFyrcmcKWvkbN5Gk4Zr0KfEbqS7bbdaJzOmzXtgquqf7+Qzi0FPyxKe+AE X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:f420:67c7:1eea:bb12]) (user=irogers job=sendgmr) by 2002:a05:690c:3005:b0:6e2:120b:be57 with SMTP id 00721157ae682-6e247604e65mr2217147b3.5.1727760222250; Mon, 30 Sep 2024 22:23:42 -0700 (PDT) Date: Mon, 30 Sep 2024 22:23:27 -0700 In-Reply-To: <20241001052327.7052-1-irogers@google.com> Message-Id: <20241001052327.7052-5-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241001052327.7052-1-irogers@google.com> X-Mailer: git-send-email 2.46.1.824.gd892dcdcdd-goog Subject: [PATCH v2 4/4] perf test: Skip not fail syscall tp fields test when insufficient permissions From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Clean up return value to be TEST_* rather than unspecific integer. Add test case skip reason. Skip test if EACCES comes back from evsel__newtp. Signed-off-by: Ian Rogers --- tools/perf/tests/openat-syscall-tp-fields.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tools/perf/tests/openat-syscall-tp-fields.c b/tools/perf/tests= /openat-syscall-tp-fields.c index 888df8eca981..3943da441979 100644 --- a/tools/perf/tests/openat-syscall-tp-fields.c +++ b/tools/perf/tests/openat-syscall-tp-fields.c @@ -40,7 +40,7 @@ static int test__syscall_openat_tp_fields(struct test_sui= te *test __maybe_unused int flags =3D O_RDONLY | O_DIRECTORY; struct evlist *evlist =3D evlist__new(); struct evsel *evsel; - int err =3D -1, i, nr_events =3D 0, nr_polls =3D 0; + int ret =3D TEST_FAIL, err, i, nr_events =3D 0, nr_polls =3D 0; char sbuf[STRERR_BUFSIZE]; =20 if (evlist =3D=3D NULL) { @@ -51,6 +51,7 @@ static int test__syscall_openat_tp_fields(struct test_sui= te *test __maybe_unused evsel =3D evsel__newtp("syscalls", "sys_enter_openat"); if (IS_ERR(evsel)) { pr_debug("%s: evsel__newtp\n", __func__); + ret =3D PTR_ERR(evsel) =3D=3D -EACCES ? TEST_SKIP : TEST_FAIL; goto out_delete_evlist; } =20 @@ -138,11 +139,21 @@ static int test__syscall_openat_tp_fields(struct test= _suite *test __maybe_unused } } out_ok: - err =3D 0; + ret =3D TEST_OK; out_delete_evlist: evlist__delete(evlist); out: - return err; + return ret; } =20 -DEFINE_SUITE("syscalls:sys_enter_openat event fields", syscall_openat_tp_f= ields); +static struct test_case tests__syscall_openat_tp_fields[] =3D { + TEST_CASE_REASON("syscalls:sys_enter_openat event fields", + syscall_openat_tp_fields, + "permissions"), + { .name =3D NULL, } +}; + +struct test_suite suite__syscall_openat_tp_fields =3D { + .desc =3D "syscalls:sys_enter_openat event fields", + .test_cases =3D tests__syscall_openat_tp_fields, +}; --=20 2.46.1.824.gd892dcdcdd-goog