From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 126AEC433DF for ; Wed, 29 Jul 2020 11:25:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E4C6020829 for ; Wed, 29 Jul 2020 11:25:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="HGaBNHkZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726476AbgG2LZd (ORCPT ); Wed, 29 Jul 2020 07:25:33 -0400 Received: from us-smtp-delivery-74.mimecast.com ([216.205.24.74]:21637 "EHLO us-smtp-delivery-74.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726353AbgG2LZd (ORCPT ); Wed, 29 Jul 2020 07:25:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596021931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=agULd+iNaamozlyp0IIId3EUPs3ltJ7uHXJPbleqiKE=; b=HGaBNHkZQ457ACjLgYlgzMAK2wwlzCmRlwWSQRsgmCkMsyzZxOWu2mHu8aHdvrl3CBH88a h9txLV02fiOipX72T9cZp6t8vRVUBJMxtHMxQX8gtjCRgPgiludzxE6k64go/MmhXnKbeJ aU4+FKyYTlsJkvjqTS7NKmlYc6JEGko= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-369-79PhX5N1P3CTHqiUpDcTxw-1; Wed, 29 Jul 2020 07:25:27 -0400 X-MC-Unique: 79PhX5N1P3CTHqiUpDcTxw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 034D280046A; Wed, 29 Jul 2020 11:25:24 +0000 (UTC) Received: from krava (unknown [10.40.193.247]) by smtp.corp.redhat.com (Postfix) with SMTP id C2FFA61100; Wed, 29 Jul 2020 11:25:19 +0000 (UTC) Date: Wed, 29 Jul 2020 13:25:18 +0200 From: Jiri Olsa To: Andrii Nakryiko Cc: Jiri Olsa , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Wenbo Zhang , Networking , bpf , Song Liu , Yonghong Song , Martin KaFai Lau , David Miller , John Fastabend , KP Singh , Brendan Gregg , Florent Revest , Al Viro Subject: Re: [PATCH v8 bpf-next 12/13] selftests/bpf: Add test for d_path helper Message-ID: <20200729112518.GH1319041@krava> References: <20200722211223.1055107-1-jolsa@kernel.org> <20200722211223.1055107-13-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Jul 28, 2020 at 12:53:00PM -0700, Andrii Nakryiko wrote: SNIP > > + if (CHECK_FAIL(ret < 0)) > > + goto out_close; > > + ret = set_pathname(procfd, pid); > > + if (CHECK_FAIL(ret < 0)) > > + goto out_close; > > + ret = set_pathname(devfd, pid); > > + if (CHECK_FAIL(ret < 0)) > > + goto out_close; > > + ret = set_pathname(localfd, pid); > > + if (CHECK_FAIL(ret < 0)) > > + goto out_close; > > + ret = set_pathname(indicatorfd, pid); > > + if (CHECK_FAIL(ret < 0)) > > + goto out_close; > > Please use CHECK instead of CHECK_FAIL. Thanks. ok > > diff --git a/tools/testing/selftests/bpf/progs/test_d_path.c b/tools/testing/selftests/bpf/progs/test_d_path.c > > new file mode 100644 > > index 000000000000..e02dce614256 > > --- /dev/null > > +++ b/tools/testing/selftests/bpf/progs/test_d_path.c > > @@ -0,0 +1,64 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > + > > +#include "vmlinux.h" > > +#include > > +#include > > + > > +#define MAX_PATH_LEN 128 > > +#define MAX_EVENT_NUM 16 > > + > > +pid_t my_pid; > > +__u32 cnt_stat; > > +__u32 cnt_close; > > +char paths_stat[MAX_EVENT_NUM][MAX_PATH_LEN]; > > +char paths_close[MAX_EVENT_NUM][MAX_PATH_LEN]; > > +int rets_stat[MAX_EVENT_NUM]; > > +int rets_close[MAX_EVENT_NUM]; > > + > > please zero-initialize all of these, it causes issues on some Clang versions ook jirka